SteppingSlider.st
author Stefan Vogel <sv@exept.de>
Wed, 25 Jul 2001 19:55:35 +0200
changeset 1982 7e268ddd2ab2
parent 1470 1e262f28a5a6
child 2129 811701a228c5
permissions -rw-r--r--
Fix up/down kuddelmuddel.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     1
"
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
49
claus
parents: 23
diff changeset
     3
	      All Rights Reserved
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     4
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1e6bf473d863 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    11
"
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    12
1982
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
    13
"{ Package: 'stx:libwidg2' }"
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
    14
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    15
ScrollBar subclass:#SteppingSlider
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    16
	instanceVariableNames:'stepIncrement'
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    17
	classVariableNames:''
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    18
	poolDictionaries:''
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    19
	category:'Views-Interactors'
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    20
!
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    21
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    22
!SteppingSlider class methodsFor:'documentation'!
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    24
copyright
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    25
"
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    26
 COPYRIGHT (c) 1994 by Claus Gittinger
49
claus
parents: 23
diff changeset
    27
	      All Rights Reserved
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    28
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    29
 This software is furnished under a license and may be used
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    34
 hereby transferred.
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    35
"
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    36
!
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    37
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    38
documentation
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    39
"
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    40
    SteppingSliders are like Sliders, but add step-up and step-down
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    41
    buttons (which increment/decrement the value).
57
claus
parents: 49
diff changeset
    42
    (you can also think of them as a ScrollBar with a slider instead of
claus
parents: 49
diff changeset
    43
     a scroller as component)
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    44
"
49
claus
parents: 23
diff changeset
    45
!
claus
parents: 23
diff changeset
    46
claus
parents: 23
diff changeset
    47
examples 
claus
parents: 23
diff changeset
    48
"
claus
parents: 23
diff changeset
    49
    non model operation:
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    50
                                                                [exBegin]
49
claus
parents: 23
diff changeset
    51
      |top sl|
claus
parents: 23
diff changeset
    52
claus
parents: 23
diff changeset
    53
      top := StandardSystemView extent:200@200.
claus
parents: 23
diff changeset
    54
      sl := SteppingSlider in:top.
claus
parents: 23
diff changeset
    55
      sl origin:(0.0@0.0) corner:(sl width@1.0).
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    56
      sl scrollAction:[:pos | Transcript showCR:pos].    
49
claus
parents: 23
diff changeset
    57
      top open
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    58
                                                                [exEnd]
49
claus
parents: 23
diff changeset
    59
claus
parents: 23
diff changeset
    60
57
claus
parents: 49
diff changeset
    61
    change the step:
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    62
                                                                [exBegin]
57
claus
parents: 49
diff changeset
    63
      |top sl|
49
claus
parents: 23
diff changeset
    64
claus
parents: 23
diff changeset
    65
      top := StandardSystemView extent:200@200.
claus
parents: 23
diff changeset
    66
      sl := SteppingSlider in:top.
claus
parents: 23
diff changeset
    67
      sl origin:(0.0@0.0) corner:(sl width@1.0).
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    68
      sl scrollAction:[:pos | Transcript showCR:pos].    
57
claus
parents: 49
diff changeset
    69
      sl stepIncrement:10.
claus
parents: 49
diff changeset
    70
      top open
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    71
                                                                [exEnd]
57
claus
parents: 49
diff changeset
    72
claus
parents: 49
diff changeset
    73
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    74
    model operation (watch the value):
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    75
                                                                [exBegin]
57
claus
parents: 49
diff changeset
    76
      |model top sl fld|
claus
parents: 49
diff changeset
    77
claus
parents: 49
diff changeset
    78
      model := 0 asValue.
claus
parents: 49
diff changeset
    79
claus
parents: 49
diff changeset
    80
      top := StandardSystemView extent:200@200.
claus
parents: 49
diff changeset
    81
      top label:'slider on model'.
claus
parents: 49
diff changeset
    82
      sl := SteppingSlider in:top.
claus
parents: 49
diff changeset
    83
      sl origin:(0.0@0.0) corner:(sl width@1.0).
49
claus
parents: 23
diff changeset
    84
      sl model:model.
57
claus
parents: 49
diff changeset
    85
      top open.
claus
parents: 49
diff changeset
    86
claus
parents: 49
diff changeset
    87
      top := StandardSystemView extent:200@200.
claus
parents: 49
diff changeset
    88
      top label:'inputField on model'.
claus
parents: 49
diff changeset
    89
      fld := EditField in:top.
claus
parents: 49
diff changeset
    90
      fld origin:(0.0@0.0) corner:(1.0 @ fld height).
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    91
      fld converter:(PrintConverter new initForNumber); model:model.
49
claus
parents: 23
diff changeset
    92
      top open
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    93
                                                                [exEnd]
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    94
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
    95
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    96
    two views on the same model:
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    97
                                                                [exBegin]
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    98
      |model top sl fld|
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    99
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   100
      model := 0 asValue.
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   101
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   102
      top := StandardSystemView extent:200@200.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   103
      top label:'slider on model'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   104
      sl := SteppingSlider in:top.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   105
      sl origin:(0.0@0.0) corner:(sl width@1.0).
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   106
      sl model:model.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   107
      top open.
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   108
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   109
      top := StandardSystemView extent:200@200.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   110
      top label:'slider on model'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   111
      sl := ThumbWheel in:top.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   112
      sl origin:(0.0@0.0) corner:(20@1.0).
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   113
      sl model:model.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   114
      top open.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   115
                                                                [exEnd]
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   116
"
49
claus
parents: 23
diff changeset
   117
! !
claus
parents: 23
diff changeset
   118
claus
parents: 23
diff changeset
   119
!SteppingSlider methodsFor:'accessing'!
claus
parents: 23
diff changeset
   120
claus
parents: 23
diff changeset
   121
model:aModel
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   122
    "set the model - forwarded to the thumb.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   123
     if nonNil, this will get the thumbs origin
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   124
     via #value: messages"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   125
49
claus
parents: 23
diff changeset
   126
    thumb model:aModel
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   127
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   128
    "Modified: 28.5.1997 / 15:07:55 / cg"
57
claus
parents: 49
diff changeset
   129
!
claus
parents: 49
diff changeset
   130
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   131
start:start stop:stop step:step
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   132
    "set start (min), stop (max) and step increment.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   133
     The increment is used when clicking on a step button"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   134
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   135
    thumb start:start stop:stop.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   136
    stepIncrement := step
57
claus
parents: 49
diff changeset
   137
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   138
    "Modified: 28.5.1997 / 15:03:56 / cg"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   139
!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   140
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   141
step
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   142
    "return the step increment.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   143
     The increment is used when clicking on a step button"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   144
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   145
    ^ stepIncrement
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   146
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   147
    "Modified: 28.5.1997 / 15:04:01 / cg"
65
claus
parents: 57
diff changeset
   148
!
claus
parents: 57
diff changeset
   149
claus
parents: 57
diff changeset
   150
step:aNumber
claus
parents: 57
diff changeset
   151
    "same as stepIncrement;
claus
parents: 57
diff changeset
   152
     set the value used for stepping (defaults to 1)"
claus
parents: 57
diff changeset
   153
claus
parents: 57
diff changeset
   154
    stepIncrement := aNumber
claus
parents: 57
diff changeset
   155
!
claus
parents: 57
diff changeset
   156
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   157
stepIncrement:aNumber 
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   158
    "set the value used for stepping (defaults to 1).
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   159
     Same as #step: for compatibility."
65
claus
parents: 57
diff changeset
   160
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   161
    stepIncrement := aNumber
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   162
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   163
    "Modified: 28.5.1997 / 15:04:25 / cg"
65
claus
parents: 57
diff changeset
   164
! !
claus
parents: 57
diff changeset
   165
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   166
!SteppingSlider methodsFor:'initialization'!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   167
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   168
createElements
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   169
    "create the scroller and the two step buttons"
65
claus
parents: 57
diff changeset
   170
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   171
    self orientation == #horizontal ifTrue:[
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   172
        button1 := ArrowButton leftIn:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   173
        button1 name:'LeftButton'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   174
        button2 := ArrowButton rightIn:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   175
        button2 name:'RightButton'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   176
        thumb := HorizontalSlider in:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   177
    ] ifFalse:[
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   178
        button1 := ArrowButton upIn:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   179
        button1 name:'UpButton'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   180
        button2 := ArrowButton downIn:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   181
        button2 name:'DownButton'.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   182
        thumb := Slider in:self.
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   183
    ].
65
claus
parents: 57
diff changeset
   184
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   185
    "Modified: 28.5.1997 / 15:09:50 / cg"
65
claus
parents: 57
diff changeset
   186
!
claus
parents: 57
diff changeset
   187
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   188
initialize
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   189
    "initialize; the increment is set to 1 (one)"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   190
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   191
    super initialize.
65
claus
parents: 57
diff changeset
   192
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   193
    stepIncrement := 1.
402
db4b13aff9c9 more code moved to superclass
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
   194
    buttonLayout := #around.
db4b13aff9c9 more code moved to superclass
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
   195
1982
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
   196
    self scrollDownAction:[self scrollStepDown].
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
   197
    self scrollUpAction:[self scrollStepUp].
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   198
402
db4b13aff9c9 more code moved to superclass
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
   199
    "Modified: 28.5.1997 / 16:12:04 / cg"
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   200
! !
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   201
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   202
!SteppingSlider methodsFor:'misc'!
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   203
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   204
doesNotUnderstand:aMessage
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   205
    "forward any unimplemented message to the scroller"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   206
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   207
    ^ aMessage sendTo:thumb
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   208
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   209
    "Modified: 28.5.1997 / 15:05:37 / cg"
23
1e6bf473d863 Initial revision
claus
parents:
diff changeset
   210
! !
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   211
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   212
!SteppingSlider methodsFor:'private'!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   213
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   214
scrollStep:delta
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   215
    "step by some delta"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   216
871
831b19654aae moved scrollStep:
Claus Gittinger <cg@exept.de>
parents: 402
diff changeset
   217
    thumb scrollStep:delta
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   218
871
831b19654aae moved scrollStep:
Claus Gittinger <cg@exept.de>
parents: 402
diff changeset
   219
    "Modified: / 21.4.1998 / 20:52:49 / cg"
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   220
!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   221
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   222
scrollStepDown
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   223
    "sent when the step-down button is pressd"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   224
1982
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
   225
    self scrollStep:stepIncrement
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   226
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   227
    "Modified: 28.5.1997 / 15:11:02 / cg"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   228
!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   229
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   230
scrollStepUp
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   231
    "sent when the step-up button is pressd"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   232
1982
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
   233
    self scrollStep:stepIncrement negated
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   234
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   235
    "Modified: 28.5.1997 / 15:11:08 / cg"
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   236
! !
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   237
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   238
!SteppingSlider class methodsFor:'documentation'!
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   239
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   240
version
1982
7e268ddd2ab2 Fix up/down kuddelmuddel.
Stefan Vogel <sv@exept.de>
parents: 1470
diff changeset
   241
    ^ '$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.12 2001-07-25 17:55:35 stefan Exp $'
400
d176fd820716 merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   242
! !