|
Class: LabelledEnterField
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--LabelledEnterField
- Package:
- stx:libwidg2
- Category:
- Views-Interactors
- Version:
- rev:
1.24
date: 2018/11/09 23:28:03
- user: cg
- file: LabelledEnterField.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Claus Gittinger
An EnterField with a name. Its protocol mimics that of an
inputfield for the most common cases. However, for access to
some specific things, you have to get the components
(labelField and inputField)
and send those message directly.
accessing
-
inputField
-
return the input field component
-
labelView
-
return the label component
accessing-behavior
-
acceptOnLeave: aBoolean
-
set/clear the acceptOnLeave flag in my inputField. The default is false.
-
enabled
-
return true if enabled - forwarded to the inputField
-
enabled: aBoolean
-
enable/disable - forwarded to the inputField
accessing-look
-
contents
-
-
contents: aString
-
-
editValue
-
-
editValue: something
-
-
label: aString
-
accessing-mvc
-
addModelInterfaceTo: aDictionary
-
-
aspectMessage: aspectSymbol
-
-
changeMessage: aSymbol
-
-
labelMessage: aSymbol
-
-
model: aModel
-
initialization
-
initialize
-
setup; create the label and an enterfield
queries
-
computePreferredExtent
-
return the preferredExtent from the components sizes.
|top panel f1 f2 f3 f4 model data|
data := #('John' 'F' 'Smith' '1234567').
model := Plug new.
model respondTo:#firstName with:[data at:1].
model respondTo:#firstName: with:[:arg | data at:1 put:arg].
model respondTo:#middleInitial with:[data at:2].
model respondTo:#middleInitial: with:[:arg | data at:2 put:arg].
model respondTo:#lastName with:[data at:3].
model respondTo:#lastName: with:[:arg | data at:3 put:arg].
model respondTo:#telNo with:[data at:4].
model respondTo:#telNo: with:[:arg | data at:4 put:arg].
top := StandardSystemView new.
top extent:300@300.
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
panel verticalLayout:#topSpace.
f1 := LabelledEnterField new.
f1 label:'Firstname:'.
f1 aspect:#firstName; change:#firstName:; model:model.
panel add:f1.
f2 := LabelledEnterField new.
f2 label:'Middle Initial:'.
f2 aspect:#middleInitial; change:#middleInitial:; model:model.
panel add:f2.
f3 := LabelledEnterField new.
f3 label:'Lastname:'.
f3 aspect:#lastName; change:#lastName:; model:model.
panel add:f3.
f4 := LabelledEnterField new.
f4 label:'Telephone:'.
f4 aspect:#telNo; change:#telNo:; model:model.
panel add:f4.
top open
|
|