Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: ewl_tip.c layout_ewl_simple.c Log Message: * Tip of the day =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_tip.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_tip.c 11 Jan 2006 04:56:19 -0000 1.2 +++ ewl_tip.c 11 Jan 2006 05:35:54 -0000 1.3 @@ -5,18 +5,99 @@ #include <dlfcn.h> #include <time.h> +Ecore_List* tool_tips; +Ewl_Widget *text_tip; +int tip_number; + void ewl_entropy_tip_window_destroy_cb(Ewl_Widget* w, void* ev_data, void* user_data); +void ewl_entropy_tip_window_create_tips(); +void ewl_entropy_tip_window_tip_next_cb(Ewl_Widget* w, void* ev_data, void* user_data); +char* ewl_entropy_tip_window_tip_next(); + void ewl_entropy_tip_window_destroy_cb(Ewl_Widget* w, void* ev_data, void* user_data) { - ewl_widget_destroy(w); + ecore_list_destroy(tool_tips); + ewl_widget_destroy(EWL_WIDGET(user_data)); +} + + +void ewl_entropy_tip_window_tip_next_cb(Ewl_Widget* w, void* ev_data, void* user_data) { + char* tip = ewl_entropy_tip_window_tip_next(); + ewl_text_text_set(EWL_TEXT(text_tip), tip); } +void ewl_entropy_tip_window_create_tips() +{ + tool_tips = ecore_list_new(); + ecore_list_append(tool_tips, "You can add a new 'location' by clicking on \"Add Location\"\nin the Tools menu"); + ecore_list_append(tool_tips, "Entropy can browse .tar.gz and .tar.bz2 files. Just click on the\n file, and it will be" + "treated as a regular folder"); +} + +char* ewl_entropy_tip_window_tip_next() { + char* next = ecore_list_next(tool_tips); + if (!next) { + ecore_list_goto_first(tool_tips); + next = ecore_list_next(tool_tips); + } + return next; +} + void ewl_entropy_tip_window_display() { Ewl_Widget* tip_window = ewl_window_new(); - ewl_object_custom_size_set(EWL_OBJECT(tip_window), 300, 150); - ewl_callback_append(tip_window, EWL_CALLBACK_DELETE_WINDOW, ewl_entropy_tip_window_destroy_cb, NULL); + Ewl_Widget* vbox = ewl_vbox_new(); + Ewl_Widget* hbox = ewl_hbox_new(); + Ewl_Widget* button; + + ewl_entropy_tip_window_create_tips(); + tip_number = 0; + + ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_BOTTOM); + ewl_object_alignment_set(EWL_OBJECT(vbox), EWL_FLAG_ALIGN_BOTTOM); + ewl_object_alignment_set(EWL_OBJECT(tip_window), EWL_FLAG_ALIGN_BOTTOM); + ewl_object_fill_policy_set(EWL_OBJECT(tip_window), EWL_FLAG_FILL_FILL); + ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_FILL); + + ewl_object_minimum_size_set(EWL_OBJECT(tip_window), 400, 150); + ewl_container_child_append(EWL_CONTAINER(tip_window), vbox); + + text_tip = ewl_text_new(); + ewl_container_child_append(EWL_CONTAINER(vbox), text_tip); + + + ewl_container_child_append(EWL_CONTAINER(vbox), hbox); + + button = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(button), "Prev Tip"); + ewl_object_custom_h_set(EWL_OBJECT(button), 15); + ewl_widget_show(button); + ewl_container_child_append(EWL_CONTAINER(hbox), button); + + button = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(button), "Next Tip"); + ewl_object_custom_h_set(EWL_OBJECT(button), 15); + ewl_callback_append(button, EWL_CALLBACK_CLICKED, ewl_entropy_tip_window_tip_next_cb, NULL); + ewl_widget_show(button); + ewl_container_child_append(EWL_CONTAINER(hbox), button); + + button = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(button), "Close"); + ewl_object_custom_h_set(EWL_OBJECT(button), 15); + ewl_callback_append(button, EWL_CALLBACK_CLICKED, ewl_entropy_tip_window_destroy_cb, tip_window); + ewl_widget_show(button); + ewl_container_child_append(EWL_CONTAINER(hbox), button); + + + ewl_callback_append(tip_window, EWL_CALLBACK_DELETE_WINDOW, ewl_entropy_tip_window_destroy_cb, tip_window); + ewl_widget_show(tip_window); + ewl_widget_show(vbox); + ewl_widget_show(hbox); + ewl_widget_show(text_tip); + + ewl_entropy_tip_window_tip_next_cb(NULL,NULL,NULL); + } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- layout_ewl_simple.c 11 Jan 2006 04:58:45 -0000 1.31 +++ layout_ewl_simple.c 11 Jan 2006 05:35:54 -0000 1.32 @@ -424,7 +424,7 @@ else ;// printf("Visual component found\n"); ewl_container_child_append(EWL_CONTAINER(hbox), visual); - ewl_object_fill_policy_set(EWL_OBJECT(visual), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(visual), EWL_FLAG_FILL_HFILL); ewl_widget_show(visual); } } ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs