/[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 46332 - (hide annotations)
Fri Nov 5 18:15:34 2004 UTC (15 years, 2 months ago) by king
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e
File size: 2054 byte(s)
Refactored to use new setup
Implemented tooltext

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     description
14 manus 26913 end
15    
16     create
17     make
18    
19     feature -- Basic operations
20    
21     execute is
22     -- Perform operation.
23     local
24     world: CONTEXT_DIAGRAM
25     do
26     if tool.class_view /= Void then
27     world := tool.class_view
28     elseif tool.cluster_view /= Void then
29     world := tool.cluster_view
30     end
31     if world /= Void then
32     if world.labels_shown then
33     world.hide_labels
34     else
35     world.show_labels
36     end
37     current_button.set_tooltip (tooltip)
38     tool.projector.full_project
39     end
40     end
41    
42     new_toolbar_item (display_text: BOOLEAN; use_gray_icons: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
43     -- Create a new toolbar button for this command.
44     --
45     -- Call `recycle' on the result when you don't need it anymore otherwise
46     -- it will never be garbage collected.
47     do
48     create Result.make (Current)
49     current_button := Result
50 king 46332 initialize_toolbar_item (Result, display_text, use_gray_icons)
51 manus 26913 Result.toggle
52 julieng 37681 Result.select_actions.extend (agent execute)
53 manus 26913 end
54    
55     feature {NONE} -- Implementation
56    
57     pixmap: ARRAY [EV_PIXMAP] is
58     -- Pixmaps representing the command (one for the
59     -- gray version, one for the color version).
60     do
61     Result := Pixmaps.Icon_display_labels
62     end
63    
64     tooltip: STRING is
65     -- Tooltip for the toolbar button.
66     do
67     if current_button.is_selected then
68 etienne 27345 Result := Interface_names.f_diagram_hide_labels
69 manus 26913 else
70 etienne 27345 Result := Interface_names.f_diagram_show_labels
71 manus 26913 end
72     end
73    
74     description: STRING is
75     -- Description for this command.
76     do
77 etienne 27345 Result := Interface_names.l_diagram_labels_visibility
78 manus 26913 end
79    
80     name: STRING is "Labels_visibility"
81     -- Name of the command. Used to store the command in the
82     -- preferences.
83    
84     feature {EB_CONTEXT_EDITOR} -- Implementation
85    
86     current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON
87     -- Current toggle button.
88    
89     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