eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ToggleController':

Home

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

Class: ToggleController


Inheritance:

   Object
   |
   +--Controller
      |
      +--ButtonController
         |
         +--ToggleController
            |
            +--RadioButtonController

Package:
stx:libwidg
Category:
Interface-Support-Controllers
Version:
rev: 1.17 date: 2017/02/13 19:45:41
user: cg
file: ToggleController.st directory: libwidg
module: stx stc-classLibrary: libwidg
Author:
Claus Gittinger

Description:


ToggleControllers redefine some of ButtonControllers behavior;
user interaction: they always triggerOnDown, and ignore buttonrelease.
Finally, every buttonPress leads to a toggle action.

ToggleController adds another actionBlock, since it inherits press-
and releaseActions, while we want one actionBlock to be used for both
on- and off. The actionBlock (if any) is evaluated with the current
toggles state if it expects an argument, or without argument if it's a no-arg
block.

Other than that, all model relations are inherited - i.e. if the view has a model,
that one gets change-messages and the toggle updates on aspect changes.


Instance protocol:

accessing
o  action: aBlock
set the action to be performed. This is called
with the toggles state as argument.

events
o  keyPress: key x: x y: y
toggle on space

o  performAction
the toggle changed its state; first tell the model and
channels, then evaluate any (optional) press/release actions,
finally evaluate my real action, the toggle action.
Individual press/release actions are usually nil for toggles.

initialization
o  initialize
must be called if redefined



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 16 Apr 2021 12:08:12 GMT