/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_show_toolbar_command.e
ViewVC logotype

Annotation of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_show_toolbar_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46373 - (hide annotations)
Tue Nov 9 20:20:25 2004 UTC (15 years, 2 months ago) by king
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_show_toolbar_command.e
File size: 2276 byte(s)
Refactored menu item setup

1 manus 26913 indexing
2     description : "Command to show/hide a toolbar"
3     date : "$Date$"
4     revision : "$Revision$"
5     author : "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
6    
7     class
8     EB_SHOW_TOOLBAR_COMMAND
9    
10     inherit
11     EB_SHOW_WIDGET_COMMAND
12     rename
13     make as command_make
14     redefine
15     enable_visible,
16 xavier 30015 disable_visible
17 manus 26913 end
18    
19     EB_MENUABLE_COMMAND
20     redefine
21 xavier 30015 new_menu_item
22 manus 26913 end
23    
24     create
25     make
26    
27     feature {NONE} -- Initialization
28    
29     make (a_target: like target; a_menu_name: STRING) is
30     -- Initialize Current with target `a_target' and `menu_name' set to `a_menu_name'.
31     do
32     command_make (a_target)
33     menu_name := a_menu_name
34     name := a_menu_name
35     end
36    
37     feature -- Status setting
38    
39     enable_visible is
40     -- Set `is_visible' to True.
41     local
42     menu_items: like managed_menu_items
43     citem: EB_COMMAND_CHECK_MENU_ITEM
44     do
45     if not is_visible then
46     is_visible := True
47     target.show
48     menu_items := managed_menu_items
49     if menu_items /= Void then
50     from
51     menu_items.start
52     until
53     menu_items.after
54     loop
55     citem := menu_items.item
56     if not citem.is_selected then
57     citem.select_actions.block
58     citem.enable_select
59     citem.select_actions.resume
60     end
61     menu_items.forth
62     end
63     end
64     end
65     end
66    
67     disable_visible is
68     -- Set `is_visible' to True.
69     local
70     menu_items: like managed_menu_items
71     citem: EB_COMMAND_CHECK_MENU_ITEM
72     do
73     if is_visible then
74     menu_items := managed_menu_items
75     if menu_items /= Void then
76     from
77     menu_items.start
78     until
79     menu_items.after
80     loop
81     citem := menu_items.item
82     if citem.is_selected then
83     citem.select_actions.block
84     citem.disable_select
85     citem.select_actions.resume
86     end
87     menu_items.forth
88     end
89     end
90     is_visible := False
91     target.hide
92     end
93     end
94    
95     feature -- Basic operations
96    
97     new_menu_item: EB_COMMAND_CHECK_MENU_ITEM is
98     -- Create a new menu entry for this command.
99     local
100     mname: STRING
101     do
102     -- Create the menu item
103     create Result.make (Current)
104 king 46373 initialize_menu_item (Result)
105 julieng 37681 Result.select_actions.extend (agent execute)
106 manus 26913 end
107    
108     feature -- Access
109    
110     menu_name: STRING
111     -- Name as it appears in the menu.
112    
113     name: STRING
114     -- Name for the command.
115    
116     end -- class EB_SHOW_TOOLBAR_COMMAND

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23