indexing description: "Eiffel Vision menu item. GTK+ implementation." status: "See notice at end of class" date: "$Date$" revision: "$Revision$" class EV_MENU_ITEM_IMP inherit EV_MENU_ITEM_I redefine interface, pointer_motion_actions_internal, pointer_button_press_actions_internal, pointer_double_press_actions_internal end EV_ITEM_IMP redefine interface, initialize, pointer_motion_actions_internal, pointer_button_press_actions_internal, pointer_double_press_actions_internal end EV_TEXTABLE_IMP redefine interface, set_text, accelerators_enabled end EV_MENU_ITEM_ACTION_SEQUENCES_IMP create make feature {NONE} -- Initialization needs_event_box: BOOLEAN is False make (an_interface: like interface) is -- Create a menu. do base_make (an_interface) set_c_object (feature {EV_GTK_DEPENDENT_EXTERNALS}.gtk_image_menu_item_new) pixmapable_imp_initialize feature {EV_GTK_DEPENDENT_EXTERNALS}.gtk_image_menu_item_set_image (c_object, pixmap_box) end initialize is -- Call to both precursors. local box: POINTER do real_signal_connect (visual_widget, "activate", agent (App_implementation.gtk_marshal).menu_item_activate_intermediary (c_object), Void) textable_imp_initialize box := feature {EV_GTK_EXTERNALS}.gtk_hbox_new (False, 0) feature {EV_GTK_EXTERNALS}.gtk_container_add (c_object, box) feature {EV_GTK_EXTERNALS}.gtk_widget_show (box) if pixmap_box = default_pointer then pixmapable_imp_initialize feature {EV_GTK_EXTERNALS}.gtk_box_pack_start (box, pixmap_box, False, True, 0) end feature {EV_GTK_EXTERNALS}.gtk_box_pack_start (box, text_label, True, True, 0) Precursor {EV_ITEM_IMP} end feature -- Element change set_text (a_text: STRING) is -- Assign `a_text' to `text'. local temp_string: STRING -- tab_mod: INTEGER do temp_string := a_text.twin -- tab_mod := temp_string.count \\ 8 -- if tab_mod < 4 then -- temp_string.replace_substring_all ("%T", "%T%T%T") -- else -- temp_string.replace_substring_all ("%T", "%T%T") -- end Precursor {EV_TEXTABLE_IMP} (a_text) end feature {EV_ANY_I, EV_INTERMEDIARY_ROUTINES} -- Implementation accelerators_enabled: BOOLEAN is True pointer_motion_actions_internal: EV_POINTER_MOTION_ACTION_SEQUENCE pointer_button_press_actions_internal: EV_POINTER_BUTTON_ACTION_SEQUENCE pointer_double_press_actions_internal: EV_POINTER_BUTTON_ACTION_SEQUENCE on_activate is local p_imp: EV_MENU_ITEM_LIST_IMP do p_imp ?= parent_imp if p_imp /= Void then if p_imp.item_select_actions_internal /= Void then p_imp.item_select_actions_internal.call ([interface]) end feature {EV_GTK_EXTERNALS}.gtk_menu_shell_deactivate (p_imp.list_widget) end feature {EV_GTK_EXTERNALS}.gtk_menu_item_deselect (c_object) if select_actions_internal /= Void then select_actions_internal.call (Void) end end menu_item_box: POINTER is local a_child_list: POINTER do a_child_list := feature {EV_GTK_EXTERNALS}.gtk_container_children (c_object) Result := feature {EV_GTK_EXTERNALS}.g_list_nth_data (a_child_list, 0) feature {EV_GTK_EXTERNALS}.g_list_free (a_child_list) end interface: EV_MENU_ITEM end -- class EV_MENU_ITEM_IMP --|---------------------------------------------------------------- --| EiffelVision2: library of reusable components for ISE Eiffel. --| Copyright (C) 1985-2004 Eiffel Software. All rights reserved. --| Duplication and distribution prohibited. May be used only with --| ISE Eiffel, under terms of user license. --| Contact Eiffel Software for any other use. --| --| Interactive Software Engineering Inc. --| dba Eiffel Software --| 356 Storke Road, Goleta, CA 93117 USA --| Telephone 805-685-1006, Fax 805-685-6869 --| Contact us at: http://www.eiffel.com/general/email.html --| Customer support: http://support.eiffel.com --| For latest info on our award winning products, visit: --| http://www.eiffel.com --|----------------------------------------------------------------