eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ComboView':

Home

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

Class: ComboView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ComboView
                  |
                  +--ComboBoxView
                  |
                  +--ComboListView

Package:
stx:libwidg2
Category:
Views-Interactors
Version:
rev: 1.138 date: 2019/08/15 09:44:29
user: cg
file: ComboView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Gittinger

Description:


A ComboView combines some field (typically an enterField or Label)
with a drop down list of default inputs;
ComboView is abstract, providing protocol common to ComboBoxView and
ComboListView. See documentation & examples there.


[instance variables:]
    currentIndex    Integer     index into the list, that is currently selected


Related information:

    PopUpList
    ComboListView
    ComboBoxView
    ExtendedComboBox
    PullDownMenu
    Label
    EntryField

Class protocol:

defaults
o  activeForm

o  buttonForm
return the pull-buttons image

o  comboButtonFor: aComboView

o  defaultFont
for now - should come from the styleSheet

usage example(s):

^ SelectionInListView defaultFont.

o  defaultListMessage

o  disabledForm

o  enteredForm

o  updateStyleCache
flush the forms cache

image specs
o  defaultButtonForm
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self defaultButtonForm inspect
     ImageEditor openOnClass:self andSelector:#defaultButtonForm
     Icon flushCachedIcons

private
o  formForKey: key styleFormKey: styleFormKey styleFilenameKey: styleFilenameKey

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

accessing-behavior
o  action: aBlock
specify, a block, which is evaluated when the lists selection changes.
This is an additional hook - normally, you would communicate with the model
alone

o  enabled
return true, if it is enabled

o  enabled: aBoolean
enable/disable components

o  resizableMenu
return true, if the menu is to be resizable.
This feature is as yet unimplemented.

o  resizableMenu: aBoolean
enable/disable, if the menu is to be resizable.
This feature is as yet unimplemented.

accessing-channels
o  enableChannel
return a valueHolder for enable/disable

accessing-components
o  field
return the field (input or label) component.
For knowledgable users only.

o  menuButton
return the menuButton component

o  shownMenu
returns the currently shown menu, or nil.
(only valid while the menu is pulled)

accessing-contents
o  contents
get the contents of my field

o  contents: something
set the contents of my field; questionable

o  list
return the list

o  list: aList
set the list explicitely; used internally or
to be send from the outside if no model/listHolder is used.

accessing-look
o  backgroundColor

o  backgroundColor: aColor

o  font: aFont

o  foregroundColor

o  foregroundColor: aColor

accessing-mvc
o  comboMenuHolder

o  comboMenuHolder: aMenuHolder
allows for arbitrary menus to be opened via the combo button

o  comboMenuHolder: aMenuHolder comboMenuMessage: aSelectorToTheHolder
allows for arbitrary menus to be opened via the combo button

o  comboMenuMessage

o  comboMenuMessage: aSelectorToTheHolder
allows for arbitrary menus to be opened via the combo button

o  currentIndex

o  listHolder: aValueHolder
set the listHolder.
If not set, the list is supposed to be set explicitely

o  listMessage: aSymbol
define the message selector sent to the model, to fetch
the list. If not defined, #list is used

o  model: aModel
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  enableStateChanged
the enable state has changed - pass this to my field and pullDownButton

o  handlesMouseWheelMotion: event inView: aView
we handle delegated mousewheel events

o  keyPress: key x: x y: y
pull the menu on space and return keys

o  mouseWheelMotion: buttonState x: x y: y amount: amount deltaTime: dTime view: delegatingView
scroll through the list items

o  processEvent: anEvent
only care for buttonpress in my field...

initialization & release
o  destroy

o  initStyle

o  initialize
what a hack...

o  initializeButton

o  initializeField
concrete subclass is responsible to instantiate
a field widget here.
For comboList, this will be a label;
for comboBox, this will be an editfield

** This method raises an error - it must be redefined in concrete classes **

o  realize

o  release

menu interaction
o  createPullDownMenuForList: aList
pull the menu - triggered from the button

o  deltaSelect: delta
change selection by delta. Wrap at start/end

o  pullMenu
pull the menu - triggered from the button
returns false if the menu cannot be opened

o  select: anIndex
sent from the popped menu, when an item was selected

** This method raises an error - it must be redefined in concrete classes **

message delegation
o  doesNotUnderstand: aMessage
delegate to my field

o  flash
delegate to my field

o  flash: messageOrNil withColor: flashColor
delegate to my field

o  respondsTo: aSymbol
return true, if the receiver responds to a message.
Possibly delegated to my field

private
o  getListFromModel
fetch the list - either from the listHolder, or
from the model. If no listMessage was defined, fetch it
using #list.

o  getValueFromModel

o  setFieldsFont: aFont

queries
o  computePreferredExtent
compute & return the boxes preferredExtent from the components' preferrences

testing
o  isComboView


Examples:


see examples in ComboListView and ComboBoxView

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