Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_entry.c ewl_row.c ewl_row.h ewl_tree.c ewl_tree.h 


Log Message:
Progress on the column alignment for the tree.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- ewl_entry.c 29 Mar 2003 23:20:18 -0000      1.52
+++ ewl_entry.c 2 Apr 2003 20:36:18 -0000       1.53
@@ -84,7 +84,6 @@
 
        e->cursor = ewl_cursor_new();
        ewl_container_append_child(EWL_CONTAINER(e), e->cursor);
-       ewl_widget_show(e->cursor);
 
        pos = ewl_text_get_length(EWL_TEXT(e->text)) + 1;
        ewl_cursor_set_position(EWL_CURSOR(e->cursor), pos, pos);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_row.c   25 Mar 2003 18:36:15 -0000      1.8
+++ ewl_row.c   2 Apr 2003 20:36:19 -0000       1.9
@@ -68,7 +68,7 @@
  * is given it's preferred size.
  */
 void
-ewl_row_set_column_bounds(Ewl_Row *row, int n, unsigned int *base,
+ewl_row_set_column_bounds(Ewl_Row *row, int n, unsigned int **base,
                unsigned int **bounds)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
@@ -113,8 +113,10 @@
        if (row->bounds) {
                int i = 0;
                while ((child = ewd_list_next(c->children))) {
+                       ewl_object_request_position(child, x, CURRENT_Y(w));
                        ewl_object_request_w(child,
-                                       *row->base + *row->bounds[i] - x);
+                                       *row->base[i] + *row->bounds[i] - x);
+                       ewl_object_request_h(child, CURRENT_H(w));
                        x = ewl_object_get_current_x(child) +
                                ewl_object_get_current_w(child);
                        i++;
@@ -140,8 +142,7 @@
                        ewl_object_request_position(child, x, CURRENT_Y(w));
                        ewl_object_request_w(child, portion);
 
-                       ewl_object_request_h(child,
-                                       ewl_object_get_preferred_h(EWL_OBJECT(w)));
+                       ewl_object_request_h(child, CURRENT_H(w));
                        x = ewl_object_get_current_x(child) +
                                ewl_object_get_current_w(child);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_row.h   26 Feb 2003 01:15:24 -0000      1.6
+++ ewl_row.h   2 Apr 2003 20:36:19 -0000       1.7
@@ -12,13 +12,13 @@
        Ewl_Container container;
        Ewl_Object *max;
 
-       unsigned int *base;
+       unsigned int **base;
        unsigned int **bounds;
 };
 
 Ewl_Widget *ewl_row_new();
 int ewl_row_init(Ewl_Row *row);
-void ewl_row_set_column_bounds(Ewl_Row *row, int n, unsigned int *base,
+void ewl_row_set_column_bounds(Ewl_Row *row, int n, unsigned int **base,
                unsigned int **bounds);
 
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_tree.c  1 Apr 2003 06:25:23 -0000       1.7
+++ ewl_tree.c  2 Apr 2003 20:36:20 -0000       1.8
@@ -68,12 +68,55 @@
                        EWL_FILL_POLICY_HFILL);
 
        tree->ncols = columns;
-       tree->colw = NEW(int, columns);
+       tree->colbases = NEW(int, columns);
+       tree->colbounds = NEW(int, columns);
+
+       ewl_tree_set_headers(tree, NULL);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
 
 /**
+ * ewl_tree_set_headers
+ */
+void ewl_tree_set_headers(Ewl_Tree *tree, Ewl_Widget **headers)
+{
+       unsigned short i;
+       Ewl_Widget *row;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("tree", tree);
+
+       row = ewl_row_new();
+       if (headers) {
+               for (i = 0; i < tree->ncols; i++) {
+                       ewl_container_append_child(EWL_CONTAINER(row),
+                                       headers[i]);
+
+                       tree->colbases[i] = &CURRENT_X(headers[i]);
+                       tree->colbounds[i] = &CURRENT_W(headers[i]);
+               }
+       }
+       else {
+               Ewl_Widget *button;
+
+               for (i = 0; i < tree->ncols; i++) {
+                       button = ewl_button_new(NULL);
+                       ewl_container_append_child(EWL_CONTAINER(row), button);
+                       ewl_widget_show(button);
+
+                       tree->colbases[i] = &CURRENT_X(button);
+                       tree->colbounds[i] = &CURRENT_W(button);
+               }
+       }
+
+       ewl_container_append_child(EWL_CONTAINER(tree), row);
+       ewl_widget_show(row);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
  * ewl_tree_add - add a group of widgets to a row in the tree
  * @tree: the tree to hold the widgets
  * @prow: the parent row of the new row for the added widgets
@@ -112,6 +155,8 @@
                DRETURN_PTR(NULL, DLEVEL_STABLE);
        }
 
+       ewl_row_set_column_bounds(EWL_ROW(row), tree->ncols, tree->colbases,
+                       tree->colbounds);
        ewl_widget_show(row);
 
        EWL_TREE_NODE(node)->tree = tree;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_tree.h  1 Apr 2003 06:25:23 -0000       1.5
+++ ewl_tree.h  2 Apr 2003 20:36:20 -0000       1.6
@@ -16,11 +16,9 @@
        unsigned short ncols;
        unsigned short nrows;
 
-       unsigned int *colw;
-       unsigned int *rowh;
-
        unsigned int **colbases;
        unsigned int **colbounds;
+       Ewl_Widget *header;
 };
 
 typedef struct _ewl_tree_node Ewl_Tree_Node;
@@ -45,6 +43,7 @@
 
 Ewl_Widget *ewl_tree_new(unsigned short columns);
 int ewl_tree_init(Ewl_Tree *tree, unsigned short columns);
+void ewl_tree_set_headers(Ewl_Tree *tree, Ewl_Widget **headers);
 void ewl_tree_set_columns(Ewl_Tree *tree, unsigned short columns);
 Ewl_Widget *ewl_tree_add(Ewl_Tree *tree, Ewl_Row *prow, Ewl_Widget **children);
 void ewl_tree_set_row_expanded(Ewl_Row *row, int expanded);




-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to