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

Annotation 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 40748 - (hide annotations)
Thu Dec 11 20:26:31 2003 UTC (16 years, 1 month ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_show_toolbar_command.e
File size: 2638 byte(s)
Use `twin' instead of `clone' which is now made obsolete.
Use `as_lower' and `as_upper' whenever appropriate instead of cloning and
  then calling `to_lower' or `to_upper'.

1 manus 26913 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 xavier 30015 disable_visible
17 manus 26913 end
18    
19     EB_MENUABLE_COMMAND
20     redefine
21 xavier 30015 new_menu_item
22 manus 26913 end
23    
24     create
25     make
26    
27     feature {NONE} -- Initialization
28    
29     make (a_target: like target; a_menu_name: STRING) is
30     -- Initialize Current with target `a_target' and `menu_name' set to `a_menu_name'.
31     do
32     command_make (a_target)
33     menu_name := a_menu_name
34     name := a_menu_name
35     end
36    
37     feature -- Status setting
38    
39     enable_visible is
40     -- Set `is_visible' to True.
41     local
42     menu_items: like managed_menu_items
43     citem: EB_COMMAND_CHECK_MENU_ITEM
44     do
45     if not is_visible then
46     is_visible := True
47     target.show
48     menu_items := managed_menu_items
49     if menu_items /= Void then
50     from
51     menu_items.start
52     until
53     menu_items.after
54     loop
55     citem := menu_items.item
56     if not citem.is_selected then
57     citem.select_actions.block
58     citem.enable_select
59     citem.select_actions.resume
60     end
61     menu_items.forth
62     end
63     end
64     end
65     end
66    
67     disable_visible is
68     -- Set `is_visible' to True.
69     local
70     menu_items: like managed_menu_items
71     citem: EB_COMMAND_CHECK_MENU_ITEM
72     do
73     if is_visible then
74     menu_items := managed_menu_items
75     if menu_items /= Void then
76     from
77     menu_items.start
78     until
79     menu_items.after
80     loop
81     citem := menu_items.item
82     if citem.is_selected then
83     citem.select_actions.block
84     citem.disable_select
85     citem.select_actions.resume
86     end
87     menu_items.forth
88     end
89     end
90     is_visible := False
91     target.hide
92     end
93     end
94    
95     feature -- Basic operations
96    
97     new_menu_item: EB_COMMAND_CHECK_MENU_ITEM is
98     -- Create a new menu entry for this command.
99     local
100     mname: STRING
101     do
102     -- Add it to the managed menu items
103     if managed_menu_items = Void then
104     create managed_menu_items.make (1)
105     end
106     -- Create the menu item
107     create Result.make (Current)
108 manus 40748 mname := menu_name.twin
109 manus 26913 if accelerator /= Void then
110     mname.append (Tabulation)
111     mname.append (accelerator.out)
112     end
113     Result.set_text (mname)
114     Result.enable_sensitive
115     if is_visible then
116     Result.enable_select
117     else
118     Result.disable_select
119     end
120 julieng 37681 Result.select_actions.extend (agent execute)
121 manus 26913 end
122    
123     feature -- Access
124    
125     menu_name: STRING
126     -- Name as it appears in the menu.
127    
128     name: STRING
129     -- Name for the command.
130    
131     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