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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 4 months ago) by larryl
File size: 4543 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Simple toolbarable and menuable command.%
3 %When using it, do not forget to define all the standardized fields"
4 legal: "See notice at end of class."
5 status: "See notice at end of class."
6 author: "Xavier Rousselot"
7 date: "$Date$"
8 revision: "$Revision$"
9
10 class
11 EB_STANDARD_CMD
12
13 inherit
14 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
15 redefine
16 mini_pixmap,
17 tooltext
18 end
19
20 EB_RECYCLABLE
21
22 create
23 make
24
25 feature -- Initialization
26
27 make is
28 -- Initialize `Current'.
29 do
30 create execute_agents.make
31 name := "Default_command_name_Please_change_it"
32 end
33
34 feature -- Access
35
36 execute_agents: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
37 -- Agents that are called when `Current' is executed.
38
39 pixmap: EV_PIXMAP
40 -- Icon for tool bar button representing `Current'.
41
42 pixel_buffer: EV_PIXEL_BUFFER
43 -- Icon for tool bar button representing `Current'.
44
45 mini_pixmap: EV_PIXMAP
46 -- Icon for mini tool bar button representing `Current'.
47
48 tooltip: STRING
49 -- Help text displayed when associated buttons are focused.
50
51 tooltext: STRING
52 -- Text displayed on toolbar button.
53
54 description: STRING
55 -- Help text displayed in the customize tool bar dialog.
56
57 menu_name: STRING
58 -- Menu entry corresponding to `Current'.
59
60 name: STRING
61 -- Internal string identifier of `Current'.
62
63 feature -- Status setting
64
65 set_pixmap (new_p: EV_PIXMAP) is
66 -- Define pixmap associated with `Current'.
67 require
68 new_p_non_void: new_p /= Void
69 do
70 pixmap := new_p
71 end
72
73 set_pixel_buffer (a_buffer: EV_PIXEL_BUFFER) is
74 -- Define pixel buffer associated with `Current'.
75 require
76 a_buffer_not_void: a_buffer /= Void
77 do
78 pixel_buffer := a_buffer
79 end
80
81 set_tooltip (s: STRING) is
82 -- Define a new tooltip for `Current', and possibly a new description.
83 do
84 tooltip := s
85 if description = Void then
86 description := s
87 end
88 end
89
90 set_tooltext (s: STRING) is
91 -- Define a new tooltext for `Current' that is displayed
92 do
93 tooltext := s
94 end
95
96 set_description (s: STRING) is
97 -- Define a new description for `Current', and possibly a new tooltip.
98 do
99 description := s
100 if tooltip = Void then
101 tooltip := s
102 end
103 end
104
105 set_accelerator (acc: EV_ACCELERATOR) is
106 -- Define an accelerator for `Current'.
107 do
108 accelerator := acc
109 if accelerator.actions.is_empty then
110 accelerator.actions.extend (agent execute)
111 end
112 end
113
114 set_menu_name (s: STRING) is
115 -- Define a new menu name for `Current'.
116 do
117 menu_name := s
118 end
119
120 set_name (s: STRING) is
121 -- Define a new name for `Current'.
122 do
123 name := s
124 end
125
126 add_agent (a: PROCEDURE [ANY, TUPLE]) is
127 -- Extend `execute_agents' with `a'.
128 do
129 execute_agents.extend (a)
130 end
131
132 set_mini_pixmap (p: EV_PIXMAP) is
133 -- Define the pixmap displayed on mini buttons associated to `Current'.
134 do
135 mini_pixmap := p
136 end
137
138 feature -- Basic operations
139
140 execute is
141 -- Call all agents associated with `Current'.
142 do
143 from
144 execute_agents.start
145 until
146 execute_agents.after
147 loop
148 execute_agents.item.call (Void)
149 execute_agents.forth
150 end
151 end
152
153 feature -- Recyclable
154
155 recycle is
156 -- Recycle
157 do
158 execute_agents.wipe_out
159 end
160
161 indexing
162 copyright: "Copyright (c) 1984-2006, Eiffel Software"
163 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
164 licensing_options: "http://www.eiffel.com/licensing"
165 copying: "[
166 This file is part of Eiffel Software's Eiffel Development Environment.
167
168 Eiffel Software's Eiffel Development Environment is free
169 software; you can redistribute it and/or modify it under
170 the terms of the GNU General Public License as published
171 by the Free Software Foundation, version 2 of the License
172 (available at the URL listed under "license" above).
173
174 Eiffel Software's Eiffel Development Environment is
175 distributed in the hope that it will be useful, but
176 WITHOUT ANY WARRANTY; without even the implied warranty
177 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
178 See the GNU General Public License for more details.
179
180 You should have received a copy of the GNU General Public
181 License along with Eiffel Software's Eiffel Development
182 Environment; if not, write to the Free Software Foundation,
183 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
184 ]"
185 source: "[
186 Eiffel Software
187 356 Storke Road, Goleta, CA 93117 USA
188 Telephone 805-685-1006, Fax 805-685-6869
189 Website http://www.eiffel.com
190 Customer support http://support.eiffel.com
191 ]"
192
193 end -- class EB_STANDARD_CMD

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23