Enlightenment CVS committal Author : moom Project : e17 Module : proto
Dir : e17/proto/etk/src/bin Modified Files: etk_entry_test.c etk_paned_test.c etk_slider_test.c etk_test.c Removed Files: etk_xdnd_test.c Log Message: Lib: ---- * [Etk_Widget] Etk_Widget has now a generic way to swallow its children in its theme-object. If a widget's theme-object has a part called "etk.swallow.content", the children of the widget will be automatically swallowed in this part. This increases a lot the theming possibilities for certain widgets. * [Etk_Shadow] A new simple container that can cast a shadow or have a border. * [Etk_Widget] etk_widget_focused_get() --> etk_widget_is_focused(). * [Etk_Widget] Add etk_widget_focusable_set/get(). * [Etk_Widget] Clipping code has been rewritten and simplified. * [Etk_Toplevel] Tab focusing is now "circular". * [Etk_Object] etk_widget_name_set/get() --> etk_object_name_set/get() and there is now etk_object_name_find() to get an object from its name. * [Etk_Object] Fix a segv with etk_object_properties_set_valist() (it fixes extrackt) * [Etk_Box] Fix the focus order of the box. Misc: ----- * [Theme] "etk.swallow.child" --> "etk.swallow.content". * [Theme] Improve the theme of the paned and the tree, and make the entry a bit larger. * [Test_Paned] Make the checkboxes effective. * [Test_Entry] Improve the test. * [Documentation] Documentation++ =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_entry_test.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- etk_entry_test.c 17 Aug 2006 23:17:58 -0000 1.10 +++ etk_entry_test.c 20 Oct 2006 17:51:44 -0000 1.11 @@ -1,17 +1,21 @@ #include "etk_test.h" -static void _etk_test_entry_print_clicked(Etk_Object *object, void *data); -static void _etk_test_entry_password_toggled(Etk_Object *object, void *data); +static void _etk_test_entry_normal_print_cb(Etk_Object *object, void *data); +static void _etk_test_entry_password_show_cb(Etk_Object *object, void *data); -static Etk_Widget *label = NULL; -static Etk_Widget *entry = NULL; +static Etk_Widget *_label_normal = NULL; +static Etk_Widget *_entry_normal = NULL; /* Creates the window for the entry test */ void etk_test_entry_window_create(void *data) { static Etk_Widget *win = NULL; + Etk_Widget *vbox; + Etk_Widget *frame; + Etk_Widget *separator; Etk_Widget *table; Etk_Widget *button; + Etk_Widget *password_entry; if (win) { @@ -21,37 +25,58 @@ win = etk_window_new(); etk_window_title_set(ETK_WINDOW(win), "Etk Entry Test"); - etk_signal_connect("delete_event", ETK_OBJECT(win), ETK_CALLBACK(etk_window_hide_on_delete), NULL); + etk_signal_connect("delete_event", ETK_OBJECT(win), ETK_CALLBACK(etk_window_hide_on_delete), NULL); - table = etk_table_new(3, 2, ETK_FALSE); - etk_container_add(ETK_CONTAINER(win), table); - - entry = etk_entry_new(); - etk_table_attach(ETK_TABLE(table), entry, 0, 0, 0, 0, 0, 0, ETK_TABLE_HEXPAND | ETK_TABLE_HFILL); + vbox = etk_vbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(win), vbox); + + /* Normal entry */ + frame = etk_frame_new("Normal Entry"); + etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + table = etk_table_new(2, 2, ETK_FALSE); + etk_container_add(ETK_CONTAINER(frame), table); + + _entry_normal = etk_entry_new(); + etk_entry_text_set(ETK_ENTRY(_entry_normal), "Here is some text"); + etk_table_attach(ETK_TABLE(table), _entry_normal, 0, 0, 0, 0, 0, 0, ETK_TABLE_HEXPAND | ETK_TABLE_HFILL); - button = etk_button_new_with_label("Print text"); + button = etk_button_new_with_label("Print Text"); etk_table_attach(ETK_TABLE(table), button, 1, 1, 0, 0, 0, 0, ETK_TABLE_NONE); - etk_signal_connect("clicked", ETK_OBJECT(button), ETK_CALLBACK(_etk_test_entry_print_clicked), NULL); - - button = etk_toggle_button_new_with_label("Toggle password"); - etk_table_attach(ETK_TABLE(table), button, 2, 2, 0, 0, 0, 0, ETK_TABLE_NONE); - etk_signal_connect("toggled", ETK_OBJECT(button), ETK_CALLBACK(_etk_test_entry_password_toggled), NULL); + etk_signal_connect("clicked", ETK_OBJECT(button), ETK_CALLBACK(_etk_test_entry_normal_print_cb), NULL); + + _label_normal = etk_label_new(NULL); + etk_table_attach(ETK_TABLE(table), _label_normal, 0, 1, 1, 1, 0, 0, ETK_TABLE_HEXPAND | ETK_TABLE_HFILL); - label = etk_label_new(" "); - etk_table_attach(ETK_TABLE(table), label, 0, 1, 1, 1, 0, 0, ETK_TABLE_HEXPAND | ETK_TABLE_HFILL); + separator = etk_hseparator_new(); + etk_box_append(ETK_BOX(vbox), separator, ETK_BOX_START, ETK_BOX_NONE, 6); + + + /* Password entry */ + frame = etk_frame_new("Password Entry"); + etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + vbox = etk_vbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(frame), vbox); + + password_entry = etk_entry_new(); + etk_entry_text_set(ETK_ENTRY(password_entry), "Password"); + etk_entry_password_mode_set(ETK_ENTRY(password_entry), ETK_TRUE); + etk_box_append(ETK_BOX(vbox), password_entry, ETK_BOX_START, ETK_BOX_FILL, 0); + + button = etk_check_button_new_with_label("Password Visible"); + etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_FILL, 0); + etk_signal_connect("toggled", ETK_OBJECT(button), ETK_CALLBACK(_etk_test_entry_password_show_cb), password_entry); etk_widget_show_all(win); } -/* Prints the text of the entry in the label */ -static void _etk_test_entry_print_clicked(Etk_Object *object, void *data) +/* Prints the text of the normal entry in the label */ +static void _etk_test_entry_normal_print_cb(Etk_Object *object, void *data) { - etk_label_set(ETK_LABEL(label), etk_entry_text_get(ETK_ENTRY(entry))); + etk_label_set(ETK_LABEL(_label_normal), etk_entry_text_get(ETK_ENTRY(_entry_normal))); } - -/* Turns the entry into a password */ -static void _etk_test_entry_password_toggled(Etk_Object *object, void *data) +/* Toggles the password mode of the password entry */ +static void _etk_test_entry_password_show_cb(Etk_Object *object, void *data) { - etk_entry_password_mode_set(ETK_ENTRY(entry), etk_toggle_button_active_get(ETK_TOGGLE_BUTTON(object))); + etk_entry_password_mode_set(ETK_ENTRY(data), !etk_toggle_button_active_get(ETK_TOGGLE_BUTTON(object))); } =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_paned_test.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- etk_paned_test.c 15 Aug 2006 15:59:01 -0000 1.7 +++ etk_paned_test.c 20 Oct 2006 17:51:44 -0000 1.8 @@ -1,5 +1,8 @@ #include "etk_test.h" +static void _etk_test_paned_child1_expand_toggled_cb(Etk_Object *object, void *data); +static void _etk_test_paned_child2_expand_toggled_cb(Etk_Object *object, void *data); + /* Creates the window for the paned test */ void etk_test_paned_window_create(void *data) { @@ -25,6 +28,7 @@ vbox = etk_vbox_new(ETK_FALSE, 0); etk_container_add(ETK_CONTAINER(win), vbox); + /* Paned Area */ vpaned = etk_vpaned_new(); etk_box_append(ETK_BOX(vbox), vpaned, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); @@ -47,7 +51,8 @@ hseparator = etk_hseparator_new(); etk_box_append(ETK_BOX(vbox), hseparator, ETK_BOX_START, ETK_BOX_NONE, 6); - /* Properties Area */ + + /* Hpaned's properties frame */ hbox = etk_hbox_new(ETK_TRUE, 0); etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_START, ETK_BOX_NONE, 0); @@ -55,21 +60,57 @@ etk_box_append(ETK_BOX(hbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); vbox = etk_vbox_new(ETK_TRUE, 0); etk_container_add(ETK_CONTAINER(frame), vbox); + check_button = etk_check_button_new_with_label("Child 1 Expand"); etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(check_button), ETK_TRUE); + etk_signal_connect("toggled", ETK_OBJECT(check_button), + ETK_CALLBACK(_etk_test_paned_child1_expand_toggled_cb), hpaned); + etk_box_append(ETK_BOX(vbox), check_button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); check_button = etk_check_button_new_with_label("Child 2 Expand"); etk_box_append(ETK_BOX(vbox), check_button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + etk_signal_connect("toggled", ETK_OBJECT(check_button), + ETK_CALLBACK(_etk_test_paned_child2_expand_toggled_cb), hpaned); + + /* Vpaned's properties frame */ frame = etk_frame_new("VPaned Properties"); etk_box_append(ETK_BOX(hbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); vbox = etk_vbox_new(ETK_TRUE, 0); etk_container_add(ETK_CONTAINER(frame), vbox); + check_button = etk_check_button_new_with_label("Child 1 Expand"); etk_box_append(ETK_BOX(vbox), check_button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + etk_signal_connect("toggled", ETK_OBJECT(check_button), + ETK_CALLBACK(_etk_test_paned_child1_expand_toggled_cb), vpaned); + check_button = etk_check_button_new_with_label("Child 2 Expand"); etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(check_button), ETK_TRUE); etk_box_append(ETK_BOX(vbox), check_button, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); + etk_signal_connect("toggled", ETK_OBJECT(check_button), + ETK_CALLBACK(_etk_test_paned_child2_expand_toggled_cb), vpaned); etk_widget_show_all(win); +} + +/* Called when one of the two "Child 1 expand" checkboxes is toggled */ +static void _etk_test_paned_child1_expand_toggled_cb(Etk_Object *object, void *data) +{ + Etk_Toggle_Button *check; + Etk_Paned *paned; + + if (!(check = ETK_TOGGLE_BUTTON(object)) || !(paned = ETK_PANED(data))) + return; + etk_paned_child1_expand_set(paned, etk_toggle_button_active_get(check)); +} + +/* Called when one of the two "Child 2 expand" checkboxes is toggled */ +static void _etk_test_paned_child2_expand_toggled_cb(Etk_Object *object, void *data) +{ + Etk_Toggle_Button *check; + Etk_Paned *paned; + + if (!(check = ETK_TOGGLE_BUTTON(object)) || !(paned = ETK_PANED(data))) + return; + etk_paned_child2_expand_set(paned, etk_toggle_button_active_get(check)); } =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_slider_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- etk_slider_test.c 15 Aug 2006 16:33:26 -0000 1.6 +++ etk_slider_test.c 20 Oct 2006 17:51:44 -0000 1.7 @@ -2,7 +2,7 @@ static void _etk_test_slider_value_changed(Etk_Object *object, double value, void *data); -/* Creates the window for the paned test */ +/* Creates the window for the slider test */ void etk_test_slider_window_create(void *data) { static Etk_Widget *win = NULL; =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_test.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- etk_test.c 6 Oct 2006 17:04:13 -0000 1.29 +++ etk_test.c 20 Oct 2006 17:51:44 -0000 1.30 @@ -2,7 +2,7 @@ #define ETK_TEST_NUM_COLS 2 -typedef enum _Etk_Test_Categories +typedef enum Etk_Test_Categories { ETK_TEST_BASIC_WIDGET, ETK_TEST_ADVANCED_WIDGET, ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs