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

Annotation 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 62171 - (hide annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 5 months ago) by larryl
File size: 3806 byte(s)
First commit docking tabbed Eiffel Studio.
1 bennob 47278 indexing
2 bennob 47668 description: "Objects that toggle visibility of cluster legend"
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 bennob 47668 author: "Benno Baumgartner"
6 bennob 47278 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 bennob 47772 description,
17     initialize
18 bennob 47278 end
19 king 56753
20 bennob 47772 EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
21 king 56753
22 bennob 47278 create
23     make
24 king 56753
25 bennob 47772 feature {NONE} -- Initialization
26 king 56753
27 bennob 47772 initialize is
28     -- Initialize default values.
29     do
30     create accelerator.make_with_key_combination (
31 king 56753 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_l),
32 bennob 47772 True, False, True)
33     accelerator.actions.extend (agent execute)
34     end
35 bennob 47278
36     feature -- Basic operations
37    
38     execute is
39     -- Perform operation.
40     do
41 bennob 47772 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 king 56753 end
50 bennob 47278 tool.projector.full_project
51 bennob 47772 end
52 bennob 47278 end
53    
54 king 56753 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
55 bennob 47278 -- 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 king 56753 initialize_toolbar_item (Result, display_text)
66 bennob 47278 Result.select_actions.extend (agent execute)
67     end
68 king 56753
69 bennob 47278 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 king 56753 pixmap: EV_PIXMAP is
84     -- Pixmap representing the command.
85 bennob 47278 do
86 paulb 60267 Result := pixmaps.icon_pixmaps.diagram_show_legend_icon
87 bennob 47278 end
88    
89 larryl 62171 pixel_buffer: EV_PIXEL_BUFFER is
90     -- Pixel buffer representing the command.
91     do
92     -- Currently there is no pixel buffer for this command.
93     end
94    
95 bennob 47278 description: STRING is
96     -- Description for this command.
97     do
98     Result := Interface_names.l_diagram_legend_visibility
99     end
100    
101     name: STRING is "Display_legend"
102     -- Name of the command. Used to store the command in the
103     -- preferences.
104    
105     feature {EB_CONTEXT_EDITOR} -- Implementation
106    
107 manus 56535 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
108 bennob 47278 -- Current toggle button.
109    
110 manus 56535 indexing
111     copyright: "Copyright (c) 1984-2006, Eiffel Software"
112 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
113 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
114     copying: "[
115     This file is part of Eiffel Software's Eiffel Development Environment.
116    
117     Eiffel Software's Eiffel Development Environment is free
118     software; you can redistribute it and/or modify it under
119     the terms of the GNU General Public License as published
120     by the Free Software Foundation, version 2 of the License
121     (available at the URL listed under "license" above).
122    
123     Eiffel Software's Eiffel Development Environment is
124     distributed in the hope that it will be useful, but
125     WITHOUT ANY WARRANTY; without even the implied warranty
126     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
127     See the GNU General Public License for more details.
128    
129     You should have received a copy of the GNU General Public
130     License along with Eiffel Software's Eiffel Development
131     Environment; if not, write to the Free Software Foundation,
132     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
133     ]"
134     source: "[
135     Eiffel Software
136     356 Storke Road, Goleta, CA 93117 USA
137     Telephone 805-685-1006, Fax 805-685-6869
138     Website http://www.eiffel.com
139     Customer support http://support.eiffel.com
140     ]"
141    
142 bennob 47278 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