/[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 61980 - (show annotations)
Sun Jul 30 06:07:28 2006 UTC (13 years, 5 months ago) by manus
File size: 4265 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
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 mini_pixmap: EV_PIXMAP
43 -- Icon for mini tool bar button representing `Current'.
44
45 tooltip: STRING
46 -- Help text displayed when associated buttons are focused.
47
48 tooltext: STRING
49 -- Text displayed on toolbar button.
50
51 description: STRING
52 -- Help text displayed in the customize tool bar dialog.
53
54 menu_name: STRING
55 -- Menu entry corresponding to `Current'.
56
57 name: STRING
58 -- Internal string identifier of `Current'.
59
60 feature -- Status setting
61
62 set_pixmap (new_p: EV_PIXMAP) is
63 -- Define pixmap associated with `Current'.
64 require
65 new_p_non_void: new_p /= Void
66 do
67 pixmap := new_p
68 end
69
70 set_tooltip (s: STRING) is
71 -- Define a new tooltip for `Current', and possibly a new description.
72 do
73 tooltip := s
74 if description = Void then
75 description := s
76 end
77 end
78
79 set_tooltext (s: STRING) is
80 -- Define a new tooltext for `Current' that is displayed
81 do
82 tooltext := s
83 end
84
85 set_description (s: STRING) is
86 -- Define a new description for `Current', and possibly a new tooltip.
87 do
88 description := s
89 if tooltip = Void then
90 tooltip := s
91 end
92 end
93
94 set_accelerator (acc: EV_ACCELERATOR) is
95 -- Define an accelerator for `Current'.
96 do
97 accelerator := acc
98 if accelerator.actions.is_empty then
99 accelerator.actions.extend (agent execute)
100 end
101 end
102
103 set_menu_name (s: STRING) is
104 -- Define a new menu name for `Current'.
105 do
106 menu_name := s
107 end
108
109 set_name (s: STRING) is
110 -- Define a new name for `Current'.
111 do
112 name := s
113 end
114
115 add_agent (a: PROCEDURE [ANY, TUPLE]) is
116 -- Extend `execute_agents' with `a'.
117 do
118 execute_agents.extend (a)
119 end
120
121 set_mini_pixmap (p: EV_PIXMAP) is
122 -- Define the pixmap displayed on mini buttons associated to `Current'.
123 do
124 mini_pixmap := p
125 end
126
127 feature -- Basic operations
128
129 execute is
130 -- Call all agents associated with `Current'.
131 do
132 from
133 execute_agents.start
134 until
135 execute_agents.after
136 loop
137 execute_agents.item.call (Void)
138 execute_agents.forth
139 end
140 end
141
142 feature -- Recyclable
143
144 recycle is
145 -- Recycle
146 do
147 execute_agents.wipe_out
148 end
149
150 indexing
151 copyright: "Copyright (c) 1984-2006, Eiffel Software"
152 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
153 licensing_options: "http://www.eiffel.com/licensing"
154 copying: "[
155 This file is part of Eiffel Software's Eiffel Development Environment.
156
157 Eiffel Software's Eiffel Development Environment is free
158 software; you can redistribute it and/or modify it under
159 the terms of the GNU General Public License as published
160 by the Free Software Foundation, version 2 of the License
161 (available at the URL listed under "license" above).
162
163 Eiffel Software's Eiffel Development Environment is
164 distributed in the hope that it will be useful, but
165 WITHOUT ANY WARRANTY; without even the implied warranty
166 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
167 See the GNU General Public License for more details.
168
169 You should have received a copy of the GNU General Public
170 License along with Eiffel Software's Eiffel Development
171 Environment; if not, write to the Free Software Foundation,
172 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
173 ]"
174 source: "[
175 Eiffel Software
176 356 Storke Road, Goleta, CA 93117 USA
177 Telephone 805-685-1006, Fax 805-685-6869
178 Website http://www.eiffel.com
179 Customer support http://support.eiffel.com
180 ]"
181
182 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