/[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 26913 - (hide annotations)
Sun Aug 12 23:50:20 2001 UTC (18 years, 5 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_toggle_labels_command.e
File size: 2492 byte(s)
Merged branch `dev46_manu' to the trunc.

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     new_toolbar_item
13     end
14    
15     create
16     make
17    
18     feature -- Basic operations
19    
20     execute is
21     -- Perform operation.
22     local
23     world: CONTEXT_DIAGRAM
24     do
25     if tool.class_view /= Void then
26     world := tool.class_view
27     elseif tool.cluster_view /= Void then
28     world := tool.cluster_view
29     end
30     if world /= Void then
31     if world.labels_shown then
32     world.hide_labels
33     else
34     world.show_labels
35     end
36     current_button.set_tooltip (tooltip)
37     tool.projector.full_project
38     end
39     end
40    
41     new_toolbar_item (display_text: BOOLEAN; use_gray_icons: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
42     -- Create a new toolbar button for this command.
43     --
44     -- Call `recycle' on the result when you don't need it anymore otherwise
45     -- it will never be garbage collected.
46     local
47     tt: STRING
48     do
49     -- Add it to the managed toolbar items
50     if managed_toolbar_items = Void then
51     create managed_toolbar_items.make (1)
52     end
53     create Result.make (Current)
54     if display_text and pixmap.count >= 2 then
55     Result.set_pixmap (pixmap @ 2)
56     else
57     Result.set_pixmap (pixmap @ 1)
58     end
59     if is_sensitive then
60     Result.enable_sensitive
61     else
62     Result.disable_sensitive
63     end
64     current_button := Result
65     Result.toggle
66     tt := clone (tooltip)
67     if accelerator /= Void then
68     tt.append (Opening_parenthesis)
69     tt.append (accelerator.out)
70     tt.append (Closing_parenthesis)
71     end
72     Result.set_tooltip (tt)
73     Result.select_actions.extend (~execute)
74     end
75    
76     feature {NONE} -- Implementation
77    
78     pixmap: ARRAY [EV_PIXMAP] is
79     -- Pixmaps representing the command (one for the
80     -- gray version, one for the color version).
81     do
82     Result := Pixmaps.Icon_display_labels
83     end
84    
85     tooltip: STRING is
86     -- Tooltip for the toolbar button.
87     do
88     if current_button.is_selected then
89     Result := "Hide labels"
90     else
91     Result := "Show labels"
92     end
93     end
94    
95     description: STRING is
96     -- Description for this command.
97     do
98     Result := "Toggle visibility of client link labels"
99     end
100    
101     name: STRING is "Labels_visibility"
102     -- Name of the command. Used to store the command in the
103     -- preferences.
104    
105     feature {EB_CONTEXT_EDITOR} -- Implementation
106    
107     current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON
108     -- Current toggle button.
109    
110     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