eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'UpDownButton':

Home

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

Class: UpDownButton


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--UpDownButton

Package:
stx:libwidg2
Category:
Views-Interactors
Version:
rev: 1.26 date: 2023/07/06 14:35:46
user: cg
file: UpDownButton.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


an up/down button - simply two buttons in one view.
This is also called SpinButton.

copyright

COPYRIGHT (c) 1997 eXept Software AG 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-behavior
o  downAction: aBlock
set the down-action

o  enabled
(comment from inherited method)
views are enabled by default

o  enabled: aBoolean
(comment from inherited method)
this is the basic machanism to enable/disable a view.
empty in this class; redefined by many subclasses

o  upAction: aBlock
set the up-action

accessing-channels
o  backgroundChannel
return a valueHolder for the background color

o  backgroundChannel: aValueHolder
set a valueHolder for the background color

o  enableChannel
return a valueHolder for the enabled-state

o  enableChannel: aValueHolder
set a valueHolder for the enabled-state

o  foregroundChannel
return a valueHolder for the foreground color

o  foregroundChannel: aValueHolder
set a valueHolder for the foreground color

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)

accessing-color & font
o  backgroundColor
return the backgroundColor

o  backgroundColor: aColor
set the backgroundColor

o  foregroundColor
return the foregroundColor

o  foregroundColor: aColor
set the foregroundColor

o  viewBackground: aColor
(comment from inherited method)
set the viewBackground to something, a color, image or form.
If it's a color and we run on a color display, also set shadow and light
colors - this means, that a red view will get light-red and dark-red
edges.

accessing-components
o  downButton
return the downButton

o  upButton
return the upButton

accessing-look
o  orientation
return the orientation (a symbol)

o  orientation: aSymbol
set the orientation (#horizontal or #vertical)

change & update
o  sizeChanged: how from: oldExtentOrNil
my view has changed its size

event handling
o  changeDown: aValue
down button was pressed, send to my model

o  changeUp: aValue
up button was pressed, send to my model

o  keyPress: aKey x: x y: y
simulate a buttonPress/release

focus handling
o  showFocus: explicit
display myself as having-focus

initialization
o  initialize
(comment from inherited method)
must be called if redefined

o  initializeButtonDimensions

o  initializeButtonForms

o  initializeButtons
ArrowButton upIn:self


Examples:


     |top ud|

     top := StandardSystemView new.
     top extent:(300 @ 200).

     ud := UpDownButton in:top.
     ud origin:(10 @ 10).

     ud upAction:[Transcript showCR:'up'].
     ud downAction:[Transcript showCR:'down'].
     top open.
     |top ud|

     top := StandardSystemView new.
     top extent:(300 @ 200).

     ud := UpDownButton in:top.
     ud origin:(10 @ 10).
     ud model:[:arg| Transcript showCR:arg].
     top open.
     |top ud|

     top := StandardSystemView new.
     top extent:(300 @ 200).

     ud := UpDownButton in:top.
     ud orientation:#horizontal.
     ud origin:(10 @ 10).

     ud upAction:[Transcript showCR:'up'].
     ud downAction:[Transcript showCR:'down'].
     top open.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 27 Jul 2024 03:06:31 GMT