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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_toggle_cluster_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: 3890 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Objects that is a command to show/hide cluster figures in diagram"
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_CLUSTER_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_m),
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 do
41 if is_sensitive then
42 if tool.world.is_cluster_shown then
43 tool.world.hide_clusters
44 tool.projector.full_project
45 else
46 tool.world.show_clusters
47 tool.projector.full_project
48 end
49 if tool.world.is_cluster_shown then
50 enable_select
51 else
52 disable_select
53 end
54 end
55 end
56
57 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
58 -- Create a new toolbar button for this command.
59 --
60 -- Call `recycle' on the result when you don't need it anymore otherwise
61 -- it will never be garbage collected.
62 do
63 create Result.make (Current)
64 current_button := Result
65 if tool.world.is_cluster_shown then
66 Result.toggle
67 end
68 initialize_toolbar_item (Result, display_text)
69 Result.select_actions.extend (agent execute)
70 end
71
72 feature -- Access
73
74 tooltip: STRING is
75 -- Tooltip for the toolbar button.
76 do
77 if current_button.is_selected then
78 Result := Interface_names.f_diagram_hide_clusters
79 else
80 Result := Interface_names.f_diagram_show_clusters
81 end
82 end
83
84 feature {NONE} -- Implementation
85
86 pixmap: EV_PIXMAP is
87 -- Pixmap representing the command.
88 do
89 Result := pixmaps.icon_pixmaps.tool_clusters_icon
90 end
91
92 pixel_buffer: EV_PIXEL_BUFFER is
93 -- Pixel buffer representing the command.
94 do
95 Result := pixmaps.icon_pixmaps.tool_clusters_icon_buffer
96 end
97
98 description: STRING is
99 -- Description for this command.
100 do
101 Result := Interface_names.l_diagram_clusters_visibility
102 end
103
104 name: STRING is "Clusters_visibility"
105 -- Name of the command. Used to store the command in the
106 -- preferences.
107
108 feature {EB_CONTEXT_EDITOR} -- Implementation
109
110 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
111 -- Current toggle button.
112
113 indexing
114 copyright: "Copyright (c) 1984-2006, Eiffel Software"
115 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
116 licensing_options: "http://www.eiffel.com/licensing"
117 copying: "[
118 This file is part of Eiffel Software's Eiffel Development Environment.
119
120 Eiffel Software's Eiffel Development Environment is free
121 software; you can redistribute it and/or modify it under
122 the terms of the GNU General Public License as published
123 by the Free Software Foundation, version 2 of the License
124 (available at the URL listed under "license" above).
125
126 Eiffel Software's Eiffel Development Environment is
127 distributed in the hope that it will be useful, but
128 WITHOUT ANY WARRANTY; without even the implied warranty
129 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
130 See the GNU General Public License for more details.
131
132 You should have received a copy of the GNU General Public
133 License along with Eiffel Software's Eiffel Development
134 Environment; if not, write to the Free Software Foundation,
135 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
136 ]"
137 source: "[
138 Eiffel Software
139 356 Storke Road, Goleta, CA 93117 USA
140 Telephone 805-685-1006, Fax 805-685-6869
141 Website http://www.eiffel.com
142 Customer support http://support.eiffel.com
143 ]"
144
145 end -- class EB_TOGGLE_CLUSTER_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23