eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'LabelledEnterField':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: LabelledEnterField


Inheritance:

   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

Description:


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.


Instance protocol:

accessing
o  inputField
return the input field component

o  labelView
return the label component

accessing-behavior
o  acceptOnLeave: aBoolean
set/clear the acceptOnLeave flag in my inputField. The default is false.

o  enabled
return true if enabled - forwarded to the inputField

o  enabled: aBoolean
enable/disable - forwarded to the inputField

accessing-look
o  contents

o  contents: aString

o  editValue

o  editValue: something

o  label: aString

accessing-mvc
o  addModelInterfaceTo: aDictionary

o  aspectMessage: aspectSymbol

o  changeMessage: aSymbol

o  labelMessage: aSymbol

o  model: aModel

initialization
o  initialize
setup; create the label and an enterfield

queries
o  computePreferredExtent
return the preferredExtent from the components sizes.


Examples:


    |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


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Mon, 26 Feb 2024 14:08:13 GMT