Enlightenment CVS committal Author : moom Project : e17 Module : libs/etk
Dir : e17/libs/etk/src/bin Modified Files: etk_tree2_test.c Log Message: * [Tree2] More work on model combination. It should work pretty well now * [Tree2] Image model: The same image model can now be used to load image from various sources: image files, edje files and eet files. Still need more work though.. =================================================================== RCS file: /cvs/e/e17/libs/etk/src/bin/etk_tree2_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- etk_tree2_test.c 3 Jan 2007 18:10:11 -0000 1.6 +++ etk_tree2_test.c 3 Jan 2007 23:35:25 -0000 1.7 @@ -17,6 +17,7 @@ Etk_Widget *statusbar; Etk_Widget *alignment; char row_name[128]; + const char *stock_key; int i; if (win) @@ -47,14 +48,17 @@ /* We first create the columns of the tree, and then we "build" the tree with etk_tree2_build() */ col1 = etk_tree2_col_new(ETK_TREE2(tree), "Column 1", 130); - etk_tree2_col_model_add(col1, etk_tree2_model_image_new(ETK_TREE2(tree), ETK_TREE_FROM_EDJE)); - etk_tree2_col_model_add(col1, etk_tree2_model_text_new(ETK_TREE2(tree))); + etk_tree2_col_model_add(col1, etk_tree2_model_image_new()); + etk_tree2_col_model_add(col1, etk_tree2_model_text_new()); + col2 = etk_tree2_col_new(ETK_TREE2(tree), "Column 2", 60); - etk_tree2_col_model_add(col2, etk_tree2_model_double_new(ETK_TREE2(tree))); + etk_tree2_col_model_add(col2, etk_tree2_model_double_new()); + col3 = etk_tree2_col_new(ETK_TREE2(tree), "Column 3", 60); - etk_tree2_col_model_add(col3, etk_tree2_model_image_new(ETK_TREE2(tree), ETK_TREE_FROM_FILE)); + etk_tree2_col_model_add(col3, etk_tree2_model_image_new()); + col4 = etk_tree2_col_new(ETK_TREE2(tree), "Column 4", 90); - etk_tree2_col_model_add(col4, etk_tree2_model_checkbox_new(ETK_TREE2(tree))); + etk_tree2_col_model_add(col4, etk_tree2_model_checkbox_new()); etk_tree2_build(ETK_TREE2(tree)); @@ -64,16 +68,31 @@ for (i = 0; i < 50; i++) { sprintf(row_name, "Row %d", (i * 3) + 1); - row = etk_tree2_row_append(ETK_TREE2(tree), NULL, col1, etk_theme_icon_get(), "places/user-home_16", row_name, - col2, 10.0, col3, PACKAGE_DATA_DIR "/images/1star.png", col4, ETK_FALSE, NULL); + stock_key = etk_stock_key_get(ETK_STOCK_PLACES_USER_HOME, ETK_STOCK_SMALL); + row = etk_tree2_row_append(ETK_TREE2(tree), NULL, + col1, etk_theme_icon_get(), stock_key, row_name, + col2, 10.0, + col3, PACKAGE_DATA_DIR "/images/1star.png", NULL, + col4, ETK_FALSE, + NULL); sprintf(row_name, "Row %d", (i * 3) + 2); - row = etk_tree2_row_append(ETK_TREE2(tree), row, col1, etk_theme_icon_get(), "places/folder_16", row_name, - col2, 20.0, col3, PACKAGE_DATA_DIR "/images/2stars.png", col4, ETK_TRUE, NULL); + stock_key = etk_stock_key_get(ETK_STOCK_PLACES_FOLDER, ETK_STOCK_SMALL); + row = etk_tree2_row_append(ETK_TREE2(tree), row, + col1, etk_theme_icon_get(), stock_key, row_name, + col2, 20.0, + col3, PACKAGE_DATA_DIR "/images/2stars.png", NULL, + col4, ETK_TRUE, + NULL); sprintf(row_name, "Row %d", (i * 3) + 3); - etk_tree2_row_append(ETK_TREE2(tree), row, col1, etk_theme_icon_get(), "mimetypes/text-x-generic_16", row_name, - col2, 30.0, col3, PACKAGE_DATA_DIR "/images/3stars.png", col4, ETK_TRUE, NULL); + stock_key = etk_stock_key_get(ETK_STOCK_TEXT_X_GENERIC, ETK_STOCK_SMALL); + etk_tree2_row_append(ETK_TREE2(tree), row, + col1, etk_theme_icon_get(), stock_key, row_name, + col2, 30.0, + col3, PACKAGE_DATA_DIR "/images/3stars.png", NULL, + col4, ETK_TRUE, + NULL); } etk_tree2_thaw(ETK_TREE2(tree)); @@ -81,7 +100,6 @@ statusbar = etk_statusbar_new(); etk_box_append(ETK_BOX(vbox), statusbar, ETK_BOX_START, ETK_BOX_FILL, 0); - etk_signal_connect("key_down", ETK_OBJECT(tree), ETK_CALLBACK(_etk_test_tree2_key_down_cb), NULL); etk_signal_connect("row_clicked", ETK_OBJECT(tree), ETK_CALLBACK(_etk_test_tree2_row_clicked_cb), statusbar); @@ -129,7 +147,7 @@ /* We retrieve the name of the row: this information is located in the first column, * and it corresponds to the third param of the model (the two first params correspond * to the icon used, we ignore them here (that's why there are two NULL params)). - * etk_tree2_row_fields_get() have to be terminated by NULL */ + * etk_tree2_row_fields_get() has to be terminated by NULL */ etk_tree2_row_fields_get(row, etk_tree2_nth_col_get(tree, 0), NULL, NULL, &row_name, NULL); sprintf(message, "Row \"%s\" clicked (%s)", row_name, ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs