Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/etk/src/bin Modified Files: etk_combobox_test.c etk_menu_test.c etk_tree_test.c Log Message: * [Image] Support of "keep aspect" for edje image * [Image] Add etk_image_copy() * [Combobox] Combobox is now totally useable * [Poup_Window] Menu_Window is now Popup_Window * [Theme] Improve a little bit the theme of the tree header * [Tree_Model] Typo: etk_tree_model_alignement_set/get --> etk_tree_model_alignment_set/get * [Widget] etk_widget_event_propagation_stop --> etk_widget_key_event_propagation_stop * [Widget] etk_widget_pass_events_set/get --> etk_widget_pass_mouse_events_set/get * [Widget] etk_widget_repeat_events_set/get --> etk_widget_repeat_mouse_events_set/get =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_combobox_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- etk_combobox_test.c 12 Mar 2006 12:13:02 -0000 1.2 +++ etk_combobox_test.c 28 Mar 2006 07:24:57 -0000 1.3 @@ -1,4 +1,10 @@ #include "etk_test.h" +#include <stdlib.h> + +#define STARTING_STOCK_ID ETK_STOCK_DOCUMENT_NEW +#define ENDING_STOCK_ID ETK_STOCK_EDIT_FIND_REPLACE + +static void _etk_test_combobox_active_item_changed_cb(Etk_Object *object, void *data); /* Creates the window for the combobox test */ void etk_test_combobox_window_create(void *data) @@ -6,6 +12,11 @@ static Etk_Widget *win = NULL; Etk_Widget *vbox; Etk_Widget *combobox; + Etk_Widget *image; + Etk_Widget *frame; + Etk_Combobox_Item *item; + int i; + int *stock_id; if (win) { @@ -21,12 +32,60 @@ vbox = etk_vbox_new(ETK_FALSE, 3); etk_container_add(ETK_CONTAINER(win), vbox); + /* Simple combobox */ + frame = etk_frame_new(_("Simple combobox")); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 0); + combobox = etk_combobox_new_default(); + etk_container_add(ETK_CONTAINER(frame), combobox); + etk_combobox_item_append(ETK_COMBOBOX(combobox), "Test 1"); + etk_combobox_item_append(ETK_COMBOBOX(combobox), "Test 2"); + etk_combobox_item_append(ETK_COMBOBOX(combobox), "Test 3"); + + /* More complex combobox */ + frame = etk_frame_new(_("Some stock icons")); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 0); + + vbox = etk_vbox_new(ETK_FALSE, 3); + etk_container_add(ETK_CONTAINER(frame), vbox); + + image = etk_image_new_from_stock(STARTING_STOCK_ID, ETK_STOCK_BIG); + etk_box_pack_start(ETK_BOX(vbox), image, ETK_FALSE, ETK_FALSE, 0); + + combobox = etk_combobox_new(); + etk_combobox_column_add(ETK_COMBOBOX(combobox), ETK_COMBOBOX_IMAGE, 24, ETK_FALSE, ETK_FALSE, ETK_FALSE, 0.0, 0.5); + etk_combobox_column_add(ETK_COMBOBOX(combobox), ETK_COMBOBOX_LABEL, 75, ETK_TRUE, ETK_FALSE, ETK_FALSE, 0.0, 0.5); + etk_combobox_build(ETK_COMBOBOX(combobox)); etk_box_pack_start(ETK_BOX(vbox), combobox, ETK_FALSE, ETK_FALSE, 0); + etk_signal_connect("active_item_changed", ETK_OBJECT(combobox), ETK_CALLBACK(_etk_test_combobox_active_item_changed_cb), image); - etk_combobox_item_append(ETK_COMBOBOX(combobox), NULL, "Test 1"); - etk_combobox_item_append(ETK_COMBOBOX(combobox), NULL, "Test 2"); - etk_combobox_item_append(ETK_COMBOBOX(combobox), NULL, "Test 3"); + for (i = STARTING_STOCK_ID; i <= ENDING_STOCK_ID; i++) + { + image = etk_image_new_from_stock(i, ETK_STOCK_SMALL); + item = etk_combobox_item_append(ETK_COMBOBOX(combobox), image, etk_stock_label_get(i)); + + stock_id = malloc(sizeof(int)); + *stock_id = i; + etk_combobox_item_data_set_full(item, stock_id, free); + } etk_widget_show_all(win); +} + +/* Called when the active item of the combobox has been changed */ +static void _etk_test_combobox_active_item_changed_cb(Etk_Object *object, void *data) +{ + Etk_Combobox *combobox; + Etk_Image *image; + Etk_Combobox_Item *active_item; + int *stock_id; + + if (!(combobox = ETK_COMBOBOX(object)) || !(image = ETK_IMAGE(data))) + return; + if (!(active_item = etk_combobox_active_item_get(combobox))) + return; + if (!(stock_id = etk_combobox_item_data_get(active_item))) + return; + + etk_image_set_from_stock(image, *stock_id, ETK_STOCK_BIG); } =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_menu_test.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- etk_menu_test.c 4 Mar 2006 23:29:46 -0000 1.9 +++ etk_menu_test.c 28 Mar 2006 07:24:57 -0000 1.10 @@ -45,7 +45,7 @@ label = etk_label_new(_("Click me :)")); etk_label_alignment_set(ETK_LABEL(label), 0.5, 0.5); - etk_widget_pass_events_set(label, ETK_TRUE); + etk_widget_pass_mouse_events_set(label, ETK_TRUE); etk_box_pack_start(ETK_BOX(vbox), label, ETK_TRUE, ETK_TRUE, 0); _etk_test_menu_statusbar = etk_statusbar_new(); =================================================================== RCS file: /cvs/e/e17/proto/etk/src/bin/etk_tree_test.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- etk_tree_test.c 12 Mar 2006 12:13:02 -0000 1.29 +++ etk_tree_test.c 28 Mar 2006 07:24:57 -0000 1.30 @@ -58,8 +58,7 @@ etk_tree_mode_set(ETK_TREE(tree), ETK_TREE_MODE_TREE); etk_tree_multiple_select_set(ETK_TREE(tree), ETK_TRUE); - col1 = etk_tree_col_new(ETK_TREE(tree), _("Column 1"), etk_tree_model_icon_text_new(ETK_TREE(tree), ETK_TREE_FROM_EDJE), 60); - etk_tree_col_expand_set(col1, ETK_TRUE); + col1 = etk_tree_col_new(ETK_TREE(tree), _("Column 1"), etk_tree_model_icon_text_new(ETK_TREE(tree), ETK_TREE_FROM_EDJE), 90); col2 = etk_tree_col_new(ETK_TREE(tree), _("Column 2"), etk_tree_model_double_new(ETK_TREE(tree)), 60); col3 = etk_tree_col_new(ETK_TREE(tree), _("Column 3"), etk_tree_model_image_new(ETK_TREE(tree), ETK_TREE_FROM_FILE), 60); col4 = etk_tree_col_new(ETK_TREE(tree), _("Column 4"), etk_tree_model_checkbox_new(ETK_TREE(tree)), 40); @@ -74,7 +73,7 @@ row = etk_tree_append_to_row(row, col1, etk_theme_icon_theme_get(), "places/folder_16", _("Row2"), col2, 20.0, col3, PACKAGE_DATA_DIR "/images/2stars.png", col4, ETK_FALSE, NULL); etk_tree_append_to_row(row, col1, etk_theme_icon_theme_get(), "mimetypes/text-x-generic_16", _("Row3"), - col2, 30.0, col3, PACKAGE_DATA_DIR "/images/3stars.png", col4, ETK_TRUE, NULL); + col2, 30.0, col3, PACKAGE_DATA_DIR "/images/3stars.png", col4, ETK_FALSE, NULL); } etk_tree_thaw(ETK_TREE(tree)); @@ -175,7 +174,7 @@ num_types = 1; types[0] = strdup("text/plain"); drag_data = strdup(col1_string); - + etk_drag_types_set(drag, types, num_types); etk_drag_data_set(drag, drag_data, strlen(drag_data) + 1); button = etk_button_new_with_label(col1_string); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs