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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_unify_stone_cmd.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: 5355 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Command to separate the stone management between the development%
3 %window and the context tool"
4 legal: "See notice at end of class."
5 status: "See notice at end of class."
6 author: "Xavier Rousselot"
7 date: "$Date$"
8 revision: "$Revision$"
9
10 class
11 EB_UNIFY_STONE_CMD
12
13 inherit
14 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
15 redefine
16 new_toolbar_item,
17 tooltext
18 end
19
20 EB_RECYCLABLE
21
22 create
23 make
24
25 feature -- Initialization
26
27 make (dev: EB_DEVELOPMENT_WINDOW) is
28 -- Initialize `Current' and associate it with `dev'.
29 do
30 window := dev
31 enable_sensitive
32 end
33
34 feature -- Status report
35
36 description: STRING is
37 do
38 Result := Interface_names.e_Toggle_stone_management
39 end
40
41 name: STRING is "Toggle_stone"
42
43 pixmap: EV_PIXMAP is
44 do
45 if window.unified_stone then
46 Result := pixmaps.icon_pixmaps.context_unlink_icon
47 else
48 Result := pixmaps.icon_pixmaps.context_link_icon
49 end
50 end
51
52 pixel_buffer: EV_PIXEL_BUFFER is
53 -- Pixel buffer representing the command.
54 do
55 if window.unified_stone then
56 Result := pixmaps.icon_pixmaps.context_unlink_icon_buffer
57 else
58 Result := pixmaps.icon_pixmaps.context_link_icon_buffer
59 end
60 end
61
62 tooltip: STRING is
63 do
64 if window.unified_stone then
65 Result := Interface_names.e_Separate_stone
66 else
67 Result := Interface_names.e_Unify_stone
68 end
69 end
70
71 tooltext: STRING is
72 -- Text displayed on the toolbar button.
73 do
74 Result := Interface_names.b_Toggle_stone_management
75 end
76
77 menu_name: STRING is
78 do
79 if window.unified_stone then
80 Result := Interface_names.m_Separate_stone
81 else
82 Result := Interface_names.m_Unify_stone
83 end
84 end
85
86 feature -- Basic operations
87
88 execute is
89 -- Toggle between a unified mode and a separate mode.
90 do
91 if not flag then
92 flag := True
93 window.toggle_unified_stone
94 if managed_menu_items /= Void then
95 from
96 managed_menu_items.start
97 until
98 managed_menu_items.after
99 loop
100 managed_menu_items.item.remove_text
101 managed_menu_items.item.set_text (menu_name)
102 managed_menu_items.item.set_pixmap (pixmap)
103 managed_menu_items.forth
104 end
105 end
106 if managed_toolbar_items /= Void then
107 from
108 managed_toolbar_items.start
109 until
110 managed_toolbar_items.after
111 loop
112 managed_toolbar_items.item.select_actions.block
113 managed_toolbar_items.item.toggle
114 managed_toolbar_items.item.select_actions.resume
115 managed_toolbar_items.forth
116 end
117 end
118 update_tooltip
119 flag := False
120 end
121 end
122
123 update_tooltip is
124 -- Display the good tooltip on buttons.
125 do
126 if managed_toolbar_items /= Void then
127 from
128 managed_toolbar_items.start
129 until
130 managed_toolbar_items.after
131 loop
132 -- managed_toolbar_items.item.remove_tooltip
133 managed_toolbar_items.item.set_tooltip (tooltip)
134 managed_toolbar_items.forth
135 end
136 end
137 end
138
139 toggle_buttons is
140 -- Display the good tooltip on buttons.
141 do
142 if managed_toolbar_items /= Void then
143 from
144 managed_toolbar_items.start
145 until
146 managed_toolbar_items.after
147 loop
148 managed_toolbar_items.item.select_actions.block
149 managed_toolbar_items.item.toggle
150 managed_toolbar_items.item.select_actions.resume
151 managed_toolbar_items.forth
152 end
153 end
154 end
155
156 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
157 -- Create a new toolbar button for this command.
158 do
159 -- Create the button
160 create Result.make (Current)
161 initialize_toolbar_item (Result, display_text)
162 if window.unified_stone then
163 Result.toggle
164 end
165 Result.select_actions.extend (agent execute)
166 Result.select_actions.extend (agent toggle_buttons)
167 Result.enable_sensitive
168 end
169
170 feature -- Recyclable
171
172 recycle is
173 -- Recycle
174 do
175 window := Void
176 end
177
178 feature {NONE} -- Implementation
179
180 flag: BOOLEAN
181 -- Is `Current' being executed?
182
183 window: EB_DEVELOPMENT_WINDOW;
184 -- Window `Current' is associated with.
185
186 indexing
187 copyright: "Copyright (c) 1984-2006, Eiffel Software"
188 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
189 licensing_options: "http://www.eiffel.com/licensing"
190 copying: "[
191 This file is part of Eiffel Software's Eiffel Development Environment.
192
193 Eiffel Software's Eiffel Development Environment is free
194 software; you can redistribute it and/or modify it under
195 the terms of the GNU General Public License as published
196 by the Free Software Foundation, version 2 of the License
197 (available at the URL listed under "license" above).
198
199 Eiffel Software's Eiffel Development Environment is
200 distributed in the hope that it will be useful, but
201 WITHOUT ANY WARRANTY; without even the implied warranty
202 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
203 See the GNU General Public License for more details.
204
205 You should have received a copy of the GNU General Public
206 License along with Eiffel Software's Eiffel Development
207 Environment; if not, write to the Free Software Foundation,
208 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
209 ]"
210 source: "[
211 Eiffel Software
212 356 Storke Road, Goleta, CA 93117 USA
213 Telephone 805-685-1006, Fax 805-685-6869
214 Website http://www.eiffel.com
215 Customer support http://support.eiffel.com
216 ]"
217
218 end -- class EB_UNIFY_STONE_CMD

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23