/[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 47280 - (hide annotations)
Tue Dec 28 19:29:19 2004 UTC (15 years, 1 month ago) by bennob
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e
File size: 2037 byte(s)
Changed commands such that they work with the new diagram tool.

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