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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_radio_command_feedback.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: 4700 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Command linked with a menu and a radio tool bar button."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 author: "Christophe Bonnard"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 deferred class
10 EB_RADIO_COMMAND_FEEDBACK
11
12 inherit
13 EB_COMMAND_FEEDBACK
14 redefine
15 button,
16 sd_button,
17 menu_item
18 end
19
20 feature -- Status setting
21
22 enable_select is
23 -- Set both `button' and `menu_entry'
24 -- to be selected.
25 do
26 if button /= Void then
27 button.select_actions.block
28 button.enable_select
29 button.select_actions.resume
30 end
31 if sd_button /= Void then
32 sd_button.select_actions.block
33 sd_button.enable_select
34 sd_button.select_actions.resume
35 end
36 if menu_item /= Void then
37 menu_item.select_actions.block
38 menu_item.enable_select
39 menu_item.select_actions.resume
40 end
41 if
42 combo /= Void and then
43 (combo.text.is_empty or else
44 not combo.text.is_equal(capital_command_name))
45 then
46 combo.change_actions.block
47 combo.set_text (capital_command_name)
48 combo.change_actions.resume
49 end
50 ensure
51 button_selected: not safety_flag and button /= Void implies button.is_selected
52 menu_selected: not safety_flag and menu_item /= Void implies menu_item.is_selected
53 combo_updated: not safety_flag and combo /= Void implies combo.text.is_equal (capital_command_name)
54 end
55
56 feature -- Interface
57
58 command_name: STRING is
59 -- Name of current command throughout the interface (in lower case).
60 deferred
61 ensure
62 valid_result: valid_string (Result)
63 lower_case: is_lower_case (Result)
64 end
65
66 capital_command_name: STRING
67 -- Name of current command throughout the interface (in lower case, but the first letter).
68
69 menu_name: STRING is
70 -- String representation in the associated menu.
71 deferred
72 ensure
73 valid_result: Result /= Void
74 end
75
76 feature -- Status setting
77
78 set_combo_box (a_combo: EV_COMBO_BOX) is
79 -- Set `combo' to `a_combo'.
80 do
81 combo := a_combo
82 end
83
84 feature -- Access
85
86 button: EV_TOOL_BAR_RADIO_BUTTON
87 -- Button on the toolbar.
88
89 sd_button: SD_TOOL_BAR_RADIO_BUTTON
90 -- Button on the toolbar.
91
92 menu_item: EV_RADIO_MENU_ITEM
93 -- Menu entry in the menu.
94
95 combo: EV_COMBO_BOX
96 -- Combo box giving a choice between several radio commands.
97
98 selected: BOOLEAN is
99 -- Is current command selected?
100 do
101 if button /= Void then
102 Result := button.is_selected
103 elseif menu_item /= Void then
104 Result := menu_item.is_selected
105 elseif combo /= Void then
106 Result := combo.text.is_equal (capital_command_name)
107 end
108 end
109
110 feature -- Implementation
111
112 valid_string (str: STRING): BOOLEAN is
113 -- Is `str' neither Void nor empty nor filled with blanks?
114 --| Cannot be in a non exported part because post conditions use it.
115 local
116 blank_string: STRING
117 do
118 if str /= Void and then not str.is_equal ("") then
119 create blank_string.make (str.count)
120 blank_string.fill_blank
121 Result := not str.is_equal (blank_string)
122 end
123 end
124
125 is_lower_case (str: STRING): BOOLEAN is
126 -- Is `str' lower case?
127 --| Cannot be in a non exported part because post conditions use it.
128 do
129 Result := str.as_lower.is_equal (str)
130 end
131
132 feature {NONE} -- Implementation
133
134 safety_flag: BOOLEAN;
135 -- Are we modifying the select status? (to prevent stack overflows)
136
137 indexing
138 copyright: "Copyright (c) 1984-2006, Eiffel Software"
139 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
140 licensing_options: "http://www.eiffel.com/licensing"
141 copying: "[
142 This file is part of Eiffel Software's Eiffel Development Environment.
143
144 Eiffel Software's Eiffel Development Environment is free
145 software; you can redistribute it and/or modify it under
146 the terms of the GNU General Public License as published
147 by the Free Software Foundation, version 2 of the License
148 (available at the URL listed under "license" above).
149
150 Eiffel Software's Eiffel Development Environment is
151 distributed in the hope that it will be useful, but
152 WITHOUT ANY WARRANTY; without even the implied warranty
153 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
154 See the GNU General Public License for more details.
155
156 You should have received a copy of the GNU General Public
157 License along with Eiffel Software's Eiffel Development
158 Environment; if not, write to the Free Software Foundation,
159 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
160 ]"
161 source: "[
162 Eiffel Software
163 356 Storke Road, Goleta, CA 93117 USA
164 Telephone 805-685-1006, Fax 805-685-6869
165 Website http://www.eiffel.com
166 Customer support http://support.eiffel.com
167 ]"
168
169 end -- class EB_RADIO_COMMAND_FEEDBACK

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23