|
Class: LabelledEnterField
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--LabelledEnterField
- Package:
- stx:libwidg2
- Category:
- Views-Interactors
- Version:
- rev:
1.25
date: 2021/01/20 14:40:04
- user: cg
- file: LabelledEnterField.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
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.
copyrightCOPYRIGHT (c) 1991 by 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.
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
-
(comment from inherited method)
set the view's label.
Ignored here.
accessing-mvc
-
addModelInterfaceTo: aDictionary
-
(comment from inherited method)
this adds entries for all messages sent to my model
to aDictionary
-
aspectMessage: aspectSymbol
-
(comment from inherited method)
ST-80 style updating: If a view's aspectSymbol is nonNil,
it will respond to changes of this aspect from the model.
-
changeMessage: aSymbol
-
(comment from inherited method)
ST-80 style change notification: If a view's changeSymbol is nonNil,
it will send it to its model when something changes.
This is the same as change: which was added for ST-80 compatibility.
-
labelMessage: aSymbol
-
-
model: aModel
-
(comment from inherited method)
Set the model.
Here, if I am my own menuPerformer/menuHolder,
set the menuHolder and menuPerformer to the model.
This is a compatibility kludge,
since typically, ST-80 code expects the model to provide a menu
and perform it. If the model does not support a menu message,
it will be forwarded to the view.
Those apps which want the view to provide the (default) menu have to reset
this by sending #menuHolder: message (again)
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
|
|