|
Class: ComboBoxView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ComboView
|
+--ComboBoxView
|
+--FilenameComboBoxView
|
+--FilenameEditFieldV2
- Package:
- stx:libwidg2
- Category:
- Views-Interactors
- Version:
- rev:
1.38
date: 2018/11/16 23:41:06
- user: cg
- file: ComboBoxView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Claus Gittinger
A ComboBoxView combines an inputField with a drop down list of default inputs;
choosing any from the pulled list presets the string in the field.
In contrast to a PopUpList or ComboListView, the string can still be edited -
the list is actually only a set of values for the convenience of the user.
ComboView
PopUpList
SelectionInListView
ComboListView
ExtendedComboBox
PullDownMenu
Label
EntryField
defaults
-
defaultFont
-
^ SelectionInListView defaultFont.
accessing-components
-
editor
-
return the inputField component
-
menuSelectAction: aBlock
-
accessing-contents
-
emptyFieldReplacementText
-
-
emptyFieldReplacementText: aString
-
accessing-mvc
-
model
-
(comment from inherited method)
return the model, for non-MVC views,
this is nil or the receiver
-
model: aModel
-
(comment from inherited method)
set the model, which is supposed to provide the boxes value.
If a listMessage was defined, it is also responsible for providing
the list
change & update
-
update: something with: aParameter from: changedObject
-
event handling
-
hasKeyboardFocus: aBoolean
-
-
showFocus: explicit
-
-
showNoFocus: explicit
-
initialization
-
editFieldClass
-
-
initializeField
-
all of my input goes to the enterfield
private
-
setFieldsFont: aFont
-
ignored - the inputFields font remains unchanged
queries
-
specClass
-
XXX no longer needed (inherited default works here)
user interaction
-
fieldLeft
-
the edit field was left (via cursor keys or focus change)
-
select: index
-
a menu item (index) was selected
non MVC operation:
|top b|
top := StandardSystemView new.
top extent:(300 @ 200).
b := ComboBoxView in:top.
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
b bottomInset:(b preferredExtent y negated).
b list:#('hello' 'world' 'this' 'is' 'st/x').
top open.
|
with action:
|top b|
top := StandardSystemView new.
top extent:(300 @ 200).
b := ComboBoxView in:top.
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
b bottomInset:(b preferredExtent y negated).
b list:#('hello' 'world' 'this' 'is' 'st/x').
b action:[:entry | Transcript showCR:entry].
top open.
|
model operation:
|model top b|
model := 'foo' asValue.
top := StandardSystemView new.
top extent:(300 @ 200).
b := ComboBoxView in:top.
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
b bottomInset:(b preferredExtent y negated).
b list:#('hello' 'world' 'this' 'is' 'st/x').
b model:model.
top openModal.
Transcript showCR:('comboBox''s value: ' , model value).
|
in a dialog:
|model1 model2 dialog b|
model1 := 'foo' asValue.
model2 := 'bar' asValue.
dialog := Dialog new.
(dialog addTextLabel:'ComboBox example:') adjust:#left.
dialog addVerticalSpace.
(b := dialog addComboBoxOn:model1 tabable:true).
b list:#('fee' 'foe' 'foo').
dialog addVerticalSpace.
(b := dialog addComboBoxOn:model2 tabable:true).
b list:#('bar' 'baz' 'baloo').
dialog addVerticalSpace.
dialog addOkButton.
dialog open.
Transcript showCR:('1st comboBox''s value: ' , model1 value).
Transcript showCR:('2nd comboBox''s value: ' , model2 value).
|
|