/[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 47772 - (hide annotations)
Sat Jan 22 00:01:58 2005 UTC (15 years ago) by bennob
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e
File size: 2287 byte(s)
Keyboard shortcuts for all diagram commands.

1 manus 26913 indexing
2     description : "Command to change visibility of client links labels."
3     date : "$Date$"
4     revision : "$Revision$"
5    
6     class
7     EB_TOGGLE_LABELS_COMMAND
8    
9     inherit
10     EB_CONTEXT_DIAGRAM_COMMAND
11     redefine
12 etienne 27345 new_toolbar_item,
13 bennob 47772 description,
14     initialize
15 manus 26913 end
16 bennob 47772
17     EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
18 manus 26913
19     create
20     make
21 bennob 47772
22     feature {NONE} -- Initialization
23    
24     initialize is
25     -- Initialize default values.
26     do
27     create accelerator.make_with_key_combination (
28     create {EV_KEY}.make_with_code (key_constants.key_l),
29     True, False, False)
30     accelerator.actions.extend (agent execute)
31     end
32 manus 26913
33     feature -- Basic operations
34    
35     execute is
36     -- Perform operation.
37     do
38 bennob 47772 if is_sensitive then
39     if tool.world.is_labels_shown then
40     tool.world.hide_labels
41     disable_select
42     else
43     tool.world.show_labels
44     enable_select
45     end
46     tool.projector.full_project
47 manus 26913 end
48     end
49    
50     new_toolbar_item (display_text: BOOLEAN; use_gray_icons: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
51     -- Create a new toolbar button for this command.
52     --
53     -- Call `recycle' on the result when you don't need it anymore otherwise
54     -- it will never be garbage collected.
55     do
56     create Result.make (Current)
57     current_button := Result
58 bennob 47280 if tool.world.is_labels_shown then
59     Result.toggle
60     end
61 king 46332 initialize_toolbar_item (Result, display_text, use_gray_icons)
62 julieng 37681 Result.select_actions.extend (agent execute)
63 manus 26913 end
64 bennob 47280
65     feature -- Access
66 manus 26913
67     tooltip: STRING is
68     -- Tooltip for the toolbar button.
69     do
70     if current_button.is_selected then
71 etienne 27345 Result := Interface_names.f_diagram_hide_labels
72 manus 26913 else
73 etienne 27345 Result := Interface_names.f_diagram_show_labels
74 manus 26913 end
75     end
76    
77 bennob 47280 feature {NONE} -- Implementation
78    
79     pixmap: ARRAY [EV_PIXMAP] is
80     -- Pixmaps representing the command (one for the
81     -- gray version, one for the color version).
82     do
83     Result := Pixmaps.Icon_display_labels
84     end
85    
86 manus 26913 description: STRING is
87     -- Description for this command.
88     do
89 etienne 27345 Result := Interface_names.l_diagram_labels_visibility
90 manus 26913 end
91    
92     name: STRING is "Labels_visibility"
93     -- Name of the command. Used to store the command in the
94     -- preferences.
95    
96     feature {EB_CONTEXT_EDITOR} -- Implementation
97    
98     current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON
99     -- Current toggle button.
100    
101     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