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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_show_toolbar_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26913 - (show 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_show_toolbar_command.e
File size: 2799 byte(s)
Merged branch `dev46_manu' to the trunc.

1 indexing
2 description : "Command to show/hide a toolbar"
3 date : "$Date$"
4 revision : "$Revision$"
5 author : "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
6
7 class
8 EB_SHOW_TOOLBAR_COMMAND
9
10 inherit
11 EB_SHOW_WIDGET_COMMAND
12 rename
13 make as command_make
14 redefine
15 enable_visible,
16 disable_visible,
17 initialize
18 end
19
20 EB_MENUABLE_COMMAND
21 redefine
22 new_menu_item,
23 initialize
24 end
25
26 create
27 make
28
29 feature {NONE} -- Initialization
30
31 make (a_target: like target; a_menu_name: STRING) is
32 -- Initialize Current with target `a_target' and `menu_name' set to `a_menu_name'.
33 do
34 command_make (a_target)
35 menu_name := a_menu_name
36 name := a_menu_name
37 end
38
39 initialize is
40 -- Initialize default values.
41 do
42 Precursor {EB_SHOW_WIDGET_COMMAND}
43 Precursor {EB_MENUABLE_COMMAND}
44 end
45
46 feature -- Status setting
47
48 enable_visible is
49 -- Set `is_visible' to True.
50 local
51 menu_items: like managed_menu_items
52 citem: EB_COMMAND_CHECK_MENU_ITEM
53 do
54 if not is_visible then
55 is_visible := True
56 target.show
57 menu_items := managed_menu_items
58 if menu_items /= Void then
59 from
60 menu_items.start
61 until
62 menu_items.after
63 loop
64 citem := menu_items.item
65 if not citem.is_selected then
66 citem.select_actions.block
67 citem.enable_select
68 citem.select_actions.resume
69 end
70 menu_items.forth
71 end
72 end
73 end
74 end
75
76 disable_visible is
77 -- Set `is_visible' to True.
78 local
79 menu_items: like managed_menu_items
80 citem: EB_COMMAND_CHECK_MENU_ITEM
81 do
82 if is_visible then
83 menu_items := managed_menu_items
84 if menu_items /= Void then
85 from
86 menu_items.start
87 until
88 menu_items.after
89 loop
90 citem := menu_items.item
91 if citem.is_selected then
92 citem.select_actions.block
93 citem.disable_select
94 citem.select_actions.resume
95 end
96 menu_items.forth
97 end
98 end
99 is_visible := False
100 target.hide
101 end
102 end
103
104 feature -- Basic operations
105
106 new_menu_item: EB_COMMAND_CHECK_MENU_ITEM is
107 -- Create a new menu entry for this command.
108 local
109 mname: STRING
110 do
111 -- Add it to the managed menu items
112 if managed_menu_items = Void then
113 create managed_menu_items.make (1)
114 end
115 -- Create the menu item
116 create Result.make (Current)
117 mname := clone (menu_name)
118 if accelerator /= Void then
119 mname.append (Tabulation)
120 mname.append (accelerator.out)
121 end
122 Result.set_text (mname)
123 Result.enable_sensitive
124 if is_visible then
125 Result.enable_select
126 else
127 Result.disable_select
128 end
129 Result.select_actions.extend (~execute)
130 end
131
132 feature -- Access
133
134 menu_name: STRING
135 -- Name as it appears in the menu.
136
137 name: STRING
138 -- Name for the command.
139
140 end -- class EB_SHOW_TOOLBAR_COMMAND

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23