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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_toolbarable_and_menuable_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 4 months ago) by larryl
File size: 4292 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description : "Command that can be added in a menu and in a toolbar."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date : "$Date$"
6 revision : "$Revision$"
7
8 deferred class
9 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
10
11 inherit
12 EB_TOOLBARABLE_COMMAND
13 redefine
14 disable_sensitive,
15 enable_sensitive
16 end
17
18 EB_MENUABLE_COMMAND
19 redefine
20 disable_sensitive,
21 enable_sensitive,
22 initialize_menu_item
23 end
24
25 feature -- Status setting
26
27 enable_sensitive is
28 -- Set `is_sensitive' to True.
29 local
30 menu_items: like managed_menu_items
31 toolbar_items: like managed_toolbar_items
32 l_sd_toolbar_items: like managed_sd_toolbar_items
33 do
34 if not is_sensitive then
35 -- Enable menu items
36 menu_items := managed_menu_items
37 if menu_items /= Void then
38 from
39 menu_items.start
40 until
41 menu_items.after
42 loop
43 menu_items.item.enable_sensitive
44 menu_items.forth
45 end
46 end
47
48 -- Enable toolbar item
49 toolbar_items := managed_toolbar_items
50 if toolbar_items /= Void then
51 from
52 toolbar_items.start
53 until
54 toolbar_items.after
55 loop
56 toolbar_items.item.enable_sensitive
57 toolbar_items.forth
58 end
59 end
60
61 l_sd_toolbar_items := managed_sd_toolbar_items
62 if l_sd_toolbar_items /= Void then
63 from
64 l_sd_toolbar_items.start
65 until
66 l_sd_toolbar_items.after
67 loop
68 l_sd_toolbar_items.item.enable_sensitive
69 l_sd_toolbar_items.forth
70 end
71 end
72
73 is_sensitive := True
74 end
75 end
76
77 disable_sensitive is
78 -- Set `is_sensitive' to True.
79 local
80 menu_items: like managed_menu_items
81 toolbar_items: like managed_toolbar_items
82 l_sd_tool_bar_items: like managed_sd_toolbar_items
83 do
84 if is_sensitive then
85 -- Disable menu items
86 menu_items := managed_menu_items
87 if menu_items /= Void then
88 from
89 menu_items.start
90 until
91 menu_items.after
92 loop
93 menu_items.item.disable_sensitive
94 menu_items.forth
95 end
96 end
97
98 -- Disable toolbar item
99 toolbar_items := managed_toolbar_items
100 if toolbar_items /= Void then
101 from
102 toolbar_items.start
103 until
104 toolbar_items.after
105 loop
106 toolbar_items.item.disable_sensitive
107 toolbar_items.forth
108 end
109 end
110
111 l_sd_tool_bar_items := managed_sd_toolbar_items
112 if l_sd_tool_bar_items /= Void then
113 from
114 l_sd_tool_bar_items.start
115 until
116 l_sd_tool_bar_items.after
117 loop
118 l_sd_tool_bar_items.item.disable_sensitive
119 l_sd_tool_bar_items.forth
120 end
121 end
122
123 is_sensitive := False
124 end
125 end
126
127 feature {NONE} -- Implementation
128
129 initialize_menu_item (a_menu_item: EB_COMMAND_MENU_ITEM) is
130 -- Create a new menu entry for this command.
131 do
132 Precursor {EB_MENUABLE_COMMAND} (a_menu_item)
133 if pixmap /= Void then
134 a_menu_item.set_pixmap (pixmap)
135 end
136 end
137
138 indexing
139 copyright: "Copyright (c) 1984-2006, Eiffel Software"
140 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
141 licensing_options: "http://www.eiffel.com/licensing"
142 copying: "[
143 This file is part of Eiffel Software's Eiffel Development Environment.
144
145 Eiffel Software's Eiffel Development Environment is free
146 software; you can redistribute it and/or modify it under
147 the terms of the GNU General Public License as published
148 by the Free Software Foundation, version 2 of the License
149 (available at the URL listed under "license" above).
150
151 Eiffel Software's Eiffel Development Environment is
152 distributed in the hope that it will be useful, but
153 WITHOUT ANY WARRANTY; without even the implied warranty
154 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
155 See the GNU General Public License for more details.
156
157 You should have received a copy of the GNU General Public
158 License along with Eiffel Software's Eiffel Development
159 Environment; if not, write to the Free Software Foundation,
160 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
161 ]"
162 source: "[
163 Eiffel Software
164 356 Storke Road, Goleta, CA 93117 USA
165 Telephone 805-685-1006, Fax 805-685-6869
166 Website http://www.eiffel.com
167 Customer support http://support.eiffel.com
168 ]"
169
170 end -- class EB_TOOLBARABLE_AND_MENUABLE_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23