eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SteppingSlider':

Home

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

Class: SteppingSlider


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--ScrollBar
               |
               +--SteppingSlider
                  |
                  +--HorizontalSteppingSlider

Package:
stx:libwidg2
Category:
Views-Interactors
Version:
rev: 1.14 date: 2011/02/05 17:37:29
user: stefan
file: SteppingSlider.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


SteppingSliders are like Sliders, but add step-up and step-down
buttons (which increment/decrement the value).
(you can also think of them as a ScrollBar with a slider instead of
 a scroller as component)


Instance protocol:

accessing
o  model: aModel
set the model - forwarded to the thumb.
if nonNil, this will get the thumbs origin
via #value: messages

o  start: start stop: stop step: step
set start (min), stop (max) and step increment.
The increment is used when clicking on a step button

o  step
return the step increment.
The increment is used when clicking on a step button

o  step: aNumber
same as stepIncrement;
set the value used for stepping (defaults to 1)

o  stepIncrement: aNumber
set the value used for stepping (defaults to 1).
Same as #step: for compatibility.

event handling
o  keyPress: key x: x y: y
enabled ifFalse:[^ self].

initialization
o  createElements
create the scroller and the two step buttons

o  initialize
initialize; the increment is set to 1 (one)

misc
o  doesNotUnderstand: aMessage
forward any unimplemented message to the scroller

private
o  scrollStep: delta
step by some delta

o  scrollStepDown
sent when the step-down button is pressd

o  scrollStepUp
sent when the step-up button is pressd


Examples:


non model operation:
  |top sl|

  top := StandardSystemView extent:200@200.
  sl := SteppingSlider in:top.
  sl origin:(0.0@0.0) corner:(sl width@1.0).
  sl scrollAction:[:pos | Transcript showCR:pos].    
  top open
change the step:
  |top sl|

  top := StandardSystemView extent:200@200.
  sl := SteppingSlider in:top.
  sl origin:(0.0@0.0) corner:(sl width@1.0).
  sl scrollAction:[:pos | Transcript showCR:pos].    
  sl stepIncrement:10.
  top open
model operation (watch the value):
  |model top sl fld|

  model := 0 asValue.

  top := StandardSystemView extent:200@200.
  top label:'slider on model'.
  sl := SteppingSlider in:top.
  sl origin:(0.0@0.0) corner:(sl width@1.0).
  sl model:model.
  top open.

  top := StandardSystemView extent:200@200.
  top label:'inputField on model'.
  fld := EditField in:top.
  fld origin:(0.0@0.0) corner:(1.0 @ fld height).
  fld converter:(PrintConverter new initForNumber); model:model.
  top open
two views on the same model:
  |model top sl fld|

  model := 0 asValue.

  top := StandardSystemView extent:200@200.
  top label:'slider on model'.
  sl := SteppingSlider in:top.
  sl origin:(0.0@0.0) corner:(sl width@1.0).
  sl model:model.
  top open.

  top := StandardSystemView extent:200@200.
  top label:'slider on model'.
  sl := ThumbWheel in:top.
  sl origin:(0.0@0.0) corner:(20@1.0).
  sl model:model.
  top open.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 13:48:44 GMT