/[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 62171 - (hide annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 5 months ago) by larryl
File size: 3985 byte(s)
First commit docking tabbed Eiffel Studio.
1 manus 26913 indexing
2     description : "Command to show/hide a toolbar"
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 26913 date : "$Date$"
6     revision : "$Revision$"
7     author : "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
8    
9     class
10     EB_SHOW_TOOLBAR_COMMAND
11    
12     inherit
13     EB_SHOW_WIDGET_COMMAND
14     rename
15     make as command_make
16     redefine
17     enable_visible,
18 xavier 30015 disable_visible
19 manus 26913 end
20    
21     EB_MENUABLE_COMMAND
22     redefine
23 xavier 30015 new_menu_item
24 manus 26913 end
25    
26     create
27     make
28    
29     feature {NONE} -- Initialization
30    
31 larryl 62171 make (a_target: SD_TOOL_BAR_CONTENT; a_menu_name: STRING) is
32 manus 26913 -- Initialize Current with target `a_target' and `menu_name' set to `a_menu_name'.
33 larryl 62171 require
34     not_void: a_target /= Void
35 manus 26913 do
36     menu_name := a_menu_name
37     name := a_menu_name
38 larryl 62171 content := a_target
39     ensure
40     set: content = a_target
41 manus 26913 end
42    
43 larryl 62171 content: SD_TOOL_BAR_CONTENT
44 manus 26913 feature -- Status setting
45    
46     enable_visible is
47     -- Set `is_visible' to True.
48     local
49     menu_items: like managed_menu_items
50     citem: EB_COMMAND_CHECK_MENU_ITEM
51     do
52     if not is_visible then
53     is_visible := True
54 larryl 62171 content.show
55    
56 manus 26913 menu_items := managed_menu_items
57     if menu_items /= Void then
58     from
59     menu_items.start
60     until
61     menu_items.after
62     loop
63     citem := menu_items.item
64     if not citem.is_selected then
65     citem.select_actions.block
66     citem.enable_select
67     citem.select_actions.resume
68     end
69     menu_items.forth
70     end
71     end
72     end
73     end
74    
75     disable_visible is
76     -- Set `is_visible' to True.
77     local
78     menu_items: like managed_menu_items
79     citem: EB_COMMAND_CHECK_MENU_ITEM
80     do
81 larryl 62171
82 manus 26913 if is_visible then
83     menu_items := managed_menu_items
84     if menu_items /= Void then
85     from
86     menu_items.start
87     until
88     menu_items.after
89     loop
90     citem := menu_items.item
91     if citem.is_selected then
92     citem.select_actions.block
93     citem.disable_select
94     citem.select_actions.resume
95     end
96     menu_items.forth
97     end
98     end
99     is_visible := False
100 larryl 62171 content.hide
101 manus 26913 end
102     end
103    
104     feature -- Basic operations
105    
106     new_menu_item: EB_COMMAND_CHECK_MENU_ITEM is
107     -- Create a new menu entry for this command.
108     do
109     -- Create the menu item
110     create Result.make (Current)
111 king 46373 initialize_menu_item (Result)
112 king 46376 Result.enable_sensitive
113     if is_visible then
114     Result.enable_select
115     else
116     Result.disable_select
117     end
118 julieng 37681 Result.select_actions.extend (agent execute)
119 larryl 62171 if pixmap /= Void then
120     Result.set_pixmap (pixmap)
121     end
122 manus 26913 end
123    
124     feature -- Access
125    
126     menu_name: STRING
127     -- Name as it appears in the menu.
128    
129 larryl 62171 name: STRING
130 manus 26913 -- Name for the command.
131    
132 larryl 62171 pixmap: EV_PIXMAP;
133     -- Pixmap
134    
135 manus 56535 indexing
136     copyright: "Copyright (c) 1984-2006, Eiffel Software"
137 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
138 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
139     copying: "[
140     This file is part of Eiffel Software's Eiffel Development Environment.
141    
142     Eiffel Software's Eiffel Development Environment is free
143     software; you can redistribute it and/or modify it under
144     the terms of the GNU General Public License as published
145     by the Free Software Foundation, version 2 of the License
146     (available at the URL listed under "license" above).
147    
148     Eiffel Software's Eiffel Development Environment is
149     distributed in the hope that it will be useful, but
150     WITHOUT ANY WARRANTY; without even the implied warranty
151     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
152     See the GNU General Public License for more details.
153    
154     You should have received a copy of the GNU General Public
155     License along with Eiffel Software's Eiffel Development
156     Environment; if not, write to the Free Software Foundation,
157     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
158     ]"
159     source: "[
160     Eiffel Software
161     356 Storke Road, Goleta, CA 93117 USA
162     Telephone 805-685-1006, Fax 805-685-6869
163     Website http://www.eiffel.com
164     Customer support http://support.eiffel.com
165     ]"
166    
167 manus 26913 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