author | Claus Gittinger <cg@exept.de> |
Tue, 07 May 2019 13:13:22 +0200 | |
changeset 6047 | 80dad68e23a2 |
parent 5964 | 6a75c8a3ad6c |
permissions | -rw-r--r-- |
332 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
3 |
All Rights Reserved |
332 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2108
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
12 |
"{ Package: 'stx:libwidg2' }" |
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
13 |
|
5815 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
16 |
ComboView subclass:#ComboBoxView |
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
17 |
instanceVariableNames:'menuSelectAction' |
2585
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
18 |
classVariableNames:'' |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
19 |
poolDictionaries:'' |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
20 |
category:'Views-Interactors' |
124 | 21 |
! |
22 |
||
275 | 23 |
!ComboBoxView class methodsFor:'documentation'! |
124 | 24 |
|
332 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
28 |
All Rights Reserved |
332 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
! |
|
39 |
||
124 | 40 |
documentation |
41 |
" |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
42 |
A ComboBoxView combines an inputField with a drop down list of default inputs; |
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
43 |
choosing any from the pulled list presets the string in the field. |
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
44 |
|
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
45 |
In contrast to a PopUpList or ComboListView, the string can still be edited - |
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
46 |
the list is actually only a set of values for the convenience of the user. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
47 |
|
275 | 48 |
[author:] |
1281 | 49 |
Claus Gittinger |
181 | 50 |
|
51 |
[see also:] |
|
1281 | 52 |
ComboView |
53 |
PopUpList SelectionInListView |
|
54 |
ComboListView ExtendedComboBox |
|
55 |
PullDownMenu Label EntryField |
|
124 | 56 |
" |
57 |
! |
|
58 |
||
59 |
examples |
|
60 |
" |
|
305 | 61 |
non MVC operation: |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
62 |
[exBegin] |
124 | 63 |
|top b| |
64 |
||
65 |
top := StandardSystemView new. |
|
66 |
top extent:(300 @ 200). |
|
67 |
||
68 |
b := ComboBoxView in:top. |
|
69 |
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0). |
|
70 |
b bottomInset:(b preferredExtent y negated). |
|
71 |
||
72 |
b list:#('hello' 'world' 'this' 'is' 'st/x'). |
|
73 |
top open. |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
74 |
[exEnd] |
124 | 75 |
|
76 |
||
77 |
||
305 | 78 |
with action: |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
79 |
[exBegin] |
305 | 80 |
|top b| |
81 |
||
82 |
top := StandardSystemView new. |
|
83 |
top extent:(300 @ 200). |
|
84 |
||
85 |
b := ComboBoxView in:top. |
|
86 |
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0). |
|
87 |
b bottomInset:(b preferredExtent y negated). |
|
88 |
||
89 |
b list:#('hello' 'world' 'this' 'is' 'st/x'). |
|
90 |
b action:[:entry | Transcript showCR:entry]. |
|
91 |
top open. |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
92 |
[exEnd] |
305 | 93 |
|
94 |
||
95 |
||
124 | 96 |
model operation: |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
97 |
[exBegin] |
124 | 98 |
|model top b| |
99 |
||
100 |
model := 'foo' asValue. |
|
101 |
||
102 |
top := StandardSystemView new. |
|
103 |
top extent:(300 @ 200). |
|
104 |
||
105 |
b := ComboBoxView in:top. |
|
106 |
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0). |
|
107 |
b bottomInset:(b preferredExtent y negated). |
|
108 |
||
109 |
b list:#('hello' 'world' 'this' 'is' 'st/x'). |
|
110 |
b model:model. |
|
111 |
||
112 |
top openModal. |
|
184 | 113 |
Transcript showCR:('comboBox''s value: ' , model value). |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
114 |
[exEnd] |
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
115 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
116 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
117 |
in a dialog: |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
118 |
[exBegin] |
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
119 |
|model1 model2 dialog b| |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
120 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
121 |
model1 := 'foo' asValue. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
122 |
model2 := 'bar' asValue. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
123 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
124 |
dialog := Dialog new. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
125 |
(dialog addTextLabel:'ComboBox example:') adjust:#left. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
126 |
dialog addVerticalSpace. |
124 | 127 |
|
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
128 |
(b := dialog addComboBoxOn:model1 tabable:true). |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
129 |
b list:#('fee' 'foe' 'foo'). |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
130 |
dialog addVerticalSpace. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
131 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
132 |
(b := dialog addComboBoxOn:model2 tabable:true). |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
133 |
b list:#('bar' 'baz' 'baloo'). |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
134 |
dialog addVerticalSpace. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
135 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
136 |
dialog addOkButton. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
137 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
138 |
dialog open. |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
139 |
|
184 | 140 |
Transcript showCR:('1st comboBox''s value: ' , model1 value). |
141 |
Transcript showCR:('2nd comboBox''s value: ' , model2 value). |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
142 |
[exEnd] |
124 | 143 |
" |
144 |
! ! |
|
145 |
||
4637 | 146 |
!ComboBoxView class methodsFor:'defaults'! |
147 |
||
148 |
defaultFont |
|
149 |
^ EditField defaultFont. |
|
150 |
"/ ^ SelectionInListView defaultFont. |
|
151 |
! ! |
|
152 |
||
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
153 |
!ComboBoxView methodsFor:'accessing-components'! |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
154 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
155 |
editor |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
156 |
"return the inputField component" |
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
157 |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
158 |
^ field |
126
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
159 |
|
888d8ccd35af
better sizing; forward unknown messages to my inputField
Claus Gittinger <cg@exept.de>
parents:
125
diff
changeset
|
160 |
"Created: 9.2.1996 / 20:18:03 / cg" |
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
161 |
"Modified: 28.2.1996 / 15:10:50 / cg" |
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
162 |
! |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
163 |
|
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
164 |
menuSelectAction:aBlock |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
165 |
menuSelectAction := aBlock |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
166 |
|
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
167 |
"Created: / 15-10-2006 / 15:10:25 / cg" |
124 | 168 |
! ! |
169 |
||
5922 | 170 |
!ComboBoxView methodsFor:'accessing-contents'! |
171 |
||
172 |
emptyFieldReplacementText |
|
173 |
^ field emptyFieldReplacementText |
|
174 |
! |
|
175 |
||
176 |
emptyFieldReplacementText:aString |
|
177 |
field emptyFieldReplacementText:aString |
|
178 |
! ! |
|
179 |
||
124 | 180 |
!ComboBoxView methodsFor:'accessing-mvc'! |
181 |
||
182 |
model |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
183 |
^ field model |
124 | 184 |
|
185 |
"Created: 9.2.1996 / 00:50:18 / cg" |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
186 |
"Modified: 28.2.1996 / 15:10:59 / cg" |
124 | 187 |
! |
188 |
||
189 |
model:aModel |
|
679
bd0e422aab67
fixed model setting & useIndex: handling (aspect)
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
190 |
super model:aModel. |
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
191 |
field model:aModel. |
124 | 192 |
|
193 |
"Created: 9.2.1996 / 00:50:12 / cg" |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
194 |
"Modified: 28.2.1996 / 15:11:03 / cg" |
124 | 195 |
! ! |
196 |
||
2585
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
197 |
!ComboBoxView methodsFor:'change & update'! |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
198 |
|
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
199 |
update:something with:aParameter from:changedObject |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
200 |
changedObject == field model ifTrue:[ |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
201 |
action notNil ifTrue:[ |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
202 |
action value:(changedObject value) |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
203 |
]. |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
204 |
^ self. |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
205 |
]. |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
206 |
super update:something with:aParameter from:changedObject |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
207 |
! ! |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
208 |
|
1312 | 209 |
!ComboBoxView methodsFor:'event handling'! |
210 |
||
211 |
hasKeyboardFocus:aBoolean |
|
212 |
super hasKeyboardFocus:aBoolean. |
|
213 |
field hasKeyboardFocus:aBoolean |
|
214 |
! |
|
215 |
||
216 |
showFocus:explicit |
|
217 |
super showFocus:explicit. |
|
218 |
field showCursor. |
|
219 |
||
220 |
! |
|
221 |
||
222 |
showNoFocus:explicit |
|
223 |
super showNoFocus:explicit. |
|
224 |
field hideCursor. |
|
225 |
||
226 |
! ! |
|
227 |
||
124 | 228 |
!ComboBoxView methodsFor:'initialization'! |
229 |
||
2108
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
230 |
editFieldClass |
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
231 |
^ EditField |
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
232 |
! |
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
233 |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
234 |
initializeField |
2585
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
235 |
|m| |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
236 |
|
2108
cbba33be6ac0
allow for fields class to be redefined by a subclass
Claus Gittinger <cg@exept.de>
parents:
1312
diff
changeset
|
237 |
field := self editFieldClass in:self. |
519 | 238 |
field borderWidth:0. |
2585
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
239 |
field model:(m := ValueHolder newString). |
eb641403010a
action was not evaluated when the models
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
240 |
m addDependent:self. |
305 | 241 |
field acceptOnLostFocus:true. |
242 |
field acceptOnLeave:true. |
|
3196 | 243 |
field |
244 |
leaveAction:[:key | |
|
245 |
self fieldLeft. |
|
246 |
field handleFocusKey:key. |
|
247 |
]. |
|
124 | 248 |
|
249 |
" |
|
250 |
all of my input goes to the enterfield |
|
251 |
" |
|
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
252 |
self delegate:(KeyboardForwarder toView:field). |
3311
0899e8423c9a
Allow ComboList/Box selection with the mouse wheel
Stefan Vogel <sv@exept.de>
parents:
3196
diff
changeset
|
253 |
field delegate:self. "delegate mouseWheel events to myself" |
4493 | 254 |
field font:self font. |
124 | 255 |
|
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
256 |
menuSelectAction := [:menuValue | field contents:menuValue]. |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
257 |
|
124 | 258 |
" |
259 |
|b| |
|
260 |
||
261 |
b := ComboBoxView new. |
|
262 |
b list:#('hello' 'world' 'this' 'is' 'st/x'). |
|
263 |
b open |
|
264 |
" |
|
265 |
||
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
266 |
"Created: / 28-02-1996 / 15:07:51 / cg" |
3196 | 267 |
"Modified: / 06-03-2007 / 20:19:32 / cg" |
124 | 268 |
! ! |
269 |
||
1183
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
270 |
!ComboBoxView methodsFor:'private'! |
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
271 |
|
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
272 |
setFieldsFont:aFont |
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
273 |
"ignored - the inputFields font remains unchanged" |
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
274 |
! ! |
667132091c2f
ComboBox's inputField ought to use its default font.
Claus Gittinger <cg@exept.de>
parents:
679
diff
changeset
|
275 |
|
291 | 276 |
!ComboBoxView methodsFor:'queries'! |
277 |
||
278 |
specClass |
|
597 | 279 |
"XXX no longer needed (inherited default works here)" |
280 |
||
291 | 281 |
self class == ComboBoxView ifTrue:[ |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
282 |
^ ComboBoxSpec |
291 | 283 |
]. |
301 | 284 |
^ super specClass |
285 |
||
597 | 286 |
"Modified: / 31.10.1997 / 19:49:39 / cg" |
291 | 287 |
! ! |
288 |
||
124 | 289 |
!ComboBoxView methodsFor:'user interaction'! |
290 |
||
311 | 291 |
fieldLeft |
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
292 |
"the edit field was left (via cursor keys or focus change)" |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
293 |
|
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
294 |
field acceptOnLeave ifTrue:[ |
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
295 |
field accept. |
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
296 |
action notNil ifTrue:[ |
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
297 |
action value:(field contents) |
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
298 |
]. |
311 | 299 |
|
300 |
]. |
|
301 |
||
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
302 |
"Created: / 26-02-1997 / 19:42:30 / cg" |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
303 |
"Modified: / 15-10-2006 / 15:20:14 / cg" |
311 | 304 |
! |
305 |
||
306 |
select:index |
|
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
307 |
"a menu item (index) was selected" |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
308 |
|
230 | 309 |
|what| |
310 |
||
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
311 |
pullDownButton turnOff. |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
312 |
|
5964 | 313 |
what := list atIndex:index. |
3311
0899e8423c9a
Allow ComboList/Box selection with the mouse wheel
Stefan Vogel <sv@exept.de>
parents:
3196
diff
changeset
|
314 |
currentIndex := index. |
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
315 |
|
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
316 |
menuSelectAction value:what. |
130
5cad43b11fb5
inserted abstract ComboView class
Claus Gittinger <cg@exept.de>
parents:
127
diff
changeset
|
317 |
field accept. |
3534
9b243b355789
Update through pulldown now Works with EditField V1.196
Stefan Vogel <sv@exept.de>
parents:
3491
diff
changeset
|
318 |
|
305 | 319 |
action notNil ifTrue:[ |
2114
40cfff7c7efc
acceptIfUnchanged fixed (implemented)
Claus Gittinger <cg@exept.de>
parents:
2108
diff
changeset
|
320 |
action value:what |
305 | 321 |
]. |
322 |
||
3124
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
323 |
"Created: / 28-02-1997 / 14:01:53 / cg" |
3060c3f4246d
added a hook for the menu-select-action
Claus Gittinger <cg@exept.de>
parents:
2585
diff
changeset
|
324 |
"Modified: / 15-10-2006 / 15:19:53 / cg" |
5964 | 325 |
"Modified: / 16-11-2018 / 18:56:08 / Claus Gittinger" |
124 | 326 |
! ! |
327 |
||
275 | 328 |
!ComboBoxView class methodsFor:'documentation'! |
124 | 329 |
|
330 |
version |
|
5815 | 331 |
^ '$Header$' |
124 | 332 |
! ! |
4493 | 333 |