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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_toggle_quality_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: 4525 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Objects that is a command to toggle between high and low quality diagrams."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 author: "Benno Baumgartner"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 class
10 EB_TOGGLE_QUALITY_COMMAND
11
12 inherit
13 EB_CONTEXT_DIAGRAM_COMMAND
14 redefine
15 new_toolbar_item,
16 description,
17 initialize
18 end
19
20 EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
21
22 create
23 make
24
25 feature {NONE} -- Initialization
26
27 initialize is
28 -- Initialize default values.
29 do
30 create accelerator.make_with_key_combination (
31 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_q),
32 True, False, False)
33 accelerator.actions.extend (agent execute)
34 end
35
36 feature -- Basic operations
37
38 execute is
39 -- Perform operation.
40 local
41 l_world: EIFFEL_WORLD
42 l_projector: EIFFEL_PROJECTOR
43 do
44 if is_sensitive then
45 l_world := tool.world
46 l_projector := tool.projector
47 if l_world.is_high_quality then
48 l_world.disable_high_quality
49 disable_select
50 tool.history.register_named_undoable (
51 interface_names.t_diagram_disable_high_quality,
52 [<<agent l_world.disable_high_quality, agent l_projector.full_project, agent disable_select>>],
53 [<<agent l_world.enable_high_quality, agent l_projector.full_project, agent enable_select>>])
54 else
55 l_world.enable_high_quality
56 enable_select
57 tool.history.register_named_undoable (
58 interface_names.t_diagram_enable_high_quality,
59 [<<agent l_world.enable_high_quality, agent l_projector.full_project, agent enable_select>>],
60 [<<agent l_world.disable_high_quality, agent l_projector.full_project, agent disable_select>>])
61 end
62 l_projector.full_project
63 end
64 end
65
66 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
67 -- Create a new toolbar button for this command.
68 --
69 -- Call `recycle' on the result when you don't need it anymore otherwise
70 -- it will never be garbage collected.
71 do
72 create Result.make (Current)
73 current_button := Result
74 if tool.world.is_high_quality then
75 Result.toggle
76 end
77 initialize_toolbar_item (Result, display_text)
78 Result.select_actions.extend (agent execute)
79 end
80
81 feature -- Access
82
83 tooltip: STRING is
84 -- Tooltip for the toolbar button.
85 do
86 if current_button.is_selected then
87 Result := Interface_names.f_diagram_low_quality
88 else
89 Result := Interface_names.f_diagram_high_quality
90 end
91 end
92
93 feature {NONE} -- Implementation
94
95 pixmap: EV_PIXMAP is
96 -- Pixmap representing the command.
97 do
98 Result := pixmaps.icon_pixmaps.diagram_toggle_quality_icon
99 end
100
101 pixel_buffer: EV_PIXEL_BUFFER is
102 -- Pixel buffer representing the command.
103 do
104 -- Currently there is no pixel buffer for this command.
105 end
106
107 description: STRING is
108 -- Description for this command.
109 do
110 Result := Interface_names.l_diagram_toggle_quality
111 end
112
113 name: STRING is "High_quality"
114 -- Name of the command. Used to store the command in the
115 -- preferences.
116
117 feature {EB_CONTEXT_EDITOR} -- Implementation
118
119 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
120 -- Current toggle button.
121
122 indexing
123 copyright: "Copyright (c) 1984-2006, Eiffel Software"
124 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
125 licensing_options: "http://www.eiffel.com/licensing"
126 copying: "[
127 This file is part of Eiffel Software's Eiffel Development Environment.
128
129 Eiffel Software's Eiffel Development Environment is free
130 software; you can redistribute it and/or modify it under
131 the terms of the GNU General Public License as published
132 by the Free Software Foundation, version 2 of the License
133 (available at the URL listed under "license" above).
134
135 Eiffel Software's Eiffel Development Environment is
136 distributed in the hope that it will be useful, but
137 WITHOUT ANY WARRANTY; without even the implied warranty
138 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
139 See the GNU General Public License for more details.
140
141 You should have received a copy of the GNU General Public
142 License along with Eiffel Software's Eiffel Development
143 Environment; if not, write to the Free Software Foundation,
144 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
145 ]"
146 source: "[
147 Eiffel Software
148 356 Storke Road, Goleta, CA 93117 USA
149 Telephone 805-685-1006, Fax 805-685-6869
150 Website http://www.eiffel.com
151 Customer support http://support.eiffel.com
152 ]"
153
154 end -- class EB_TOGGLE_QUALITY_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23