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.145 date: 2024/02/25 13:15:50
user: cg
file: ComboView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

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

copyright

COPYRIGHT (c) 1996 by eXept Software AG / 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.

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 sent from the outside if no model/listHolder is used.

accessing-look
o  backgroundColor
(comment from inherited method)
return the background color of the contents -
here, (since there is no contents), the viewBackground is returned.

o  backgroundColor: aColor
(comment from inherited method)
set the background color of the contents -
here, (since there is no contents), the viewBackground is changed.

o  font: aFont
(comment from inherited method)
set the font for drawing if it has changed.
This should be redefined in some widget to perform an automatic
redraw/invalidate. See also: #basicFont:

o  foregroundColor
(comment from inherited method)
return the foreground color of the contents -
here, (since there is no contents), some default is returned.

o  foregroundColor: aColor
(comment from inherited method)
set the foreground color of the contents -
ignored here, since there is no contents.

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
care for buttonpress in my field.
Return true, if I have eaten the event

initialization & release
o  destroy
(comment from inherited method)
unmap & destroy - make me invisible, destroy subviews then
make me unknown to the device

o  initStyle
(comment from inherited method)
this method sets up all style dependent things.
If redefined, make sure that super initStyle is sent

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 must be redefined in concrete classes (subclassResponsibility) **

o  realize
(comment from inherited method)
realize - make visible;
realizing is done very late (after layout is fixed) to avoid
visible rearranging of windows on the screen

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 must be redefined in concrete classes (subclassResponsibility) **

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
yes, I am a comboBox-like widget


Examples:


see examples in ComboListView and ComboBoxView


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Wed, 27 Nov 2024 05:10:00 GMT