eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ComboBoxView':

Home

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

Class: ComboBoxView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ComboView
                  |
                  +--ComboBoxView
                     |
                     +--FilenameComboBoxView
                     |
                     +--FilenameEditFieldV2

Package:
stx:libwidg2
Category:
Views-Interactors
Version:
rev: 1.38 date: 2018/11/16 23:41:06
user: cg
file: ComboBoxView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Gittinger

Description:


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.


Related information:

    ComboView
    PopUpList
    SelectionInListView
    ComboListView
    ExtendedComboBox
    PullDownMenu
    Label
    EntryField

Class protocol:

defaults
o  defaultFont
^ SelectionInListView defaultFont.


Instance protocol:

accessing-components
o  editor
return the inputField component

o  menuSelectAction: aBlock

accessing-contents
o  emptyFieldReplacementText

o  emptyFieldReplacementText: aString

accessing-mvc
o  model
(comment from inherited method)
return the model, for non-MVC views,
this is nil or the receiver

o  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
o  update: something with: aParameter from: changedObject

event handling
o  hasKeyboardFocus: aBoolean

o  showFocus: explicit

o  showNoFocus: explicit

initialization
o  editFieldClass

o  initializeField
all of my input goes to the enterfield

private
o  setFieldsFont: aFont
ignored - the inputFields font remains unchanged

queries
o  specClass
XXX no longer needed (inherited default works here)

user interaction
o  fieldLeft
the edit field was left (via cursor keys or focus change)

o  select: index
a menu item (index) was selected


Examples:


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


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 28 Mar 2024 22:47:47 GMT