Download

Support

Ewl_Grid: The ewl grid widget


Detailed Description

The Ewl Grid widget.

Remarks:
Inherits from Ewl_Container.

Tutorial


Data Structures

struct  Ewl_Grid
 Inherit from Ewl_Container and extend to privide a grid layout widget. More...
struct  Ewl_Grid_Child
 Contains information about a grid child. More...
struct  Ewl_Grid_Info
 Contains information about a row or column of Ewl_Grid. More...

Defines

#define EWL_GRID(grid)   ((Ewl_Grid *)grid)
#define EWL_GRID_IS(w)   (ewl_widget_type_is(EWL_WIDGET(w), EWL_GRID_TYPE))
#define EWL_GRID_TYPE   "grid"

Typedefs

typedef struct Ewl_Grid Ewl_Grid
typedef struct Ewl_Grid_Child Ewl_Grid_Child
typedef struct Ewl_Grid_Info Ewl_Grid_Info

Functions

void ewl_grid_cb_child_add (Ewl_Container *p, Ewl_Widget *c)
void ewl_grid_cb_child_remove (Ewl_Container *p, Ewl_Widget *c, int idx)
void ewl_grid_cb_child_resize (Ewl_Container *p, Ewl_Widget *child, int size, Ewl_Orientation o)
void ewl_grid_cb_child_show (Ewl_Container *p, Ewl_Widget *child)
void ewl_grid_cb_configure (Ewl_Widget *w, void *ev_data, void *user_data)
void ewl_grid_cb_destroy (Ewl_Widget *w, void *ev_data, void *user_data)
void ewl_grid_child_position_get (Ewl_Grid *g, Ewl_Widget *child, int *start_col, int *end_col, int *start_row, int *end_row)
 get the position of a child widget
void ewl_grid_child_position_set (Ewl_Grid *g, Ewl_Widget *child, int start_col, int end_col, int start_row, int end_row)
 Give a child widget a fixed-postion in the grid.
int ewl_grid_column_current_w_get (Ewl_Grid *g, int col)
 Get the current width of a column.
int ewl_grid_column_fixed_w_get (Ewl_Grid *g, int col)
 Get the user set width of a column.
void ewl_grid_column_fixed_w_set (Ewl_Grid *g, int col, int width)
 Set the fixed size of a column.
void ewl_grid_column_preferred_w_use (Ewl_Grid *g, int col)
 use the preferred size of the column
float ewl_grid_column_relative_w_get (Ewl_Grid *g, int col)
 Get the user set relative width of a column.
void ewl_grid_column_relative_w_set (Ewl_Grid *g, int col, float relw)
 Set the relative width of a column.
void ewl_grid_column_w_remove (Ewl_Grid *g, int col)
 remove the user set size
void ewl_grid_dimensions_get (Ewl_Grid *g, int *col, int *row)
 get the number of columns and rows
void ewl_grid_dimensions_set (Ewl_Grid *g, int col, int row)
 sets the new dimensions
unsigned int ewl_grid_hhomogeneous_get (Ewl_Grid *g)
 Retrieves the horizontal homogeneous flag.
void ewl_grid_hhomogeneous_set (Ewl_Grid *g, unsigned int h)
 Change the horizontal homogeneous layout of the box.
void ewl_grid_homogeneous_set (Ewl_Grid *g, unsigned int h)
 Change the homogeneous layout of the grid.
int ewl_grid_init (Ewl_Grid *g)
 Initializes an Ewl_Grid widget to default values.
Ewl_Widgetewl_grid_new (void)
 Create a new Ewl_Grid widget.
Ewl_Orientation ewl_grid_orientation_get (Ewl_Grid *g)
 Retrieves the fill orientation flag.
void ewl_grid_orientation_set (Ewl_Grid *g, Ewl_Orientation orientation)
 Change the fill orientation.
int ewl_grid_row_current_h_get (Ewl_Grid *g, int row)
 Get the current height of a column.
int ewl_grid_row_fixed_h_get (Ewl_Grid *g, int row)
 Get the user set height of a row.
void ewl_grid_row_fixed_h_set (Ewl_Grid *g, int row, int height)
 Set the fixed size of a column.
void ewl_grid_row_h_remove (Ewl_Grid *g, int row)
 remove the user set size
void ewl_grid_row_preferred_h_use (Ewl_Grid *g, int col)
 use the preferred size of the row
float ewl_grid_row_relative_h_get (Ewl_Grid *g, int col)
 Get the user set relative height of a row.
void ewl_grid_row_relative_h_set (Ewl_Grid *g, int col, float relh)
 Set the relative height of a row.
unsigned int ewl_grid_vhomogeneous_get (Ewl_Grid *g)
 Retrieves the vertical homogeneous flag.
void ewl_grid_vhomogeneous_set (Ewl_Grid *g, unsigned int h)
 Change the vertical homogeneous layout of the box.

Define Documentation

#define EWL_GRID_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_GRID_TYPE))

Returns TRUE if the widget is an Ewl_Grid, FALSE otherwise


Typedef Documentation

typedef struct Ewl_Grid Ewl_Grid

The Ewl_Grid widget

The Ewl_Grid_Child type

typedef struct Ewl_Grid_Info Ewl_Grid_Info

The Ewl_Grid_Info structure


Function Documentation

void ewl_grid_cb_child_resize ( Ewl_Container p,
Ewl_Widget child,
int  size,
Ewl_Orientation  o 
)

void ewl_grid_cb_child_show ( Ewl_Container p,
Ewl_Widget child 
)

void ewl_grid_cb_destroy ( Ewl_Widget w,
void *  ev_data,
void *  user_data 
)

void ewl_grid_child_position_get ( Ewl_Grid g,
Ewl_Widget w,
int *  start_col,
int *  end_col,
int *  start_row,
int *  end_row 
)

get the position of a child widget

Parameters:
g,: the grid
w,: the child widget
start_col,: the start column
end_col,: the end column
start_row,: the start row
end_row,: the end row
Returns:
Returns no value

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, Ewl_Grid_Child::end_col, Ewl_Grid_Child::end_row, EWL_CONTAINER, EWL_GRID_TYPE, EWL_ORIENTATION_HORIZONTAL, ewl_widget_data_get(), EWL_WIDGET_TYPE, map, orientation, Ewl_Grid_Child::start_col, Ewl_Grid_Child::start_row, and UNMANAGED.

void ewl_grid_child_position_set ( Ewl_Grid g,
Ewl_Widget w,
int  start_col,
int  end_col,
int  start_row,
int  end_row 
)

Give a child widget a fixed-postion in the grid.

Parameters:
g,: the grid
w,: the child widget
start_col,: the start column
end_col,: the end column
start_row,: the start row
end_row,: the end row
Returns:
Returns no value

References cols, data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, Ewl_Grid_Child::end_col, Ewl_Grid_Child::end_row, ewl_grid_dimensions_set(), EWL_GRID_TYPE, EWL_ORIENTATION_HORIZONTAL, EWL_WIDGET, ewl_widget_configure(), ewl_widget_data_get(), ewl_widget_data_set(), EWL_WIDGET_TYPE, IF_FREE, map, NEW, orientation, rows, space, Ewl_Grid_Child::start_col, and Ewl_Grid_Child::start_row.

Referenced by ewl_table_add(), ewl_table_init(), and ewl_table_reset().

int ewl_grid_column_current_w_get ( Ewl_Grid g,
int  col 
)

Get the current width of a column.

Parameters:
g,: the grid
col,: the column
Returns:
Returns the current width This function returns current width of the column.

References col_size, cols, Ewl_Grid_Info::current_size, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, and EWL_GRID_TYPE.

int ewl_grid_column_fixed_w_get ( Ewl_Grid g,
int  col 
)

Get the user set width of a column.

Parameters:
g,: the grid
col,: the column
Returns:
Returns the user set width This function returns only the size set by the user.

References col_size, cols, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, Ewl_Grid_Info::size, and Ewl_Grid_Info::user.

Referenced by ewl_table_column_w_get().

void ewl_grid_column_fixed_w_set ( Ewl_Grid g,
int  col,
int  width 
)

Set the fixed size of a column.

Parameters:
g,: the grid
col,: the column
width,: the new width
Returns:
Returns no value.

References col_size, cols, data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, ewl_grid_dimensions_set(), EWL_GRID_RESIZE_FIXED, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), Ewl_Grid_Info::resize_type, rows, Ewl_Grid_Info::size, and Ewl_Grid_Info::user.

Referenced by ewl_table_column_w_set().

void ewl_grid_column_preferred_w_use ( Ewl_Grid g,
int  col 
)

float ewl_grid_column_relative_w_get ( Ewl_Grid g,
int  col 
)

Get the user set relative width of a column.

Parameters:
g,: the grid
col,: the column
Returns:
Returns the user set relative width This function returns only the relative size set by the user.

References col_size, cols, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_GRID_TYPE, Ewl_Grid_Info::rel_size, and Ewl_Grid_Info::user.

void ewl_grid_column_relative_w_set ( Ewl_Grid g,
int  col,
float  relw 
)

Set the relative width of a column.

Parameters:
g,: the grid
col,: the column
relw,: the new relative width
Returns:
Returns no value.

References col_size, cols, data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, ewl_grid_dimensions_set(), EWL_GRID_RESIZE_RELATIVE, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), Ewl_Grid_Info::rel_size, Ewl_Grid_Info::resize_type, rows, and Ewl_Grid_Info::user.

void ewl_grid_column_w_remove ( Ewl_Grid g,
int  col 
)

void ewl_grid_dimensions_get ( Ewl_Grid g,
int *  cols,
int *  rows 
)

get the number of columns and rows

Parameters:
g,: the grid
cols,: a pointer where the number of columns will be saved
rows,: a pointer where the number of rows will be saved
Returns:
Returns no value

References cols, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_GRID_TYPE, and rows.

unsigned int ewl_grid_hhomogeneous_get ( Ewl_Grid g  ) 

Retrieves the horizontal homogeneous flag.

Parameters:
g,: the grid to get the homogeneous layout
Returns:
The horizontal homogeneous flag

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, and homogeneous_h.

void ewl_grid_hhomogeneous_set ( Ewl_Grid g,
unsigned int  h 
)

Change the horizontal homogeneous layout of the box.

Parameters:
g,: the grid to change horizontal homogeneous layout
h,: the boolean value to change the horizontal layout mode to
Returns:
Returns no value. Grids use non-homogeneous layout by default, this can be used to change that for horizontal orientation, i.e. all columns can have the same width.

References data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), and homogeneous_h.

Referenced by ewl_grid_homogeneous_set(), and ewl_table_hhomogeneous_set().

void ewl_grid_homogeneous_set ( Ewl_Grid g,
unsigned int  h 
)

Change the homogeneous layout of the grid.

Parameters:
g,: the grid to change homogeneous layout
h,: the boolean value to change the layout mode to
Returns:
Returns no value. Grids use non-homogeneous layout by default, this can be used to change that.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_grid_hhomogeneous_set(), EWL_GRID_TYPE, ewl_grid_vhomogeneous_set(), homogeneous_h, and homogeneous_v.

Ewl_Widget* ewl_grid_new ( void   ) 

Create a new Ewl_Grid widget.

Returns:
Returns a pointer to a grid on success or NULL on failure.

References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_grid_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.

Referenced by ewl_calendar_init(), ewl_colorpicker_init(), and ewl_table_init().

Ewl_Orientation ewl_grid_orientation_get ( Ewl_Grid g  ) 

Retrieves the fill orientation flag.

Parameters:
g,: the grid to get the fill orientation
Returns:
The fill orientation flag

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, and orientation.

void ewl_grid_orientation_set ( Ewl_Grid g,
Ewl_Orientation  orientation 
)

Change the fill orientation.

Parameters:
g,: the grid to change the fill orientation
orientation,: the Ewl_Orientation value
Returns:
Returns no value.

References data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), and orientation.

int ewl_grid_row_current_h_get ( Ewl_Grid g,
int  row 
)

Get the current height of a column.

Parameters:
g,: the grid
row,: the row
Returns:
Returns the current height This function returns current width of the column.

References Ewl_Grid_Info::current_size, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, row_size, and rows.

int ewl_grid_row_fixed_h_get ( Ewl_Grid g,
int  row 
)

Get the user set height of a row.

Parameters:
g,: the grid
row,: the row
Returns:
Returns the user set height This function returns only the size set by the user.

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, row_size, rows, Ewl_Grid_Info::size, and Ewl_Grid_Info::user.

Referenced by ewl_table_row_h_get().

void ewl_grid_row_fixed_h_set ( Ewl_Grid g,
int  row,
int  height 
)

Set the fixed size of a column.

Parameters:
g,: the grid
row,: the row
height,: the new height
Returns:
Returns no value.

References cols, data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, ewl_grid_dimensions_set(), EWL_GRID_RESIZE_FIXED, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), Ewl_Grid_Info::resize_type, row_size, rows, Ewl_Grid_Info::size, and Ewl_Grid_Info::user.

Referenced by ewl_table_row_h_set().

void ewl_grid_row_h_remove ( Ewl_Grid g,
int  row 
)

void ewl_grid_row_preferred_h_use ( Ewl_Grid g,
int  row 
)

float ewl_grid_row_relative_h_get ( Ewl_Grid g,
int  row 
)

Get the user set relative height of a row.

Parameters:
g,: the grid
row,: the row
Returns:
Returns the user set relative height This function returns only the relative size set by the user.

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_GRID_TYPE, Ewl_Grid_Info::rel_size, row_size, rows, and Ewl_Grid_Info::user.

void ewl_grid_row_relative_h_set ( Ewl_Grid g,
int  row,
float  relh 
)

Set the relative height of a row.

Parameters:
g,: the grid
row,: the row
relh,: the new relative height
Returns:
Returns no value.

References cols, data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, ewl_grid_dimensions_set(), EWL_GRID_RESIZE_RELATIVE, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), Ewl_Grid_Info::rel_size, Ewl_Grid_Info::resize_type, row_size, rows, and Ewl_Grid_Info::user.

unsigned int ewl_grid_vhomogeneous_get ( Ewl_Grid g  ) 

Retrieves the vertical homogeneous flag.

Parameters:
g,: the grid to get the vertical layout
Returns:
The vertical homogeneous flag

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_GRID_TYPE, and homogeneous_v.

void ewl_grid_vhomogeneous_set ( Ewl_Grid g,
unsigned int  h 
)

Change the vertical homogeneous layout of the box.

Parameters:
g,: the grid to change vertical homogeneous layout
h,: the boolean value to change the vertical layout mode to
Returns:
Returns no value. Grids use non-homogeneous layout by default, this can be used to change that for vertical orientation, i.e. all rows can have the same height.

References data_dirty, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_GRID_TYPE, EWL_WIDGET, ewl_widget_configure(), and homogeneous_v.

Referenced by ewl_colorpicker_init(), ewl_grid_homogeneous_set(), and ewl_table_vhomogeneous_set().


Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sat May 17 16:51:09 2008