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.15 date: 2021/01/20 15:41:17
user: cg
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)

copyright

COPYRIGHT (c) 1994 by 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.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:06:20 GMT