Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_table.c ewl_table.h
Log Message:
allow the table to have no headers. API breakage: ewl_table_add requires a
Ewl_Widget to be added, no Ewl_Cell anymore
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_table.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_table.c 9 Feb 2005 04:31:55 -0000 1.1
+++ ewl_table.c 5 Mar 2005 20:53:05 -0000 1.2
@@ -44,7 +44,6 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("t", t, FALSE);
- DCHECK_PARAM_PTR_RET("col_headers", col_headers, FALSE);
/*
* Iniitialize the tables inherited fields
@@ -58,7 +57,10 @@
/*
* Create a new grid
*/
- t->grid = (Ewl_Grid *) ewl_grid_new(cols, rows);
+ if (col_headers)
+ t->grid = (Ewl_Grid *) ewl_grid_new(cols, rows + 1);
+ else
+ t->grid = (Ewl_Grid *) ewl_grid_new(cols, rows);
ewl_container_child_append(EWL_CONTAINER(t), EWL_WIDGET(t->grid));
ewl_widget_show(EWL_WIDGET(t->grid));
@@ -110,16 +112,27 @@
* @brief Add a child widget to the table
*/
void
-ewl_table_add(Ewl_Table * table, Ewl_Cell * cell,
+ewl_table_add(Ewl_Table * table, Ewl_Widget * w,
int start_col, int end_col, int start_row, int end_row)
{
-
+ Ewl_Cell *cell;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("table", table);
- ewl_grid_add(table->grid, EWL_WIDGET(cell),
- start_col, end_col, start_row, end_row);
+ cell = ewl_cell_new ();
+ ewl_container_child_append (EWL_CONTAINER (cell), w);
+
+ /*
+ * FIXME: one must verify that other functions that
+ * ewl_table_add need this test
+ */
+ if (table->col_headers)
+ ewl_grid_add(table->grid, EWL_WIDGET(cell),
+ start_col, end_col, start_row + 1, end_row + 1);
+ else
+ ewl_grid_add(table->grid, EWL_WIDGET(cell),
+ start_col, end_col, start_row, end_row);
ewl_callback_prepend(EWL_WIDGET(cell), EWL_CALLBACK_MOUSE_UP,
ewl_table_child_select_cb, table);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_table.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_table.h 17 Feb 2005 19:14:56 -0000 1.3
+++ ewl_table.h 5 Mar 2005 20:53:05 -0000 1.4
@@ -51,7 +51,7 @@
Ewl_Widget *ewl_table_new(int cols, int rows, char **col_headers);
int ewl_table_init(Ewl_Table * t, int cols, int rows,
char **col_headers);
-void ewl_table_add(Ewl_Table * table, Ewl_Cell * cell, int
start_col,
+void ewl_table_add(Ewl_Table * table, Ewl_Widget * w, int start_col,
int end_col, int start_row, int end_row);
void ewl_table_reset(Ewl_Table * t, int cols, int rows,
char **c_headers);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs