/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/debug_tool/eb_exec_format_cmd.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/debug_tool/eb_exec_format_cmd.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61887 - (show annotations)
Sun Jul 30 05:49:38 2006 UTC (13 years, 4 months ago) by manus
File size: 6812 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description:
3 "Set execution format."
4 legal: "See notice at end of class."
5 status: "See notice at end of class."
6 date: "$Date$"
7 revision: "$Revision$"
8
9 deferred class
10 EB_EXEC_FORMAT_CMD
11
12 inherit
13 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
14 redefine
15 new_toolbar_item,
16 new_menu_item
17 end
18
19 EB_SHARED_INTERFACE_TOOLS
20 export
21 {NONE} all
22 end
23
24 EXEC_MODES
25
26 EB_CONSTANTS
27
28 EB_SHARED_WINDOW_MANAGER
29
30 feature {NONE} -- Initialization
31
32 make (a_manager: like debugger_manager) is
33 -- Initialize `Current' and associate it with `a_manager'.
34 do
35 debugger_manager := a_manager
36 end
37
38 feature -- Formatting
39
40 execute_from_argument_dialog (a_execution_mode: INTEGER) is
41 -- Execute from argument dialog and therefore ALWAYS stop at breakpoints.
42 do
43 if is_sensitive then
44 internal_execute (a_execution_mode)
45 end
46 end
47
48 execute is
49 -- Set the execution format to `stone'.
50 do
51 if is_sensitive then
52 internal_execute (execution_mode)
53 end
54 end
55
56 feature -- Properties
57
58 debugger_manager: EB_DEBUGGER_MANAGER
59 -- Manager in charge of all debugging operations.
60
61 tooltip: STRING is
62 -- Tooltip for `Current'.
63 do
64 Result := internal_tooltip
65 end
66
67 feature -- Access
68
69 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
70 do
71 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND} (display_text)
72 Result.select_actions.put_front (agent execute_from (Result))
73 Result.pointer_button_press_actions.put_front (agent button_right_click_action)
74 end
75
76 new_menu_item: EB_COMMAND_MENU_ITEM is
77 do
78 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND}
79 Result.select_actions.put_front (agent execute_from (Result))
80 end
81
82 feature {NONE} -- Attributes
83
84 description: STRING is
85 -- What appears in the customize dialog box.
86 do
87 Result := tooltip
88 end
89
90 execution_mode: INTEGER is
91 -- Kind of execution performed by `Current'.
92 deferred
93 end
94
95 feature {NONE} -- Implementation
96
97 internal_execute (a_execution_mode: INTEGER) is
98 -- Execute.
99 local
100 conv_dev: EB_DEVELOPMENT_WINDOW
101 do
102 if not executed_from_widget and not debugger_manager.raised then
103 -- The debugging window has not been updated yet.
104 -- If a shortcut was used, the corresponding window
105 -- must have the focus.
106 conv_dev ?= window_manager.last_focused_window
107 if conv_dev /= Void then
108 debugger_manager.set_debugging_window (conv_dev)
109 else
110 debug end
111 debugger_manager.set_debugging_window (Window_manager.a_development_window)
112 end
113 end
114 debugger_manager.debug_run_cmd.execute_with_mode (a_execution_mode)
115 if not debugger_manager.application_is_executing then
116 -- The application was not launched for some reason
117 -- (a compilation was running, the user didn't want to launch it after all,...)
118 debugger_manager.set_debugging_window (Void)
119 end
120 debug
121 executed_from_widget := False
122 end
123 end
124
125 execute_from (widget: EV_CONTAINABLE) is
126 -- Set widget's top-level window as the debugging window.
127 local
128 trigger: EV_CONTAINABLE
129 cont: EV_ANY
130 window: EV_WINDOW
131 dev: EB_DEVELOPMENT_WINDOW
132 do
133 executed_from_widget := False
134 if not debugger_manager.raised then
135 -- We try to find from which window we were launched.
136 from
137 trigger := widget
138 cont := trigger.parent
139 until
140 cont = Void
141 loop
142 trigger ?= cont
143 if trigger /= Void then
144 cont := trigger.parent
145 else
146 cont := Void
147 end
148 end
149 window ?= trigger
150 if window /= Void then
151 debugger_manager.set_debugging_window (
152 window_manager.development_window_from_window (window)
153 )
154 executed_from_widget := True
155 else
156 debug ("DEBUGGER_INTERFACE")
157 io.put_string ("Could not find the top window (dixit EB_EXEC_FORMAT_CMD)%N")
158 end
159 dev ?= Window_manager.last_focused_window
160 if dev /= Void then
161 debugger_manager.set_debugging_window (dev)
162 executed_from_widget := True
163 else
164 debug ("DEBUGGER_INTERFACE")
165 io.put_string ("Could not find the last focused window (dixit EB_EXEC_FORMAT_CMD)%N")
166 end
167 debugger_manager.set_debugging_window (Window_manager.a_development_window)
168 if Window_manager.a_development_window /= Void then
169 executed_from_widget := True
170 end
171 end
172 end
173 end
174 end
175
176 executed_from_widget: BOOLEAN
177 -- Was the command launched through a menu or a toolbar button
178 -- (by opposition to an accelerator)?
179
180 internal_tooltip: STRING is
181 -- Basic tooltip (without the key shortcut).
182 deferred
183 end
184
185 button_right_click_action (a_x, a_y, a_button: INTEGER; a_x_tilt, a_y_tilt, a_pressure: DOUBLE; a_screen_x, a_screen_y: INTEGER) is
186 -- Show the arguments dialog box when the user right clicks the button.
187 local
188 args_dialog: EB_ARGUMENT_DIALOG
189 window: EB_DEVELOPMENT_WINDOW
190 dev: EV_WINDOW
191 do
192 if a_button = 3 and is_sensitive then
193 window ?= window_manager.last_focused_window
194 if window /= Void then
195 dev := window.window
196 if not argument_dialog_is_valid then
197 create args_dialog.make (window, agent execute_from_argument_dialog (User_stop_points))
198 set_argument_dialog (args_dialog)
199 else
200 argument_dialog.update
201 end
202 if not argument_dialog.is_displayed then
203 argument_dialog.show
204 end
205 if argument_dialog.is_minimized then
206 argument_dialog.restore
207 end
208 argument_dialog.raise
209 end
210 end
211 end
212
213 indexing
214 copyright: "Copyright (c) 1984-2006, Eiffel Software"
215 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
216 licensing_options: "http://www.eiffel.com/licensing"
217 copying: "[
218 This file is part of Eiffel Software's Eiffel Development Environment.
219
220 Eiffel Software's Eiffel Development Environment is free
221 software; you can redistribute it and/or modify it under
222 the terms of the GNU General Public License as published
223 by the Free Software Foundation, version 2 of the License
224 (available at the URL listed under "license" above).
225
226 Eiffel Software's Eiffel Development Environment is
227 distributed in the hope that it will be useful, but
228 WITHOUT ANY WARRANTY; without even the implied warranty
229 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
230 See the GNU General Public License for more details.
231
232 You should have received a copy of the GNU General Public
233 License along with Eiffel Software's Eiffel Development
234 Environment; if not, write to the Free Software Foundation,
235 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
236 ]"
237 source: "[
238 Eiffel Software
239 356 Storke Road, Goleta, CA 93117 USA
240 Telephone 805-685-1006, Fax 805-685-6869
241 Website http://www.eiffel.com
242 Customer support http://support.eiffel.com
243 ]"
244
245 end -- class EB_EXEC_FORMAT_CMD

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23