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

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