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.25 date: 2021/01/20 14:40:04
user: cg
file: LabelledEnterField.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

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.

copyright

COPYRIGHT (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.

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
(comment from inherited method)
set the view's label.
Ignored here.

accessing-mvc
o  addModelInterfaceTo: aDictionary
(comment from inherited method)
this adds entries for all messages sent to my model
to aDictionary

o  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.

o  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.

o  labelMessage: aSymbol

o  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
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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 27 Jul 2024 08:59:44 GMT