Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: layout_ewl_simple.c Log Message: * Oops - disable the other local plugin from receiving messages, otherwise we get two of everything =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- layout_ewl_simple.c 30 Dec 2005 09:32:42 -0000 1.25 +++ layout_ewl_simple.c 30 Dec 2005 23:16:26 -0000 1.26 @@ -23,6 +23,9 @@ Ewl_Widget* paned; Ewl_Widget* local_container; + Ewl_Widget* context_menu; + Ewl_Widget* context_menu_floater; + Ecore_List* current_folder; Ecore_List* local_components; @@ -40,6 +43,17 @@ }; +int entropy_plugin_type_get() { + return ENTROPY_PLUGIN_GUI_LAYOUT; +} + +char* entropy_plugin_identify() { + return (char*)"Simple EWL layout container"; +} + + + + /*TODO/FIXME - This needs a rewrite, to be dynamic, and wizard-based*/ void location_add_execute_cb(Ewl_Widget *item, void *ev_data, void *user_data) { entropy_gui_component_instance* instance = user_data; @@ -107,6 +121,25 @@ } +void location_menu_popup_cb(Ewl_Widget *label, void *ev_data, void *user_data) { + Ewl_Event_Mouse_Down *ev = ev_data; + entropy_layout_gui* gui = user_data; + + if (ev->button == 3) { + printf("Click at %d:%d\n", ev->x, ev->y); + + ewl_widget_show(gui->context_menu_floater); + ewl_floater_position_set(EWL_FLOATER(gui->context_menu_floater), ev->x, ev->y); + + ewl_callback_call(EWL_WIDGET(gui->context_menu), EWL_CALLBACK_FOCUS_IN); + } + + + + + +} + void location_add_cb(Ewl_Widget *main_win, void *ev_data, void *user_data) { entropy_gui_component_instance* instance = (entropy_gui_component_instance*)user_data; @@ -302,6 +335,11 @@ //printf("Add URI: %s\n", uri); hbox = ewl_border_new(); ewl_border_text_set(EWL_BORDER(hbox), name); + + + + + ewl_container_child_append(EWL_CONTAINER(tree), hbox); ewl_widget_show(hbox); @@ -314,6 +352,12 @@ entropy_generic_file* file = entropy_core_parse_uri(uri); + /*Add the callback for the popup*/ + ewl_callback_append(EWL_BORDER(hbox)->label, EWL_CALLBACK_MOUSE_DOWN, location_menu_popup_cb, gui); + + + + /*Mark this file as a 'folder' - more of a bootstrap. Should we really do this? FIXME*/ strcpy(file->mime_type, "file/folder"); @@ -446,20 +490,7 @@ } -void -expand_cb(Ewl_Widget *main_win, void *ev_data, void *user_data) { - Ewl_Box* box = EWL_BOX(user_data); - - ewl_object_minimum_w_set(EWL_OBJECT(box), 150); -} -int entropy_plugin_type_get() { - return ENTROPY_PLUGIN_GUI_LAYOUT; -} - -char* entropy_plugin_identify() { - return (char*)"Simple EWL layout container"; -} void entropy_plugin_layout_main() { ewl_widget_show(win); @@ -478,7 +509,6 @@ /*Init ewl*/ components = ecore_list_new(); ewl_init(&i, c); - //ewl_theme_name_set("e17"); } void entropy_delete_current_folder(Ecore_List* el) { @@ -544,7 +574,13 @@ printf("Loaded '%s'...\n", name); //FIXME default to icon view for now - if (!strcmp(name, "Icon View")) iconbox = EWL_WIDGET(gui->iconbox_viewer->gui_object); + if (!strcmp(name, "Icon View")) { + iconbox = EWL_WIDGET(gui->iconbox_viewer->gui_object); + entropy_gui_component_instance_enable(instance); + } else { + entropy_gui_component_instance_disable(instance); + } + @@ -661,6 +697,34 @@ + /*Context menu*/ + gui->context_menu_floater = ewl_floater_new(); + ewl_container_child_append(EWL_CONTAINER(win), gui->context_menu_floater); + + gui->context_menu = ewl_menu_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(gui->context_menu), " "); + ewl_container_child_append(EWL_CONTAINER(gui->context_menu_floater), gui->context_menu); + + + item = ewl_menu_item_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(item), "Edit"); + ewl_container_child_append(EWL_CONTAINER(gui->context_menu), item); + ewl_widget_show(item); + + item = ewl_menu_item_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(item), "Delete"); + ewl_container_child_append(EWL_CONTAINER(gui->context_menu), item); + ewl_widget_show(item); + + ewl_widget_show(gui->context_menu); + + /*--------------------------*/ + + + + + + ewl_container_child_append(EWL_CONTAINER(hbox), expand_button); ewl_container_child_append(EWL_CONTAINER(hbox), contract_button); ------------------------------------------------------- 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