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

Contents 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 56535 - (show annotations)
Tue Jan 17 01:37:10 2006 UTC (14 years ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e
File size: 3693 byte(s)
Added text of the GPL license to all classes of the compiler.

1 indexing
2 description : "Command to change visibility of client links labels."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date : "$Date$"
6 revision : "$Revision$"
7
8 class
9 EB_TOGGLE_LABELS_COMMAND
10
11 inherit
12 EB_CONTEXT_DIAGRAM_COMMAND
13 redefine
14 new_toolbar_item,
15 description,
16 initialize
17 end
18
19 EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
20
21 create
22 make
23
24 feature {NONE} -- Initialization
25
26 initialize is
27 -- Initialize default values.
28 do
29 create accelerator.make_with_key_combination (
30 create {EV_KEY}.make_with_code (key_constants.key_l),
31 True, False, False)
32 accelerator.actions.extend (agent execute)
33 end
34
35 feature -- Basic operations
36
37 execute is
38 -- Perform operation.
39 do
40 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 end
50 end
51
52 new_toolbar_item (display_text: BOOLEAN; use_gray_icons: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
53 -- 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 if tool.world.is_labels_shown then
61 Result.toggle
62 end
63 initialize_toolbar_item (Result, display_text, use_gray_icons)
64 Result.select_actions.extend (agent execute)
65 end
66
67 feature -- Access
68
69 tooltip: STRING is
70 -- Tooltip for the toolbar button.
71 do
72 if current_button.is_selected then
73 Result := Interface_names.f_diagram_hide_labels
74 else
75 Result := Interface_names.f_diagram_show_labels
76 end
77 end
78
79 feature {NONE} -- Implementation
80
81 pixmap: ARRAY [EV_PIXMAP] is
82 -- Pixmaps representing the command (one for the
83 -- gray version, one for the color version).
84 do
85 Result := Pixmaps.Icon_display_labels
86 end
87
88 description: STRING is
89 -- Description for this command.
90 do
91 Result := Interface_names.l_diagram_labels_visibility
92 end
93
94 name: STRING is "Labels_visibility"
95 -- Name of the command. Used to store the command in the
96 -- preferences.
97
98 feature {EB_CONTEXT_EDITOR} -- Implementation
99
100 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
101 -- Current toggle button.
102
103 indexing
104 copyright: "Copyright (c) 1984-2006, Eiffel Software"
105 license: "GPL version 2 see http://www.eiffel.com/licensing/gpl.txt)"
106 licensing_options: "http://www.eiffel.com/licensing"
107 copying: "[
108 This file is part of Eiffel Software's Eiffel Development Environment.
109
110 Eiffel Software's Eiffel Development Environment is free
111 software; you can redistribute it and/or modify it under
112 the terms of the GNU General Public License as published
113 by the Free Software Foundation, version 2 of the License
114 (available at the URL listed under "license" above).
115
116 Eiffel Software's Eiffel Development Environment is
117 distributed in the hope that it will be useful, but
118 WITHOUT ANY WARRANTY; without even the implied warranty
119 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
120 See the GNU General Public License for more details.
121
122 You should have received a copy of the GNU General Public
123 License along with Eiffel Software's Eiffel Development
124 Environment; if not, write to the Free Software Foundation,
125 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
126 ]"
127 source: "[
128 Eiffel Software
129 356 Storke Road, Goleta, CA 93117 USA
130 Telephone 805-685-1006, Fax 805-685-6869
131 Website http://www.eiffel.com
132 Customer support http://support.eiffel.com
133 ]"
134
135 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