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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_show_legend_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62026 - (show annotations)
Sun Jul 30 06:16:31 2006 UTC (13 years, 5 months ago) by manus
File size: 3654 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description: "Objects that toggle visibility of cluster legend"
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_SHOW_LEGEND_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_l),
32 True, False, True)
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_legend_shown then
43 tool.world.hide_legend
44 disable_select
45 else
46 tool.world.show_legend
47 tool.on_cluster_legend_pin
48 enable_select
49 end
50 tool.projector.full_project
51 end
52 end
53
54 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
55 -- Create a new toolbar button for this command.
56 --
57 -- Call `recycle' on the result when you don't need it anymore otherwise
58 -- it will never be garbage collected.
59 do
60 create Result.make (Current)
61 current_button := Result
62 if tool.world.is_cluster_shown then
63 current_button.toggle
64 end
65 initialize_toolbar_item (Result, display_text)
66 Result.select_actions.extend (agent execute)
67 end
68
69 feature -- Access
70
71 tooltip: STRING is
72 -- Tooltip for the toolbar button.
73 do
74 if current_button.is_selected then
75 Result := Interface_names.f_diagram_hide_legend
76 else
77 Result := Interface_names.f_diagram_show_legend
78 end
79 end
80
81 feature {NONE} -- Implementation
82
83 pixmap: EV_PIXMAP is
84 -- Pixmap representing the command.
85 do
86 Result := pixmaps.icon_pixmaps.diagram_show_legend_icon
87 end
88
89 description: STRING is
90 -- Description for this command.
91 do
92 Result := Interface_names.l_diagram_legend_visibility
93 end
94
95 name: STRING is "Display_legend"
96 -- Name of the command. Used to store the command in the
97 -- preferences.
98
99 feature {EB_CONTEXT_EDITOR} -- Implementation
100
101 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
102 -- Current toggle button.
103
104 indexing
105 copyright: "Copyright (c) 1984-2006, Eiffel Software"
106 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
107 licensing_options: "http://www.eiffel.com/licensing"
108 copying: "[
109 This file is part of Eiffel Software's Eiffel Development Environment.
110
111 Eiffel Software's Eiffel Development Environment is free
112 software; you can redistribute it and/or modify it under
113 the terms of the GNU General Public License as published
114 by the Free Software Foundation, version 2 of the License
115 (available at the URL listed under "license" above).
116
117 Eiffel Software's Eiffel Development Environment is
118 distributed in the hope that it will be useful, but
119 WITHOUT ANY WARRANTY; without even the implied warranty
120 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
121 See the GNU General Public License for more details.
122
123 You should have received a copy of the GNU General Public
124 License along with Eiffel Software's Eiffel Development
125 Environment; if not, write to the Free Software Foundation,
126 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
127 ]"
128 source: "[
129 Eiffel Software
130 356 Storke Road, Goleta, CA 93117 USA
131 Telephone 805-685-1006, Fax 805-685-6869
132 Website http://www.eiffel.com
133 Customer support http://support.eiffel.com
134 ]"
135
136 end -- class EB_SHOW_LEGEND_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23