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

Annotation of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62041 - (hide annotations)
Sun Jul 30 06:19:23 2006 UTC (13 years, 6 months ago) by manus
File size: 3600 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 manus 26913 indexing
2     description : "Command to change visibility of client links labels."
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 26913 date : "$Date$"
6     revision : "$Revision$"
7    
8     class
9     EB_TOGGLE_LABELS_COMMAND
10    
11     inherit
12     EB_CONTEXT_DIAGRAM_COMMAND
13     redefine
14 etienne 27345 new_toolbar_item,
15 bennob 47772 description,
16     initialize
17 manus 26913 end
18 king 56753
19 bennob 47772 EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
20 manus 26913
21     create
22     make
23 king 56753
24 bennob 47772 feature {NONE} -- Initialization
25 king 56753
26 bennob 47772 initialize is
27     -- Initialize default values.
28     do
29     create accelerator.make_with_key_combination (
30 king 56753 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_l),
31 bennob 47772 True, False, False)
32     accelerator.actions.extend (agent execute)
33     end
34 manus 26913
35     feature -- Basic operations
36    
37     execute is
38     -- Perform operation.
39     do
40 bennob 47772 if is_sensitive then
41     if tool.world.is_labels_shown then
42     tool.world.hide_labels
43     disable_select
44     else
45     tool.world.show_labels
46     enable_select
47     end
48     tool.projector.full_project
49 manus 26913 end
50     end
51    
52 king 56753 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
53 manus 26913 -- Create a new toolbar button for this command.
54     --
55     -- Call `recycle' on the result when you don't need it anymore otherwise
56     -- it will never be garbage collected.
57     do
58     create Result.make (Current)
59     current_button := Result
60 bennob 47280 if tool.world.is_labels_shown then
61     Result.toggle
62     end
63 king 56753 initialize_toolbar_item (Result, display_text)
64 julieng 37681 Result.select_actions.extend (agent execute)
65 manus 26913 end
66 king 56753
67 bennob 47280 feature -- Access
68 manus 26913
69     tooltip: STRING is
70     -- Tooltip for the toolbar button.
71     do
72     if current_button.is_selected then
73 etienne 27345 Result := Interface_names.f_diagram_hide_labels
74 manus 26913 else
75 etienne 27345 Result := Interface_names.f_diagram_show_labels
76 manus 26913 end
77     end
78    
79 bennob 47280 feature {NONE} -- Implementation
80    
81 king 56753 pixmap: EV_PIXMAP is
82     -- Pixmap representing the command.
83 bennob 47280 do
84 paulb 60407 Result := pixmaps.icon_pixmaps.diagram_show_labels_icon
85 bennob 47280 end
86    
87 manus 26913 description: STRING is
88     -- Description for this command.
89     do
90 etienne 27345 Result := Interface_names.l_diagram_labels_visibility
91 manus 26913 end
92    
93     name: STRING is "Labels_visibility"
94     -- Name of the command. Used to store the command in the
95     -- preferences.
96    
97     feature {EB_CONTEXT_EDITOR} -- Implementation
98    
99 manus 56535 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
100 manus 26913 -- Current toggle button.
101    
102 manus 56535 indexing
103     copyright: "Copyright (c) 1984-2006, Eiffel Software"
104 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
105 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
106     copying: "[
107     This file is part of Eiffel Software's Eiffel Development Environment.
108    
109     Eiffel Software's Eiffel Development Environment is free
110     software; you can redistribute it and/or modify it under
111     the terms of the GNU General Public License as published
112     by the Free Software Foundation, version 2 of the License
113     (available at the URL listed under "license" above).
114    
115     Eiffel Software's Eiffel Development Environment is
116     distributed in the hope that it will be useful, but
117     WITHOUT ANY WARRANTY; without even the implied warranty
118     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
119     See the GNU General Public License for more details.
120    
121     You should have received a copy of the GNU General Public
122     License along with Eiffel Software's Eiffel Development
123     Environment; if not, write to the Free Software Foundation,
124     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
125     ]"
126     source: "[
127     Eiffel Software
128     356 Storke Road, Goleta, CA 93117 USA
129     Telephone 805-685-1006, Fax 805-685-6869
130     Website http://www.eiffel.com
131     Customer support http://support.eiffel.com
132     ]"
133    
134 manus 26913 end -- class EB_TOGGLE_LABELS_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23