|
Class: ComboBoxView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ComboView
|
+--ComboBoxView
|
+--ComboBoxViewWithCompletion
|
+--FilenameComboBoxView
|
+--FilenameEditFieldV2
- Package:
- stx:libwidg2
- Category:
- Views-Interactors
- Version:
- rev:
1.41
date: 2023/06/15 07:04:56
- user: cg
- file: ComboBoxView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
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.
copyrightCOPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
defaults
-
defaultFont
-
^ SelectionInListView defaultFont.
accessing-components
-
editor
-
return the inputField component
-
entryCompletionBlock: aZeroOneOrTwoArgBlock
-
define an action to be evaluated when Tab (EntryCompletionCharacter) is pressed.
The block gets the current contents and the field itself as optional arguments
(i.e. it can be a 0, 1 or 2-arg block).
-
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
-
(comment from inherited method)
notification from the windowGroup that I got the keyboardFocus.
-
showFocus: explicit
-
(comment from inherited method)
highlight myself somehow to tell user that I have the focus.
If explicit is true, the focus came via focusStepping (i.e. tabbing);
if false, it came via the window manager (i.e. pointer entering).
Only change my border, if this is an explicit focusChange.
-
showNoFocus: explicit
-
(comment from inherited method)
undo the effect of showFocus.
Explicit tells if the focus came via focusStepping (i.e. tabbing)
or via the window manager (i.e. pointer entering).
Only change my border, if this is an explicit focusChange.
initialization
-
editFieldClass
-
-
initializeField
-
all of my input goes to the enterfield
private
-
setFieldsFont: aFont
-
ignored - the inputFields font remains unchanged
queries
-
specClass
-
returns my spec class (for UI editor)
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).
|
|