From: Enlightenment C. <no...@cv...> - 2007-02-14 04:41:23
|
Enlightenment CVS committal Author : rephorm Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_tree2.c Makefile.am Added Files: ewl_expansion.c ewl_expansion.h Log Message: add Expansion widget use this in tree2 so children get correctly inset from parents ** themes need to be updated to use theme key /expansion/group instead of /node/check/group, and support the signals 'expandable' and 'nonexpandable' ** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- ewl_tree2.c 7 Feb 2007 07:45:32 -0000 1.56 +++ ewl_tree2.c 14 Feb 2007 10:40:51 -0000 1.57 @@ -4,6 +4,7 @@ #include "ewl_button.h" #include "ewl_cell.h" #include "ewl_check.h" +#include "ewl_expansion.h" #include "ewl_label.h" #include "ewl_paned.h" #include "ewl_row.h" @@ -879,6 +880,11 @@ ewl_tree2_build_tree_rows(tree, tmp, colour, node, hidden); FREE(tmp); } + else + { + ewl_tree2_node_expandable_set(EWL_TREE2_NODE(node), + NULL); + } i++; /* @@ -1247,22 +1253,29 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("node", node); - if (data && !node->handle) + if (!node->handle) { - node->handle = ewl_check_new(); + node->handle = ewl_expansion_new(); ewl_object_fill_policy_set(EWL_OBJECT(node->handle), EWL_FLAG_FILL_NONE); ewl_object_alignment_set(EWL_OBJECT(node->handle), EWL_FLAG_ALIGN_TOP); ewl_container_child_prepend(EWL_CONTAINER(node), node->handle); + ewl_widget_show(node->handle); + } + if (data) + { ewl_callback_append(node->handle, EWL_CALLBACK_VALUE_CHANGED, ewl_tree2_cb_node_toggle, node); - ewl_widget_show(node->handle); + ewl_widget_enable(node->handle); + ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), TRUE); } else if (node->handle && !data) { - ewl_widget_destroy(node->handle); - node->handle = NULL; + ewl_callback_del(node->handle, EWL_CALLBACK_VALUE_CHANGED, + ewl_tree2_cb_node_toggle); + ewl_widget_disable(node->handle); + ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), FALSE); } DLEAVE_FUNCTION(DLEVEL_STABLE); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.48 retrieving revision 1.49 diff -u -3 -r1.48 -r1.49 --- Makefile.am 6 Feb 2007 13:42:16 -0000 1.48 +++ Makefile.am 14 Feb 2007 10:40:51 -0000 1.49 @@ -37,6 +37,7 @@ ewl_entry.h \ ewl_enums.h \ ewl_events.h \ + ewl_expansion.h \ ewl_floater.h \ ewl_filelist.h \ ewl_filelist_tree.h\ @@ -120,6 +121,7 @@ ewl_engines.c \ ewl_entry.c \ ewl_events.c \ + ewl_expansion.c \ ewl_floater.c \ ewl_filelist.c \ ewl_filelist_tree.c \ |