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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_new_development_window_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: 6650 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description : "Command to create a new development window."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date : "$Date$"
6 revision : "$Revision$"
7 author : "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
8
9 class
10 EB_NEW_DEVELOPMENT_WINDOW_COMMAND
11
12 inherit
13 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
14 redefine
15 new_toolbar_item,
16 new_sd_toolbar_item,
17 tooltext,
18 pixel_buffer
19 end
20
21 EB_SHARED_WINDOW_MANAGER
22
23 EB_CONSTANTS
24
25 create
26 make_with_style
27
28 feature {NONE} -- Initialization
29
30 make_with_style (s: INTEGER) is
31 -- Initialize default values.
32 require
33 valid_style: s = editor_style or s = default_style or s = context_style
34 do
35 is_sensitive := True
36 style := s
37 if s = default_style then
38 create accelerator.make_with_key_combination (
39 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_n),
40 True, False, False)
41 accelerator.actions.extend (agent execute)
42 end
43 end
44
45 feature -- Basic operations
46
47 execute is
48 -- Create a development window.
49 do
50 inspect style
51 when default_style then
52 window_manager.create_window
53 when editor_style then
54 window_manager.create_editor_window
55 when context_style then
56 window_manager.create_context_window
57 end
58 end
59
60 execute_with_stone (a_stone: STONE) is
61 -- Create a development window and process `a_stone'.
62 local
63 new_window: EB_DEVELOPMENT_WINDOW
64 do
65 execute
66 new_window := window_manager.last_created_window
67 check
68 creation_effective: new_window /= Void
69 -- Was the style invalid?
70 end
71 if a_stone /= Void then
72 new_window.force_stone (a_stone)
73 end
74 end
75
76 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
77 -- Create a new toolbar button for this command.
78 do
79 Result := Precursor (display_text)
80 Result.drop_actions.extend (agent execute_with_stone (?))
81 Result.drop_actions.set_veto_pebble_function (agent is_storable)
82 end
83
84 new_sd_toolbar_item (display_text: BOOLEAN): EB_SD_COMMAND_TOOL_BAR_BUTTON is
85 -- Create a new toolbar button for this command.
86 do
87 Result := Precursor (display_text)
88 Result.drop_actions.extend (agent execute_with_stone (?))
89 Result.drop_actions.set_veto_pebble_function (agent is_storable)
90 end
91
92 feature -- Access
93
94 style: INTEGER
95 -- What kind of development window should `Current' create: development windows,
96 -- editor windows or context windows?
97 -- This modifies the menus, the pixmaps and the execution of `Current'.
98
99 default_style: INTEGER is 0
100 editor_style: INTEGER is 1
101 context_style: INTEGER is 2
102 -- The different styles that can be used to initialize `Current'.
103
104 feature {NONE} -- Implementation
105
106 menu_name: STRING is
107 -- Name as it appears in the menu (with & symbol).
108 do
109 inspect style
110 when default_style then
111 Result := Interface_names.m_New_window
112 when editor_style then
113 Result := Interface_names.m_New_editor
114 when context_style then
115 Result := Interface_names.m_New_context_tool
116 end
117 end
118
119 pixmap: EV_PIXMAP is
120 -- Pixmaps representing the command.
121 do
122 inspect style
123 when default_style then
124 Result := pixmaps.icon_pixmaps.new_window_icon
125 when editor_style then
126 Result := pixmaps.icon_pixmaps.new_editor_icon
127 when context_style then
128 Result := Pixmaps.icon_new_context_tool
129 end
130 end
131
132 pixel_buffer: EV_PIXEL_BUFFER is
133 -- Pixel buffer representing the command.
134 do
135 inspect style
136 when default_style then
137 Result := pixmaps.icon_pixmaps.new_window_icon_buffer
138 when editor_style then
139 Result := pixmaps.icon_pixmaps.new_editor_icon_buffer
140 when context_style then
141 -- Result := Pixmaps.icon_new_context_icon_buffer
142 end
143 end
144
145 tooltip: STRING is
146 -- Tooltip for the toolbar button.
147 do
148 Result := description
149 end
150
151 tooltext: STRING is
152 -- Text for the toolbar button.
153 do
154 inspect style
155 when default_style then
156 Result := Interface_names.b_New_window
157 when editor_style then
158 Result := Interface_names.b_New_editor
159 when context_style then
160 Result := Interface_names.b_New_context
161 end
162 end
163
164 is_storable (st: ANY): BOOLEAN is
165 -- Can `st' be dropped?
166 local
167 conv_st: STONE
168 do
169 conv_st ?= st
170 Result := conv_st /= Void and then conv_st.is_storable
171 end
172
173 description: STRING is
174 -- Description for this commane
175 do
176 inspect style
177 when default_style then
178 Result := Interface_names.f_New_window
179 when editor_style then
180 Result := Interface_names.e_New_editor
181 when context_style then
182 Result := Interface_names.e_New_context_tool
183 end
184 end
185
186 name: STRING is
187 -- Name of the command. Used to store the command in the
188 -- preferences.
189 do
190 inspect style
191 when default_style then
192 Result := "New_window"
193 when editor_style then
194 Result := "New_editor"
195 when context_style then
196 Result := "New_context_window"
197 end
198 end
199
200 feature -- Obsolete
201
202 create_class_tool (a_stone: STONE) is
203 -- Create a development window and process `a_stone'.
204 obsolete "use `execute_with_stone' instead"
205 do
206 execute_with_stone (a_stone)
207 end
208
209 create_new_development_window (a_stone: STONE) is
210 -- Create a development window and process `a_stone'.
211 obsolete
212 "use `execute_with_stone' instead"
213 do
214 execute_with_stone (a_stone)
215 end
216
217 indexing
218 copyright: "Copyright (c) 1984-2006, Eiffel Software"
219 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
220 licensing_options: "http://www.eiffel.com/licensing"
221 copying: "[
222 This file is part of Eiffel Software's Eiffel Development Environment.
223
224 Eiffel Software's Eiffel Development Environment is free
225 software; you can redistribute it and/or modify it under
226 the terms of the GNU General Public License as published
227 by the Free Software Foundation, version 2 of the License
228 (available at the URL listed under "license" above).
229
230 Eiffel Software's Eiffel Development Environment is
231 distributed in the hope that it will be useful, but
232 WITHOUT ANY WARRANTY; without even the implied warranty
233 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
234 See the GNU General Public License for more details.
235
236 You should have received a copy of the GNU General Public
237 License along with Eiffel Software's Eiffel Development
238 Environment; if not, write to the Free Software Foundation,
239 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
240 ]"
241 source: "[
242 Eiffel Software
243 356 Storke Road, Goleta, CA 93117 USA
244 Telephone 805-685-1006, Fax 805-685-6869
245 Website http://www.eiffel.com
246 Customer support http://support.eiffel.com
247 ]"
248
249 end -- class EB_NEW_DEVELOPMENT_WINDOW_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23