Scroller.st
author Claus Gittinger <cg@exept.de>
Mon, 11 Dec 1995 18:03:27 +0100
changeset 250 77012e65ac84
parent 243 5c411425097d
child 268 d2cf9aeab1b8
permissions -rw-r--r--
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
View subclass:#Scroller
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
    14
	 instanceVariableNames:'thumbOrigin thumbHeight thumbColor thumbFrameColor scrollAction
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    15
                orientation thumbFrame thumbLevel scrolling pressOffset
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    16
                synchronousOperation shadowForm lightForm inset thumbShadowColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    17
                thumbLightColor thumbEdgeStyle thumbHalfShadowColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    18
                thumbHalfLightColor thumbFrameSizeDifference tallyLevel
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    19
                tallyMarks fixThumbHeight frameBeforeMove ghostColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    20
                ghostFrameColor ghostLevel rangeStart rangeEnd rangeStep'
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
    21
	 classVariableNames:'HandleShadowForm HandleLightForm DefaultViewBackground
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    22
                DefaultShadowColor DefaultLightColor DefaultThumbColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    23
                DefaultThumbShadowColor DefaultThumbLightColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    24
                DefaultThumbHalfShadowColor DefaultThumbHalfLightColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    25
                DefaultHalfShadowColor DefaultHalfLightColor DefaultTallyMarks
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    26
                DefaultTallyLevel DefaultLevel DefaultBorderWidth
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    27
                DefaultThumbLevel DefaultInset DefaultThumbFrameColor
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    28
                DefaultGhostColor DefaultGhostFrameColor DefaultGhostLevel
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    29
                DefaultFixThumbHeight DefaultEdgeStyle DefaultFullViewBackground'
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
    30
	 poolDictionaries:''
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
    31
	 category:'Views-Interactors'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    32
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    33
3
claus
parents: 0
diff changeset
    34
!Scroller class methodsFor:'documentation'!
claus
parents: 0
diff changeset
    35
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    36
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    37
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    38
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    39
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    40
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    41
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    42
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    44
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    45
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    46
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    47
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    48
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    49
3
claus
parents: 0
diff changeset
    50
documentation
claus
parents: 0
diff changeset
    51
"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    52
    this class implements the scroller for scrollbars.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    53
    it can also be used by itself for scrollbars without step-buttons.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    54
    When moved, either a predefined action is performed (scrollAction),
119
claus
parents: 117
diff changeset
    55
    or a model is informed via the changeMsg (which is #value: by default).
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    56
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    57
    Beside the obvious 3D rectangle, a scroller may draw a know-form
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    58
    (as in NeXT) or little tally marks (as on SGI) in itself.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    59
    These are controlled by the shadowForm, lightForm, tallyLevel and tallyMarks
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    60
    instance variables.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    61
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    62
    The scroller can work synchronous (i.e. every move leads to an immediate evaluation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    63
    of the action, or asynchronous (i.e. perform action on end-of move).
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    64
    By default, scrollers are synchronous. Asynchronous operation makes sense, 
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    65
    if the scroll operation (redraw) is expensive and takes a long time.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    66
127
claus
parents: 120
diff changeset
    67
    This class is used both for concrete instances (vertical scrollers)
claus
parents: 120
diff changeset
    68
    and as an abstract superclass for horizontalScrollers, sliders and
claus
parents: 120
diff changeset
    69
    miniScrollers.
claus
parents: 120
diff changeset
    70
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    71
  Instance variables:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    72
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    73
    thumbOrigin                 <Number>        origin of thumb (in percent)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    74
    thumbHeight                 <Number>        height of thumb (in percent)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    75
    thumbColor                  <Color>         color of thumb
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    76
    thumbFrameColor             <Color>         color of the frame around the thumb
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    77
    scrollAction                <Block>         1 arg block to be evaluated when scrolled
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    78
						(arg is position in percent)
119
claus
parents: 117
diff changeset
    79
    orientation                 <Symbol>        #horizontal or #vertical
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    80
    thumbFrame                  <Rectangle>     frame of thumb in pixels (cached)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    81
    thumbLevel                  <Number>        level of thumb if 3d
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    82
    scrolling                   <Boolean>       true during scroll
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    83
    pressOffset                 <Number>        temporary (offset into frame when move started)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    84
    synchronousOperation        <Boolean>       true if synchronous (i.e. dont wait till release
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    85
						to perform action)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    86
    shadowForm                  <Form>          bitmap of knob if any (shadow part)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    87
    lightForm                   <Form>          bitmap of knob if any (light part)
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    88
    inset                       <Integer>       number of pixels to inset thumb from view borders
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    89
    thumbShadowColor            <Color>         color do draw dark parts of thumb
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    90
    thumblightColor             <Color>         color to draw light parts of thumb
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
    91
    thumbEdgeStyle              <SymbolOrNil>   #soft or nil
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    92
    thumbHalfShadowColor        <Color>         used to draw smooth edges
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    93
    thumbHalfLightColor         <Color>         used to draw smooth edges
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    94
    thumbFrameSizeDifference    <Integer>       number of pixels the thumb is larger than 
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    95
						it should be (can be negative for mswin-style)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    96
    tallyLevel                  <Integer>       if not zero, specifies if tally-marks should
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    97
						go into or out of the display (actually only <0/>0 is checked)
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    98
						I dont know of a better word for these ...
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    99
    tallyMarks                  <Integer>       number of tally marks
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   100
    fixThumbHeight              <Boolean>       perform 'wrong' height computation a la mswindows
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   101
    rangeStart                  <Number>        the range of the scroller
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   102
    rangeEnd                                    (defaults to 0..100)
119
claus
parents: 117
diff changeset
   103
    rangeStep                                   not currently implemented
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   104
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   105
  style settings:
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   106
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   107
    scrollerLevel               <Integer>       the level of the scroller w.r.t. its enclosing view
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   108
    scrollerBorderWidth         <Integer>       the borderWidth (ignored for 3D styles)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   109
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   110
    scrollerViewBackground      <Color>         the viewBackground (color or image)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   111
    scrollerShadowColor         <Color>         the color of 3D shadowed edges (ignored in 2D styles)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   112
    scrollerLightColor          <Color>         the color of 3D lighted edges (ignored in 2D styles)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   113
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   114
    scrollerThumbColor          <Color>         the thumbs color (color or image)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   115
    scrollerThumbShadowColor    <Color>         the color of the thumbs shadowed edges (ignored in 2D styles)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   116
    scrollerThumbLightColor     <Color>         the color of the thumbs shadowed edges (ignored in 2D styles)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   117
    scrollerThumbEdgeStyle      <Symbol>        the edge style for the thumb (#soft or nil)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   118
    scrollerThumbLevel          <Integer>       the 3D height of the thumb
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   119
    scrollerThumbHalfShadowColor<Color>         the halfShadow for soft edged thumbs
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   120
    scrollerThumbHalfLightColor <Color>         the halfLight for soft edged thumbs
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   121
    scrollerThumbFrameColor     <Color>         if non-nil, a rectangle is drawn around the thumb is this color
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   122
    scrollerThumbInset          <Integer>       inset of thumb from the scrollers boundary
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   123
    scrollerThumbFixHeight      <Boolean>       if true, use a fix thumb height (as in mswindows)
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   124
    scrollerGhostColor          <Color>         the color in which a ghost-rectangle is drawn
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   125
    scrollerGhostFrameColor     <Color>         if non-nil, a rectangle is drawn around the ghost is this color
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   126
    scrollerGhostLevel          <Color>         the 3D level of the ghost rectangle
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   127
    scrollerNTallyMarks         <Integer>       number of tally-marks to draw on the thumb
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   128
    scrollerTallyLevel.         <Integer>       the 3D level of any tally marks
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   129
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   130
    notice: for mswindows style, we force a WRONG thumb-frame
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   131
    computation, to make the thumb have constant size; 
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   132
    if you dont like that (I do not :-), set scrollerThumbFixHeight to false (in the StyleSheet).
3
claus
parents: 0
diff changeset
   133
"
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   134
!
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   135
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   136
examples
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   137
"
133
claus
parents: 132
diff changeset
   138
    basic scroller setup:
claus
parents: 132
diff changeset
   139
claus
parents: 132
diff changeset
   140
	|top s|
claus
parents: 132
diff changeset
   141
claus
parents: 132
diff changeset
   142
	top := StandardSystemView new extent:200@200.
claus
parents: 132
diff changeset
   143
	s := Scroller in:top.
claus
parents: 132
diff changeset
   144
	s origin:(0.0@0.0) corner:(20@1.0).
claus
parents: 132
diff changeset
   145
	s thumbHeight:10.  'percent'.     
claus
parents: 132
diff changeset
   146
	top open
claus
parents: 132
diff changeset
   147
claus
parents: 132
diff changeset
   148
claus
parents: 132
diff changeset
   149
    setting its thumb-height:
claus
parents: 132
diff changeset
   150
	|top s|
claus
parents: 132
diff changeset
   151
claus
parents: 132
diff changeset
   152
	top := StandardSystemView new extent:200@200.
claus
parents: 132
diff changeset
   153
	s := Scroller in:top.
claus
parents: 132
diff changeset
   154
	s origin:(0.0@0.0) corner:(20@1.0).
claus
parents: 132
diff changeset
   155
	s thumbHeight:50.  'percent'.     
claus
parents: 132
diff changeset
   156
	top open
claus
parents: 132
diff changeset
   157
claus
parents: 132
diff changeset
   158
claus
parents: 132
diff changeset
   159
    setting its thumb-origin:
claus
parents: 132
diff changeset
   160
	|top s|
claus
parents: 132
diff changeset
   161
claus
parents: 132
diff changeset
   162
	top := StandardSystemView new extent:200@200.
claus
parents: 132
diff changeset
   163
	s := Scroller in:top.
claus
parents: 132
diff changeset
   164
	s origin:(0.0@0.0) corner:(20@1.0).
claus
parents: 132
diff changeset
   165
	s thumbHeight:10.  'percent'.     
claus
parents: 132
diff changeset
   166
	s thumbOrigin:30.  'percent'.     
claus
parents: 132
diff changeset
   167
	top open
claus
parents: 132
diff changeset
   168
claus
parents: 132
diff changeset
   169
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   170
    a scroller with action block (ST/X style):
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   171
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   172
	|top s|
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   173
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   174
	top := StandardSystemView new extent:200@200.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   175
	s := Scroller in:top.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   176
	s origin:(0.0@0.0) corner:(20@1.0).
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   177
	s thumbHeight:10.  'percent'.     
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   178
	s scrollAction:[:percent | Transcript show:'moved to: '; showCr:percent asFloat].
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   179
	top open
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   180
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   181
130
claus
parents: 128
diff changeset
   182
    create a scroller in its default extent and have it positioned
claus
parents: 128
diff changeset
   183
    at the right; beside another view:
claus
parents: 128
diff changeset
   184
claus
parents: 128
diff changeset
   185
	|top s v|
claus
parents: 128
diff changeset
   186
claus
parents: 128
diff changeset
   187
	top := StandardSystemView new extent:200@200.
claus
parents: 128
diff changeset
   188
	s := Scroller in:top.
claus
parents: 128
diff changeset
   189
	s origin:(0.0@0.0) corner:(0.0@1.0).
claus
parents: 128
diff changeset
   190
	s rightInset:(s preferredExtent x negated).
claus
parents: 128
diff changeset
   191
	s thumbHeight:10.
claus
parents: 128
diff changeset
   192
	s level:1.
claus
parents: 128
diff changeset
   193
claus
parents: 128
diff changeset
   194
	v := View in:top.
claus
parents: 128
diff changeset
   195
	v origin:0.0@0.0 corner:1.0@1.0.
claus
parents: 128
diff changeset
   196
	v leftInset:(s preferredExtent x).
claus
parents: 128
diff changeset
   197
	v viewBackground:Color red.
claus
parents: 128
diff changeset
   198
	v level:2.
claus
parents: 128
diff changeset
   199
claus
parents: 128
diff changeset
   200
	top open
claus
parents: 128
diff changeset
   201
claus
parents: 128
diff changeset
   202
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   203
    using a model (ST-80 style):
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   204
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   205
	|top s m|
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   206
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   207
	m := 0 asValue.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   208
	m inspect. 'look at value'.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   209
	top := StandardSystemView new extent:200@200.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   210
	s := Scroller in:top.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   211
	s origin:(0.0@0.0) corner:(20@1.0).
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   212
	s thumbHeight:10.  'percent'.     
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   213
	s model:m.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   214
	top open
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   215
119
claus
parents: 117
diff changeset
   216
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   217
    using a different changeSelector:
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   218
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   219
	|top s1 s2 m|
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   220
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   221
	m := Plug new.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   222
	m respondTo:#value1: with:[:v | Transcript show:'scroller 1 moved to: '; showCr:v].
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   223
	m respondTo:#value2: with:[:v | Transcript show:'scroller 2 moved to: '; showCr:v].
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   224
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   225
	top := StandardSystemView new extent:200@200.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   226
	s1 := Scroller in:top.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   227
	s1 origin:(0.0@0.0) corner:(20@1.0).
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   228
	s1 thumbHeight:10.  'percent'.     
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   229
	s1 model:m; change:#value1:.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   230
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   231
	s2 := Scroller in:top.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   232
	s2 origin:(30@0.0) corner:(50@1.0).
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   233
	s2 thumbHeight:10.  'percent'.     
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   234
	s2 model:m; change:#value2:.
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   235
	top open
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   236
"
3
claus
parents: 0
diff changeset
   237
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   238
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   239
!Scroller class methodsFor:'defaults'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   240
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   241
handleLightFormOn:aDisplay
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   242
    "answer the form used for the handles light area;
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   243
     cache the one for Display for the next round"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   244
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   245
    |f|
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   246
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   247
    ((aDisplay == Display) and:[HandleLightForm notNil]) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   248
	^ HandleLightForm
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   249
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   250
    f := Form fromFile:'HandleLight.xbm' resolution:100 on:aDisplay.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   251
    f isNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   252
	f := Form width:8 height:8 fromArray:#[2r00000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   253
					       2r00000010
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   254
					       2r00000011
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   255
					       2r00000011
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   256
					       2r00000011
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   257
					       2r00000011
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   258
					       2r00000110
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   259
					       2r00111100]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   260
					      on:aDisplay
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   261
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   262
    (aDisplay == Display) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   263
	HandleLightForm := f
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   264
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   265
    ^ f
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   266
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   267
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   268
handleShadowFormOn:aDisplay
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   269
    "answer the form used for the handles shadow area;
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   270
     cache the one for Display for the next round"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   271
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   272
    |f|
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   273
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   274
    ((aDisplay == Display) and:[HandleShadowForm notNil]) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   275
	^ HandleShadowForm
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   276
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   277
    f := Form fromFile:'HandleShadow.xbm' resolution:100 on:aDisplay.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   278
    f isNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   279
	f := Form width:8 height:8 fromArray:#[2r00111100
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   280
					       2r01100000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   281
					       2r11000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   282
					       2r11000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   283
					       2r11000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   284
					       2r11000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   285
					       2r01000000
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   286
					       2r00000000]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   287
					   on:aDisplay
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   288
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   289
    (aDisplay == Display) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   290
	HandleShadowForm := f
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   291
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   292
    ^ f
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   293
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   294
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   295
updateStyleCache
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   296
    DefaultViewBackground := StyleSheet colorAt:'scrollerViewBackground'.
128
claus
parents: 127
diff changeset
   297
    DefaultFullViewBackground := StyleSheet colorAt:'scrollerFullViewBackground'.
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   298
    DefaultThumbColor := StyleSheet colorAt:'scrollerThumbColor'.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   299
    DefaultShadowColor := StyleSheet colorAt:'scrollerShadowColor'.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   300
    DefaultLightColor := StyleSheet colorAt:'scrollerLightColor'.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   301
    DefaultThumbShadowColor := StyleSheet colorAt:'scrollerThumbShadowColor'.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   302
    DefaultThumbLightColor := StyleSheet colorAt:'scrollerThumbLightColor'.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   303
    DefaultThumbHalfShadowColor := StyleSheet colorAt:'scrollerThumbHalfShadowColor'.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   304
    DefaultThumbHalfLightColor := StyleSheet colorAt:'scrollerThumbHalfLightColor'.
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   305
    DefaultThumbFrameColor := StyleSheet colorAt:'scrollerThumbFrameColor'.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   306
    DefaultGhostColor := StyleSheet colorAt:'scrollerGhostColor' default:nil.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   307
    DefaultGhostFrameColor := StyleSheet colorAt:'scrollerGhostFrameColor' default:nil.
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   308
    DefaultGhostLevel := StyleSheet at:'scrollerGhostLevel' default:0.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   309
    DefaultTallyMarks := StyleSheet at:'scrollerNTallyMarks' default:0.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   310
    DefaultTallyLevel := 0.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   311
    DefaultTallyMarks ~~ 0 ifTrue:[
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   312
	DefaultTallyLevel := StyleSheet at:'scrollerTallyLevel' default:1.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   313
    ].
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   314
    DefaultLevel := StyleSheet at:'scrollerLevel' default:0.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   315
    DefaultBorderWidth := StyleSheet at:'scrollerBorderWidth' default:(StyleSheet at:'borderWidth').
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   316
    DefaultThumbLevel := StyleSheet at:'scrollerThumbLevel' default:0.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   317
    DefaultInset := StyleSheet at:'scrollerThumbInset' default:0.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   318
    DefaultFixThumbHeight := StyleSheet at:'scrollerThumbFixHeight' default:false.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   319
    DefaultEdgeStyle := StyleSheet at:'scrollerThumbEdgeStyle'.
130
claus
parents: 128
diff changeset
   320
claus
parents: 128
diff changeset
   321
    StyleSheet fileReadFailed ifTrue:[
claus
parents: 128
diff changeset
   322
	DefaultViewBackground := Grey.
claus
parents: 128
diff changeset
   323
	DefaultThumbColor := White.
claus
parents: 128
diff changeset
   324
	DefaultThumbFrameColor := Black.
claus
parents: 128
diff changeset
   325
	DefaultInset := 1.
claus
parents: 128
diff changeset
   326
    ]
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   327
! !
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   328
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   329
!Scroller methodsFor:'accessing'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   330
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   331
action:aBlock
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   332
    "for protocol compatibility; same as scrollAction:"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   333
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   334
    self scrollAction:aBlock
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   335
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   336
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   337
asynchronousOperation
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   338
    "set scroll-mode to be asynchronous - scroll action is performed after
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   339
     scrolling, when mouse-button is finally released"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   340
     
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   341
    synchronousOperation := false
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   342
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   343
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   344
is3D
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   345
    styleSheet name = #mswindows ifTrue:[^ true].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   346
    ^ super is3D
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   347
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   348
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   349
orientation 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   350
    "return the scrollers orientation (#vertical or #horizontal)"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   351
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   352
    ^ orientation
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   353
!
119
claus
parents: 117
diff changeset
   354
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   355
scrollAction
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   356
    "answer the scroll action block"
131
claus
parents: 130
diff changeset
   357
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   358
    ^ scrollAction
119
claus
parents: 117
diff changeset
   359
!
claus
parents: 117
diff changeset
   360
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   361
scrollAction:aBlock
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   362
    "set the scroll action, aBlock which is evaluated when scrolled"
119
claus
parents: 117
diff changeset
   363
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   364
    scrollAction := aBlock
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   365
!
119
claus
parents: 117
diff changeset
   366
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   367
scrollDownAction:aBlock
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   368
    "ignored -
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   369
     but implemented, so that scroller can be used in place of a scrollbar"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   370
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   371
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   372
scrollUpAction:aBlock
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   373
    "ignored -
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   374
     but implemented, so that scroller can be used in place of a scrollbar"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   375
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   376
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   377
setThumbFor:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   378
    "get contents and size info from aView and adjust thumb"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   379
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   380
    |percentSize percentOrigin contentsSize contentsPosition viewsSize|
119
claus
parents: 117
diff changeset
   381
claus
parents: 117
diff changeset
   382
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   383
     get the content's size
119
claus
parents: 117
diff changeset
   384
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   385
    aView isNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   386
	contentsSize := 0
119
claus
parents: 117
diff changeset
   387
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   388
	orientation == #vertical ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   389
	    contentsSize := aView heightOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   390
	    aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   391
		contentsSize := aView transformation applyScaleY:contentsSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   392
	    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   393
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   394
	    contentsSize := aView widthOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   395
	    aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   396
		contentsSize := aView transformation applyScaleX:contentsSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   397
	    ].
119
claus
parents: 117
diff changeset
   398
	]
claus
parents: 117
diff changeset
   399
    ].
claus
parents: 117
diff changeset
   400
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   401
    (contentsSize = 0) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   402
	percentSize := 100.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   403
	percentOrigin := 100
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   404
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   405
	(orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   406
	    viewsSize := aView innerHeight.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   407
	    contentsPosition := aView yOriginOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   408
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   409
	    viewsSize := aView innerWidth.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   410
	    contentsPosition := aView xOriginOfContents
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   411
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   412
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   413
	percentSize := viewsSize * 100.0 / contentsSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   414
	percentOrigin := contentsPosition * 100.0 / contentsSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   415
	percentOrigin + percentSize > 100.0 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   416
	    "actually showing stuff below contents of view"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   417
"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   418
	    contentsSize := contentsPosition + aView innerHeight.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   419
	    percentSize := viewsSize * 100.0 / contentsSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   420
	    percentOrigin := contentsPosition * 100.0 / contentsSize
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   421
"
119
claus
parents: 117
diff changeset
   422
	]
claus
parents: 117
diff changeset
   423
    ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   424
    (percentSize = thumbHeight) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   425
	self thumbOrigin:percentOrigin
119
claus
parents: 117
diff changeset
   426
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   427
	(percentOrigin = thumbOrigin) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   428
	    self thumbHeight:percentSize
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   429
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   430
	    self thumbOrigin:percentOrigin thumbHeight:percentSize
119
claus
parents: 117
diff changeset
   431
	]
claus
parents: 117
diff changeset
   432
    ]
claus
parents: 117
diff changeset
   433
!
claus
parents: 117
diff changeset
   434
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   435
setThumbHeightFor:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   436
    "get contents and size info from aView and adjust thumb height"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   437
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
    |percent total viewsSize|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   439
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   440
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   441
	total := aView heightOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   442
	aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   443
	    total := aView transformation applyScaleY:total.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   444
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   445
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   446
	total := aView widthOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   447
	aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   448
	    total := aView transformation applyScaleX:total.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   449
	].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   450
    ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   451
    (total = 0) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
	percent := 100
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   454
	viewsSize := (orientation == #vertical) ifTrue:[aView innerHeight]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   455
					   ifFalse:[aView innerWidth].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   456
	percent := viewsSize * 100.0 / total
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   457
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
    self thumbHeight:percent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   459
!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   460
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
setThumbOriginFor:aView
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   462
    "get contents and size info from aView and adjust thumb origin"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   463
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   464
    |percent total contentsPosition|
22
ac872628ef2d *** empty log message ***
claus
parents: 7
diff changeset
   465
119
claus
parents: 117
diff changeset
   466
    (orientation == #vertical) ifTrue:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   467
	total := aView heightOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   468
	aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   469
	    total := aView transformation applyScaleY:total.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   470
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   471
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   472
	total := aView widthOfContents.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   473
	aView transformation notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   474
	    total := aView transformation applyScaleX:total.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   477
    (total = 0) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   478
	percent := 100
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   479
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   480
	contentsPosition := (orientation == #vertical) ifTrue:[aView yOriginOfContents]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   481
						  ifFalse:[aView xOriginOfContents].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   482
	percent := contentsPosition * 100.0 / total
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   484
    self thumbOrigin:percent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   485
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   486
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   487
start 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   488
    "return the scrollers range min"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   489
    ^ rangeStart
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   490
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   491
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   492
start:start
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   493
    "set the scrollers range start"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   494
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   495
    rangeStart := start.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   496
!
22
ac872628ef2d *** empty log message ***
claus
parents: 7
diff changeset
   497
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
start:start stop:stop
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   499
    "set the scrollers range"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   500
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   501
    rangeStart := start.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   502
    rangeEnd := stop
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   503
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   504
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   505
step
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   506
    "return the scrollers range step"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   507
    ^ rangeStep
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   508
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   509
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   510
step:step
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   511
    "set the scrollers range step"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   512
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   513
    rangeStep := step
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   514
!
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   515
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   516
stop
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   517
    "return the scrollers range max"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   518
    ^ rangeEnd
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   519
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   520
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   521
stop:stop
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   522
    "set the scrollers range stop"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   523
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   524
    rangeEnd := stop
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   525
!
119
claus
parents: 117
diff changeset
   526
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   527
synchronousOperation
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   528
    "set scroll-mode to be synchronous - scroll action is performed for 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   529
     every movement of thumb"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   530
     
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   531
    synchronousOperation := true
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   532
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   533
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   534
thumbColor
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   535
    "return the thumbs color"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   536
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   537
    ^ thumbColor
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   538
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   539
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   540
thumbColor:aColor
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   541
    "change the color of the thumb"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   542
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   543
    thumbColor := aColor on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   544
    (styleSheet name ~~ #normal) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   545
	thumbShadowColor := aColor darkened on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   546
	thumbLightColor := aColor lightened on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   547
	thumbHalfShadowColor := thumbShadowColor darkened on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   548
	thumbHalfLightColor := thumbLightColor lightened on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   549
    ].
119
claus
parents: 117
diff changeset
   550
    shown ifTrue:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   551
	self redraw
119
claus
parents: 117
diff changeset
   552
    ]
claus
parents: 117
diff changeset
   553
!
claus
parents: 117
diff changeset
   554
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   555
thumbFrame
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   556
    "return the area used by the thumbFrame (in device coordinates).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   557
     Allows access to the thumbs physical screen position, for
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   558
     example to position a label below (see Slider-Examples)"
119
claus
parents: 117
diff changeset
   559
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   560
    thumbFrame isNil ifTrue:[ self computeThumbFrame].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   561
    ^ thumbFrame
119
claus
parents: 117
diff changeset
   562
!
claus
parents: 117
diff changeset
   563
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   564
thumbHeight
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   565
    "answer the thumbs height (in percent by default)"
119
claus
parents: 117
diff changeset
   566
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   567
    ^ thumbHeight * (rangeEnd - rangeStart) / 100
119
claus
parents: 117
diff changeset
   568
!
claus
parents: 117
diff changeset
   569
claus
parents: 117
diff changeset
   570
thumbHeight:aNumber 
claus
parents: 117
diff changeset
   571
    "set the thumbs height (in percent by default)"
claus
parents: 117
diff changeset
   572
128
claus
parents: 127
diff changeset
   573
    |newHeight realNewHeight oldFrame nBg|
119
claus
parents: 117
diff changeset
   574
claus
parents: 117
diff changeset
   575
    newHeight := aNumber / (rangeEnd - rangeStart / 100).
claus
parents: 117
diff changeset
   576
claus
parents: 117
diff changeset
   577
    (newHeight > 100) ifTrue:[
claus
parents: 117
diff changeset
   578
	realNewHeight := 100
claus
parents: 117
diff changeset
   579
    ] ifFalse:[
claus
parents: 117
diff changeset
   580
	realNewHeight := newHeight
claus
parents: 117
diff changeset
   581
    ].
claus
parents: 117
diff changeset
   582
    ((realNewHeight ~= thumbHeight) or:[thumbFrame isNil]) ifTrue:[
claus
parents: 117
diff changeset
   583
	thumbHeight := realNewHeight.
128
claus
parents: 127
diff changeset
   584
claus
parents: 127
diff changeset
   585
	(DefaultFullViewBackground notNil
claus
parents: 127
diff changeset
   586
	and:[DefaultViewBackground notNil
claus
parents: 127
diff changeset
   587
	and:[DefaultFullViewBackground ~~ DefaultViewBackground]]) ifTrue:[
claus
parents: 127
diff changeset
   588
	    realNewHeight >= 100 ifTrue:[
claus
parents: 127
diff changeset
   589
		nBg := DefaultFullViewBackground.
claus
parents: 127
diff changeset
   590
	    ] ifFalse:[
claus
parents: 127
diff changeset
   591
		nBg := DefaultViewBackground
claus
parents: 127
diff changeset
   592
	    ].
claus
parents: 127
diff changeset
   593
	    nBg := nBg on:device.
claus
parents: 127
diff changeset
   594
	    nBg ~~ viewBackground ifTrue:[
claus
parents: 127
diff changeset
   595
		self viewBackground:nBg.
claus
parents: 127
diff changeset
   596
		shown ifTrue:[self clear].
claus
parents: 127
diff changeset
   597
	    ]
claus
parents: 127
diff changeset
   598
	].
claus
parents: 127
diff changeset
   599
119
claus
parents: 117
diff changeset
   600
	shown ifTrue:[
claus
parents: 117
diff changeset
   601
	    oldFrame := thumbFrame.
claus
parents: 117
diff changeset
   602
	    self computeThumbFrame.
claus
parents: 117
diff changeset
   603
	    (fixThumbHeight or:[oldFrame ~~ thumbFrame]) ifTrue:[
claus
parents: 117
diff changeset
   604
		oldFrame notNil ifTrue:[
claus
parents: 117
diff changeset
   605
		    self drawThumbBackgroundInX:(oldFrame left)
claus
parents: 117
diff changeset
   606
					      y:(oldFrame top) 
claus
parents: 117
diff changeset
   607
					  width:(oldFrame width) 
claus
parents: 117
diff changeset
   608
					 height:(oldFrame height).
claus
parents: 117
diff changeset
   609
		].
claus
parents: 117
diff changeset
   610
		self drawThumb
claus
parents: 117
diff changeset
   611
	    ]
claus
parents: 117
diff changeset
   612
	] ifFalse:[
claus
parents: 117
diff changeset
   613
	    thumbFrame := nil
claus
parents: 117
diff changeset
   614
	]
claus
parents: 117
diff changeset
   615
    ]
claus
parents: 117
diff changeset
   616
!
claus
parents: 117
diff changeset
   617
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   618
thumbOrigin
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   619
    "answer the thumbs origin (in percent by default)"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   620
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   621
    ^ thumbOrigin * (rangeEnd - rangeStart) / 100 + rangeStart
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   622
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   623
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   624
thumbOrigin:aNumber 
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   625
    "set the thumbs origin (in percent by default)"
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   626
119
claus
parents: 117
diff changeset
   627
    |newOrigin realNewOrigin 
claus
parents: 117
diff changeset
   628
     oldFrame oldTop oldBot oldLeft oldRight
claus
parents: 117
diff changeset
   629
     thumbTop thumbBot thumbLeft thumbRight
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   630
     tH "{ Class: SmallInteger }"
119
claus
parents: 117
diff changeset
   631
     tW 
132
claus
parents: 131
diff changeset
   632
     delta needFullDraw 
119
claus
parents: 117
diff changeset
   633
     bgLeft bgTop bgWidth bgHeight|
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   634
133
claus
parents: 132
diff changeset
   635
    newOrigin := (aNumber - rangeStart) asFloat / (rangeEnd - rangeStart / 100).
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   636
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   637
    ((newOrigin + thumbHeight) > 100) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   638
	realNewOrigin := 100 - thumbHeight
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   639
    ] ifFalse: [
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   640
	realNewOrigin := newOrigin
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   641
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   642
    (realNewOrigin > 100) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   643
	realNewOrigin := 100
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   644
    ] ifFalse: [
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   645
	(realNewOrigin < 0) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   646
	    realNewOrigin := 0
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   647
	]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   648
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   649
    ((realNewOrigin ~= thumbOrigin) or:[thumbFrame isNil]) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   650
	thumbOrigin := realNewOrigin.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   651
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   652
	shown ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   653
	    oldFrame := thumbFrame.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   654
	    self computeThumbFrame.
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   655
	    (thumbHeight = 100) ifTrue:[
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   656
		"/ full: don't draw
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   657
		^ self
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   658
	    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   659
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   660
	    (thumbFrame ~~ oldFrame) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   661
		oldFrame isNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   662
		    self drawThumb.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   663
		    ^ self
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   664
		].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   665
		tH := thumbFrame height.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   666
		tW := thumbFrame width.
119
claus
parents: 117
diff changeset
   667
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   668
		oldTop := oldFrame top.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   669
		oldBot := oldTop + tH.
119
claus
parents: 117
diff changeset
   670
		oldLeft := oldFrame left.
claus
parents: 117
diff changeset
   671
		oldRight := oldLeft + tW.
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   672
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   673
		thumbTop := thumbFrame top.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   674
		thumbBot := thumbTop + tH.
119
claus
parents: 117
diff changeset
   675
		thumbLeft := thumbFrame left.
claus
parents: 117
diff changeset
   676
		thumbRight := thumbLeft + tW.
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   677
119
claus
parents: 117
diff changeset
   678
		needFullDraw := self exposeEventPending
claus
parents: 117
diff changeset
   679
				or:[((orientation == #vertical) and:[oldBot >= height])
claus
parents: 117
diff changeset
   680
				or:[((orientation ~~ #vertical) and:[oldRight >= width])]].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   681
119
claus
parents: 117
diff changeset
   682
		needFullDraw ifTrue:[
claus
parents: 117
diff changeset
   683
		    "
claus
parents: 117
diff changeset
   684
		     cannot copy since thumb was below the end
claus
parents: 117
diff changeset
   685
		     or may be not available for the copy
claus
parents: 117
diff changeset
   686
		    "
claus
parents: 117
diff changeset
   687
		    (orientation == #vertical) ifTrue:[
claus
parents: 117
diff changeset
   688
			self drawThumbBackgroundInX:thumbLeft y:oldTop
claus
parents: 117
diff changeset
   689
					      width:tW height:(height - oldTop).
claus
parents: 117
diff changeset
   690
		    ] ifFalse:[
claus
parents: 117
diff changeset
   691
			self drawThumbBackgroundInX:oldLeft y:thumbTop
claus
parents: 117
diff changeset
   692
					      width:(width - oldLeft) height:tH.
claus
parents: 117
diff changeset
   693
		    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   694
		    self drawThumb.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   695
		    ^ self
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   696
		].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   697
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   698
		self catchExpose.
119
claus
parents: 117
diff changeset
   699
		"
claus
parents: 117
diff changeset
   700
		 copy the thumbs pixels
claus
parents: 117
diff changeset
   701
		"
claus
parents: 117
diff changeset
   702
		(orientation == #vertical) ifTrue:[
claus
parents: 117
diff changeset
   703
		    self copyFrom:self x:thumbLeft y:oldTop
claus
parents: 117
diff changeset
   704
				     toX:thumbLeft y:thumbTop
claus
parents: 117
diff changeset
   705
				   width:tW height:tH.
claus
parents: 117
diff changeset
   706
		] ifFalse:[
claus
parents: 117
diff changeset
   707
		    self copyFrom:self x:oldLeft y:thumbTop
claus
parents: 117
diff changeset
   708
				     toX:thumbLeft y:thumbTop
claus
parents: 117
diff changeset
   709
				   width:tW height:tH.
claus
parents: 117
diff changeset
   710
		].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   711
119
claus
parents: 117
diff changeset
   712
		"
claus
parents: 117
diff changeset
   713
		 clear some of the previous thumbs area to background
claus
parents: 117
diff changeset
   714
		"
claus
parents: 117
diff changeset
   715
		(orientation == #vertical) ifTrue:[
claus
parents: 117
diff changeset
   716
		    bgLeft := thumbLeft.
claus
parents: 117
diff changeset
   717
		    bgWidth := tW.
claus
parents: 117
diff changeset
   718
		    oldTop > thumbTop ifTrue:[
claus
parents: 117
diff changeset
   719
			delta := oldTop - thumbTop.
claus
parents: 117
diff changeset
   720
			oldTop > thumbBot ifTrue:[
claus
parents: 117
diff changeset
   721
			    bgTop := oldTop.
claus
parents: 117
diff changeset
   722
			    bgHeight := tH + 1
claus
parents: 117
diff changeset
   723
			] ifFalse:[
claus
parents: 117
diff changeset
   724
			    bgTop := thumbBot.
claus
parents: 117
diff changeset
   725
			    bgHeight := delta
claus
parents: 117
diff changeset
   726
			]
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   727
		    ] ifFalse:[
119
claus
parents: 117
diff changeset
   728
			delta := thumbTop - oldTop.
claus
parents: 117
diff changeset
   729
			oldBot < thumbTop ifTrue:[
claus
parents: 117
diff changeset
   730
			    bgTop := oldTop.
claus
parents: 117
diff changeset
   731
			    bgHeight := tH + 1
claus
parents: 117
diff changeset
   732
			] ifFalse:[
claus
parents: 117
diff changeset
   733
			    bgTop := oldTop.
claus
parents: 117
diff changeset
   734
			    bgHeight := delta
claus
parents: 117
diff changeset
   735
			]
claus
parents: 117
diff changeset
   736
		    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   737
		] ifFalse:[
119
claus
parents: 117
diff changeset
   738
		    bgTop := thumbTop.
claus
parents: 117
diff changeset
   739
		    bgHeight := tH.
claus
parents: 117
diff changeset
   740
		    oldLeft > thumbLeft ifTrue:[
claus
parents: 117
diff changeset
   741
			delta := oldLeft - thumbLeft.
claus
parents: 117
diff changeset
   742
			oldLeft > thumbRight ifTrue:[
claus
parents: 117
diff changeset
   743
			    bgLeft := oldLeft.
claus
parents: 117
diff changeset
   744
			    bgWidth := tW + 1.
claus
parents: 117
diff changeset
   745
			] ifFalse:[
claus
parents: 117
diff changeset
   746
			    bgLeft := thumbRight.
claus
parents: 117
diff changeset
   747
			    bgWidth := delta.
claus
parents: 117
diff changeset
   748
			]
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   749
		    ] ifFalse:[
119
claus
parents: 117
diff changeset
   750
			delta := thumbLeft - oldLeft.
claus
parents: 117
diff changeset
   751
			oldRight < thumbLeft ifTrue:[
claus
parents: 117
diff changeset
   752
			    bgLeft := oldLeft.
claus
parents: 117
diff changeset
   753
			    bgWidth := tW + 1.
claus
parents: 117
diff changeset
   754
			] ifFalse:[
claus
parents: 117
diff changeset
   755
			    bgLeft := oldLeft.
claus
parents: 117
diff changeset
   756
			    bgWidth := delta.
claus
parents: 117
diff changeset
   757
			]
claus
parents: 117
diff changeset
   758
		    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   759
		].
119
claus
parents: 117
diff changeset
   760
		self drawThumbBackgroundInX:bgLeft y:bgTop width:bgWidth height:bgHeight.
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   761
		self waitForExpose
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   762
	    ]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   763
	] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   764
	    thumbFrame := nil
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   765
	]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   766
    ]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   767
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   768
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   769
thumbOrigin:originNumber thumbHeight:heightNumber
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   770
    "set both thumbs height and origin (in percent by default)"
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   771
128
claus
parents: 127
diff changeset
   772
    |newHeight newOrigin realNewOrigin realNewHeight old new changed nBg|
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   773
131
claus
parents: 130
diff changeset
   774
    newOrigin := originNumber - rangeStart / (rangeEnd - rangeStart / 100).
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   775
    newHeight := heightNumber / (rangeEnd - rangeStart / 100).
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   776
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   777
    (newHeight > 100) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   778
	realNewHeight := 100
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   779
    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   780
	realNewHeight := newHeight
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   781
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   782
    ((newOrigin + realNewHeight) > 100) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   783
	realNewOrigin := 100 - realNewHeight
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   784
    ] ifFalse: [
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   785
	realNewOrigin := newOrigin
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   786
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   787
    (realNewOrigin < 0) ifTrue: [
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   788
	realNewOrigin := 0
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   789
    ].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
   790
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   791
    changed := (realNewHeight ~= thumbHeight) or:[realNewOrigin ~= thumbOrigin].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   792
    (changed or:[thumbFrame isNil]) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   793
	old := self absFromPercent:thumbOrigin.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   794
	new := self absFromPercent:realNewOrigin.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   795
	changed := old ~~ new.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   796
	changed ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   797
	    old := self absFromPercent:thumbHeight.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   798
	    new := self absFromPercent:realNewHeight.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   799
	    changed := (old ~~ new)
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   800
	].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   801
	(changed or:[thumbFrame isNil]) ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   802
	    thumbOrigin := realNewOrigin.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   803
	    thumbHeight := realNewHeight.
128
claus
parents: 127
diff changeset
   804
claus
parents: 127
diff changeset
   805
	    (DefaultFullViewBackground notNil
claus
parents: 127
diff changeset
   806
	    and:[DefaultViewBackground notNil
claus
parents: 127
diff changeset
   807
	    and:[DefaultFullViewBackground ~~ DefaultViewBackground]]) ifTrue:[
claus
parents: 127
diff changeset
   808
		realNewHeight >= 100 ifTrue:[
claus
parents: 127
diff changeset
   809
		    nBg := DefaultFullViewBackground.
claus
parents: 127
diff changeset
   810
		] ifFalse:[
claus
parents: 127
diff changeset
   811
		    nBg := DefaultViewBackground
claus
parents: 127
diff changeset
   812
		].
claus
parents: 127
diff changeset
   813
		nBg := nBg on:device.
claus
parents: 127
diff changeset
   814
		nBg ~~ viewBackground ifTrue:[
claus
parents: 127
diff changeset
   815
		    self viewBackground:nBg.
claus
parents: 127
diff changeset
   816
		    shown ifTrue:[self clear].
claus
parents: 127
diff changeset
   817
		]
claus
parents: 127
diff changeset
   818
	    ].
claus
parents: 127
diff changeset
   819
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   820
	    shown ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   821
		thumbFrame notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   822
		    self drawThumbBackgroundInX:(thumbFrame left)
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   823
					      y:(thumbFrame top) 
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   824
					  width:(thumbFrame width) 
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   825
					 height:(thumbFrame height).
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   826
		].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   827
		self computeThumbFrame.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   828
		self drawThumb
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   829
	    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   830
		thumbFrame := nil
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   831
	    ]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   832
	]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   833
    ]
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   834
! !
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   835
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   836
!Scroller methodsFor:'drawing'!
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   837
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   838
drawHandleFormAtX:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   839
    thumbShadowColor := thumbShadowColor on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   840
    thumbLightColor := thumbLightColor on:device.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   841
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   842
    self paint:thumbShadowColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   843
    self displayForm:shadowForm x:x y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   844
    self paint:thumbLightColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   845
    self displayForm:lightForm x:x y:y.
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   846
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
   847
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   848
drawThumb
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   849
    "draw the thumb"
119
claus
parents: 117
diff changeset
   850
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   851
    |handleX handleY l t 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   852
     w "{ Class: SmallInteger }"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   853
     h "{ Class: SmallInteger }"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   854
     x "{ Class: SmallInteger }"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   855
     y "{ Class: SmallInteger }"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   856
     mm xL xR yT yB color1 color2|
119
claus
parents: 117
diff changeset
   857
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   858
    (thumbHeight >= 100) ifTrue:[^ self].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   859
    orientation == #vertical ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   860
	thumbFrame height >= height ifTrue:[^ self].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   861
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   862
	thumbFrame width >= width ifTrue:[^ self].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   863
    ].
119
claus
parents: 117
diff changeset
   864
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   865
    l := thumbFrame left.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   866
    t := thumbFrame top.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   867
    w := thumbFrame width.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   868
    h := thumbFrame height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   869
    self paint:thumbColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   870
    self fillRectangleX:l y:t width:w-1 height:h.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   871
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   872
    thumbLevel == 0 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   873
	thumbFrameColor notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   874
	    self paint:thumbFrameColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   875
	    self displayRectangle:thumbFrame.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   876
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   877
	^ self
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   878
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   879
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   880
    "what a kludge - must be a parameter to drawEdge..."
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   881
    self drawEdgesForX:l y:t width:w height:h level:thumbLevel
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   882
		shadow:thumbShadowColor light:thumbLightColor
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   883
		halfShadow:thumbHalfShadowColor halfLight:thumbHalfLightColor
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   884
		style:thumbEdgeStyle.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   885
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   886
    thumbFrameColor notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   887
	self paint:thumbFrameColor.
119
claus
parents: 117
diff changeset
   888
	orientation == #vertical ifTrue:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   889
	    self displayRectangleX:l y:t width:w"-1" height:h.
119
claus
parents: 117
diff changeset
   890
	] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   891
	    self displayRectangleX:l y:t width:w height:h"-1".
119
claus
parents: 117
diff changeset
   892
	]
claus
parents: 117
diff changeset
   893
    ].
claus
parents: 117
diff changeset
   894
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   895
    (tallyLevel == 0 or:[tallyMarks == 0]) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   896
	shadowForm notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   897
	    handleX := l + ((w - 8) // 2).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   898
	    handleY := t + ((h - 8) // 2).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   899
	    self drawHandleFormAtX:handleX y:handleY
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   900
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   901
	^ self
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   902
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   903
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   904
    "iris style - draw tallys"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   905
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   906
    tallyLevel > 0 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   907
	color1 := thumbLightColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   908
	color2 := thumbShadowColor.
119
claus
parents: 117
diff changeset
   909
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   910
	color1 := thumbShadowColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   911
	color2 := thumbLightColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   912
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   913
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   914
    "draw tally marks"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   915
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   916
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   917
	self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   918
	y := t + (h // 2) - 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   919
	xL := l + thumbLevel - 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   920
	xR := l + w - thumbLevel "+ 1".
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   921
	self displayLineFromX:xL y:y toX:xR y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   922
	y := y + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   923
	self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   924
	self displayLineFromX:xL y:y toX:xR y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   925
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   926
	tallyMarks > 1 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   927
	    "dont draw other marks if there is not enough space"
119
claus
parents: 117
diff changeset
   928
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   929
	    mm := device verticalPixelPerMillimeter rounded.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   930
	    h > (mm * (tallyMarks * 2)) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   931
		y := y - 1 - mm.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   932
		self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   933
		self displayLineFromX:xL y:y toX:xR y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   934
		y := y + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   935
		self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   936
		self displayLineFromX:xL y:y toX:xR y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   937
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   938
		y := y - 1 + mm + mm.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   939
		self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   940
		self displayLineFromX:xL y:y toX:xR y:y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   941
		y := y + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   942
		self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   943
		self displayLineFromX:xL y:y toX:xR y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   944
	    ]
119
claus
parents: 117
diff changeset
   945
	]
claus
parents: 117
diff changeset
   946
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   947
	x := l + (w // 2) - 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   948
	yT := t + thumbLevel - 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   949
	yB := t + h - thumbLevel "+ 1".
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   950
	self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   951
	self displayLineFromX:x y:yT toX:x y:yB.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   952
	self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   953
	x := x + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   954
	self displayLineFromX:x y:yT toX:x y:yB.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   955
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   956
	tallyMarks > 1 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   957
	    "dont draw other marks if there is not enough space"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   958
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   959
	    mm := device horizontalPixelPerMillimeter rounded.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   960
	    w > (mm * (tallyMarks * 2)) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   961
		x := x - 1 - mm.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   962
		self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   963
		self displayLineFromX:x y:yT toX:x y:yB.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   964
		x := x + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   965
		self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   966
		self displayLineFromX:x y:yT toX:x y:yB.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   967
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   968
		x := x - 1 + mm + mm.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   969
		self paint:color1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   970
		self displayLineFromX:x y:yT toX:x y:yB.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   971
		x := x + 1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   972
		self paint:color2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   973
		self displayLineFromX:x y:yT toX:x y:yB
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   974
	    ]
119
claus
parents: 117
diff changeset
   975
	]
claus
parents: 117
diff changeset
   976
    ]
claus
parents: 117
diff changeset
   977
!
claus
parents: 117
diff changeset
   978
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   979
drawThumbBackgroundInX:x y:y width:w height:h
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   980
    "draw part of the thumbs background; defined as a separate
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   981
     method, to allow drawing of arbitrary patterns under thumb 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   982
     (see ColorSlider)."
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   983
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   984
    shown ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   985
	self clearRectangleX:x y:y width:w height:h.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   986
	frameBeforeMove notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   987
	    self clippedTo:(Rectangle left:x top:y width:w height:h) do:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   988
		|gX gY gW gH|
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
   989
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   990
		gX := frameBeforeMove left.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   991
		gY := frameBeforeMove top.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   992
		gW := frameBeforeMove width.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   993
		gH := frameBeforeMove height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   994
                
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   995
		ghostColor notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   996
		    self fillRectangle:frameBeforeMove with:ghostColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   997
		].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   998
		(ghostLevel ~~ 0) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   999
		    self drawEdgesForX:gX y:gY width:gW height:gH level:ghostLevel
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1000
		].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1001
		ghostFrameColor notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1002
		    self paint:ghostFrameColor.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1003
		    self displayRectangleX:gX y:gY width:gW height:gH
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1004
		]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1005
	    ]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1006
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1007
    ]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1008
! !
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1009
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1010
!Scroller methodsFor:'event handling'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1011
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1012
buttonMotion:state x:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1013
    "mouse-button was moved while pressed;
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1014
     redraw thumb at its new position and, if scroll-mode is asynchronous, 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1015
     the scroll action is performed"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1016
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1017
    |pos curr limit prevOrigin newOrigin|
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1018
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1019
    scrolling ifFalse: [^ self].              "should not happen"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1020
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1021
    frameBeforeMove isNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1022
	(ghostColor notNil 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1023
	or:[ghostFrameColor notNil
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1024
	or:[ghostLevel ~~ 0]]) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1025
	    frameBeforeMove := thumbFrame insetBy:1@1
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1026
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1027
    ].
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1028
119
claus
parents: 117
diff changeset
  1029
    (orientation == #vertical) ifTrue:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1030
	curr := y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1031
	limit := height
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1032
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1033
	curr := x.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1034
	limit := width
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1035
    ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1036
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1037
    (curr < 0) ifTrue:[                        "check against limits"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1038
	pos := 0
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1039
    ] ifFalse:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1040
	(curr > limit) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1041
	    pos := limit
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1042
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1043
	    pos := curr
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1044
	]
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1045
    ].
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1046
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1047
    prevOrigin := self thumbOrigin.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1048
    newOrigin := self percentFromAbs:(pos - pressOffset).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1049
    prevOrigin ~= newOrigin ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1050
	self thumbOrigin:newOrigin.
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1051
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1052
	synchronousOperation ifTrue: [
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1053
	    self tellOthers.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1054
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1055
    ]
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1056
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1057
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1058
buttonMultiPress:button x:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1059
    ^ self buttonPress:button x:x y:y
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1060
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1061
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1062
buttonPress:button x:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1063
    "button was pressed - if above thumb, page up; if below thumb, page down;
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1064
     otherwise start scrolling"
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1065
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1066
    |curr limit1 limit2|
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1067
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1068
    shown ifFalse:[^ self].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1069
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1070
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1071
	curr := y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1072
	limit1 := thumbFrame top.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1073
	limit2 := thumbFrame bottom
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1074
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1075
	curr := x.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1076
	limit1 := thumbFrame left.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1077
	limit2 := thumbFrame right
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1078
    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1079
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1080
    (curr < limit1) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1081
	"page up/left"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1082
	self pageUp
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1083
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1084
	(curr > limit2) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1085
	    "page down/right"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1086
	    self pageDown
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1087
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1088
	    pressOffset := curr - limit1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1089
	    scrolling := true
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1090
	]
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1091
    ]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1092
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1093
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1094
buttonRelease:button x:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1095
    "mouse-button was released - if scroll-mode is asynchronous, the scroll
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1096
     action is now performed"
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1097
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1098
    |rect|
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1099
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1100
    scrolling ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1101
	frameBeforeMove notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1102
	    rect := frameBeforeMove.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1103
	    frameBeforeMove := nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1104
	    self drawThumbBackgroundInX:rect left
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1105
				      y:rect top
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1106
				  width:rect width 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1107
				 height:rect height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1108
	    (rect intersects:thumbFrame) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1109
		self drawThumb
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1110
	    ]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1111
	].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1112
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1113
	scrolling := false.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1114
	synchronousOperation ifFalse: [
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1115
	    self tellOthers.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1116
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1117
    ]
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1118
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1119
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1120
buttonShiftPress:button x:x y:y
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1121
    "mouse-click with shift - jump to position"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1122
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1123
    |pos curr curr2 limit1 limit2|
133
claus
parents: 132
diff changeset
  1124
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1125
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1126
	curr := y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1127
	curr2 := y - (thumbFrame height // 2).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1128
	limit1 := height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1129
	limit2 := thumbFrame top
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1130
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1131
	curr := x.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1132
	curr2 := x - (thumbFrame width // 2).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1133
	limit1 := width.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1134
	limit2 := thumbFrame left
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1135
    ].
133
claus
parents: 132
diff changeset
  1136
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1137
    (curr2 < 0) ifTrue:[                        "check against limits"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1138
	pos := 0
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1139
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1140
	(curr2 > limit1) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1141
	    pos := limit1
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1142
	] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1143
	    pos := curr2
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1144
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1145
    ].
133
claus
parents: 132
diff changeset
  1146
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1147
    frameBeforeMove := thumbFrame insetBy:1@1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1148
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1149
    self thumbOrigin:(self percentFromAbs:pos).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1150
    self tellOthers.
133
claus
parents: 132
diff changeset
  1151
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1152
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1153
	limit2 := thumbFrame top
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1154
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1155
	limit2 := thumbFrame left
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1156
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1157
    pressOffset := curr - limit2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1158
    scrolling := true
133
claus
parents: 132
diff changeset
  1159
!
claus
parents: 132
diff changeset
  1160
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1161
redraw
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1162
    "redraw"
133
claus
parents: 132
diff changeset
  1163
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1164
    self redrawX:0 y:0 width:width height:height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1165
    self redrawEdges
133
claus
parents: 132
diff changeset
  1166
!
claus
parents: 132
diff changeset
  1167
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1168
redrawX:x y:y width:w height:h
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1169
    shown ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1170
	thumbFrame isNil ifTrue:[self computeThumbFrame].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1171
	self drawThumbBackgroundInX:x y:y width:w height:h.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1172
	(y > thumbFrame bottom) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1173
	    ^ self
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1174
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1175
	((y + h) < thumbFrame top) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1176
	    ^ self
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1177
	].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1178
	self drawThumb
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1179
    ]
133
claus
parents: 132
diff changeset
  1180
!
claus
parents: 132
diff changeset
  1181
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1182
sizeChanged:how
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1183
    "size of scroller changed - recompute thumbs frame and redraw it"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1184
211
c96f57be68c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1185
    |sensor|
c96f57be68c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1186
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1187
    shown ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1188
	self computeThumbFrame.
211
c96f57be68c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1189
	(sensor := self sensor) notNil ifTrue:[
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1190
	    self redraw.
211
c96f57be68c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1191
	    sensor flushExposeEventsFor:self 
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1192
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1193
    ]
133
claus
parents: 132
diff changeset
  1194
!
claus
parents: 132
diff changeset
  1195
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1196
update:something with:aParameter from:changedObject
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1197
    "handle update from a model (if any)"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1198
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1199
    (changedObject == model 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1200
    "and:[something == aspectMsg]") ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1201
	self thumbOrigin:(model value).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1202
	^ self
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1203
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1204
    super update:something with:aParameter from:changedObject
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1205
! !
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1206
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1207
!Scroller methodsFor:'forced scroll'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1208
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1209
pageDown
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1210
    "page down/right"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1211
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1212
    self thumbOrigin:(thumbOrigin + thumbHeight).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1213
    self tellOthers
133
claus
parents: 132
diff changeset
  1214
!
claus
parents: 132
diff changeset
  1215
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1216
pageUp
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1217
    "page up/left"
133
claus
parents: 132
diff changeset
  1218
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1219
    self thumbOrigin:(thumbOrigin - thumbHeight).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1220
    self tellOthers
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1221
! !
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1222
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1223
!Scroller methodsFor:'forwarding changed origin'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1224
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1225
tellOthers
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1226
    |org|
130
claus
parents: 128
diff changeset
  1227
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1228
    org := self thumbOrigin.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1229
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1230
     the ST/X way of notifying scrolls
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1231
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1232
    scrollAction notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1233
	scrollAction value:org 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1234
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1235
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1236
     the ST-80 way of notifying scrolls
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1237
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1238
    self sendChangeMessageWith:org.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1239
    self changed:#scrollerPosition.
130
claus
parents: 128
diff changeset
  1240
! !
claus
parents: 128
diff changeset
  1241
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1242
!Scroller methodsFor:'initialization'!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1243
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1244
computeInitialExtent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1245
    self extent:self preferredExtent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1246
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1247
119
claus
parents: 117
diff changeset
  1248
initCursor
claus
parents: 117
diff changeset
  1249
    "set the cursor - a hand"
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1250
119
claus
parents: 117
diff changeset
  1251
    cursor := Cursor hand
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1252
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1253
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1254
initStyle
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1255
    "initialize style dep. stuff"
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1256
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1257
    super initStyle.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1258
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1259
    DefaultViewBackground notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1260
	viewBackground := DefaultViewBackground on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1261
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1262
    DefaultShadowColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1263
	shadowColor := DefaultShadowColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1264
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1265
    DefaultLightColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1266
	lightColor := DefaultLightColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1267
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1268
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1269
    tallyMarks := DefaultTallyMarks.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1270
    tallyLevel := DefaultTallyLevel.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1271
    DefaultLevel ~~ level ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1272
	self level:DefaultLevel.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1273
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1274
    DefaultBorderWidth ~~ borderWidth ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1275
	self borderWidth:DefaultBorderWidth.
86
df2687090a7f *** empty log message ***
claus
parents: 77
diff changeset
  1276
    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1277
    thumbLevel := DefaultThumbLevel.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1278
    inset := DefaultInset.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1279
    fixThumbHeight := DefaultFixThumbHeight.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1280
    thumbEdgeStyle := DefaultEdgeStyle.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1281
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1282
    DefaultGhostColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1283
	ghostColor := DefaultGhostColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1284
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1285
    DefaultGhostFrameColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1286
	ghostFrameColor := DefaultGhostFrameColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1287
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1288
    ghostLevel := DefaultGhostLevel.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1289
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1290
    DefaultThumbFrameColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1291
	thumbFrameColor := DefaultThumbFrameColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1292
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1293
    DefaultThumbShadowColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1294
	thumbShadowColor := DefaultThumbShadowColor
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1295
    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1296
	thumbShadowColor := shadowColor.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1297
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1298
    DefaultThumbLightColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1299
	thumbLightColor := DefaultThumbLightColor
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1300
    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1301
	thumbLightColor := lightColor.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1302
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1303
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1304
    thumbEdgeStyle notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1305
	DefaultThumbHalfShadowColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1306
	    thumbHalfShadowColor := DefaultThumbHalfShadowColor
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1307
	].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1308
	DefaultThumbHalfLightColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1309
	    thumbHalfLightColor := DefaultThumbHalfLightColor
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1310
	].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1311
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1312
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1313
    device hasGreyscales ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1314
	thumbEdgeStyle notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1315
	    thumbHalfShadowColor := Color darkGrey.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1316
	    thumbHalfLightColor := White
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1317
	].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1318
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1319
	thumbShadowColor := Black.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1320
"/        thumbLightColor := White.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1321
130
claus
parents: 128
diff changeset
  1322
	styleSheet name = #motif ifTrue:[
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1323
	    DefaultThumbColor isNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1324
		thumbColor := White .
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1325
	    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1326
	]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1327
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1328
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1329
    DefaultThumbColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1330
	thumbColor := DefaultThumbColor on:device
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1331
    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1332
	thumbColor := White.
130
claus
parents: 128
diff changeset
  1333
	styleSheet name ~= #normal ifTrue:[
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1334
	    device hasGreyscales ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1335
		thumbColor := Color grey
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1336
	    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1337
	].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1338
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1339
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1340
    thumbColor := thumbColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1341
    thumbShadowColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1342
	thumbShadowColor := thumbShadowColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1343
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1344
    thumbLightColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1345
	thumbLightColor := thumbLightColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1346
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1347
    thumbHalfShadowColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1348
	thumbHalfShadowColor := thumbHalfShadowColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1349
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1350
    thumbHalfLightColor notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1351
	thumbHalfLightColor := thumbHalfLightColor on:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1352
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1353
    thumbEdgeStyle notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1354
	thumbHalfShadowColor isNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1355
	    thumbHalfShadowColor := thumbShadowColor lightened on:device
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1356
	]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1357
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1358
130
claus
parents: 128
diff changeset
  1359
    styleSheet name = #next ifTrue:[
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1360
	shadowForm := self class handleShadowFormOn:device.
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1361
	lightForm := self class handleLightFormOn:device
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1362
    ] ifFalse:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1363
	shadowForm := lightForm := nil
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1364
    ].
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1365
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1366
    drawableId notNil ifTrue:[
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1367
	self computeThumbFrame
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1368
    ]
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1369
!
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1370
119
claus
parents: 117
diff changeset
  1371
initialize
claus
parents: 117
diff changeset
  1372
    "initialize - setup instvars from defaults"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1373
119
claus
parents: 117
diff changeset
  1374
    super initialize.
claus
parents: 117
diff changeset
  1375
    self computeInitialExtent.
claus
parents: 117
diff changeset
  1376
    orientation := #vertical.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1377
119
claus
parents: 117
diff changeset
  1378
    scrolling := false.
claus
parents: 117
diff changeset
  1379
    synchronousOperation := true.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1380
119
claus
parents: 117
diff changeset
  1381
    thumbOrigin := 0.
claus
parents: 117
diff changeset
  1382
    thumbHeight := 100.
claus
parents: 117
diff changeset
  1383
    thumbFrameSizeDifference := 0.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1384
119
claus
parents: 117
diff changeset
  1385
    rangeStart := 0.
claus
parents: 117
diff changeset
  1386
    rangeEnd := 100.
claus
parents: 117
diff changeset
  1387
    rangeStep := nil.   "/ meaning: arbitrary precision
claus
parents: 117
diff changeset
  1388
"/    inset := 1.
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1389
119
claus
parents: 117
diff changeset
  1390
"/    self computeThumbFrame
133
claus
parents: 132
diff changeset
  1391
!
claus
parents: 132
diff changeset
  1392
claus
parents: 132
diff changeset
  1393
realize
claus
parents: 132
diff changeset
  1394
    super realize.
claus
parents: 132
diff changeset
  1395
    model notNil ifTrue:[
claus
parents: 132
diff changeset
  1396
	self thumbOrigin:(model value).
claus
parents: 132
diff changeset
  1397
    ].
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1398
! !
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1399
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1400
!Scroller methodsFor:'private'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1401
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1402
absFromPercent:percent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1403
    "given a percentage, compute number of pixels"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1404
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1405
    |fullSize|
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1406
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1407
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1408
	fullSize := height
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1409
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1410
	fullSize := width
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1411
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1412
"/    ^ ((percent * (fullSize - (margin * 2))) / 100) rounded
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1413
"/ 20-apr-94
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1414
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1415
    ^ ((percent * (fullSize - thumbFrameSizeDifference- (margin * 2))) / 100) rounded
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1416
!
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
  1417
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1418
computeThumbFrame
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1419
    "compute the thumbs frame (a rectangle) whenever thumb is moved, 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1420
     changed height or the scrollers size has changed.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1421
     We take care, that the thumb will not become too small (i.e.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1422
     invisible or uncatchable).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1423
     Also, for mswindows style, its height/width is constant."
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1424
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1425
    |newPos1 newPos2 newSize1 newSize2 nh nw ny nx 
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1426
     computedSize minSz sz1 sz2|
117
53cbfeaa9c9a *** empty log message ***
claus
parents: 106
diff changeset
  1427
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1428
    "compute position & size"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1429
    newPos1 := (self absFromPercent:thumbOrigin) + margin.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1430
    newSize1 := computedSize := self absFromPercent:thumbHeight.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1431
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1432
	sz1 := height.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1433
	sz2 := width
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1434
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1435
	sz1 := width.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1436
	sz2 := height
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1437
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1438
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1439
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1440
     do we have to adjust the computed size ?
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1441
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1442
    newPos2 := margin + inset.     
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1443
    newSize2 := sz2 - (2 * newPos2).
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1444
"/    (style ~~ #normal) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1445
    thumbLevel ~~ 0 ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1446
	"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1447
	 do not make thumb too small (for handle & to be catchable)
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1448
	"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1449
	minSz := 10 + (2 * thumbLevel)
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1450
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1451
	"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1452
	 do not make thumb too small (uncatchable)
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1453
	"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1454
	minSz := 4
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1455
    ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1456
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1457
    (newSize1 < minSz) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1458
	newSize1 := minSz.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1459
	thumbFrameSizeDifference := newSize1 - computedSize
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1460
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1461
	thumbFrameSizeDifference := 0.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1462
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1463
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1464
    fixThumbHeight ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1465
	"have a fix-size thumb (i.e. mswindows style)"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1466
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1467
	newSize1 := sz2 - (2 * inset).   "make it square"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1468
	thumbFrameSizeDifference := newSize1 - computedSize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1469
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1470
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1471
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1472
     oops - if height does not relect real visibible area, we have to adjust the origin
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1473
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1474
    (thumbFrameSizeDifference == 0) ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1475
	newPos1 := (self absFromPercent:thumbOrigin) + margin.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1476
"/        newPos1 := ((thumbOrigin * (sz1 - thumbFrameSizeDifference - (margin * 2))) / 100) rounded + margin
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1477
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1478
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1479
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1480
	ny := newPos1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1481
	nx := newPos2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1482
	nh := newSize1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1483
	nw := newSize2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1484
	ny + nh + margin > height ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1485
	    ny := height - margin - nh
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1486
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1487
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1488
	nx := newPos1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1489
	ny := newPos2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1490
	nw := newSize1.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1491
	nh := newSize2.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1492
	nx + nw + margin > width ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1493
	    nx := width - margin - nw
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1494
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1495
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1496
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1497
    "
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1498
     do not create new Rectangle if its the same anyway
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1499
    "
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1500
    thumbFrame notNil ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1501
	(ny == thumbFrame top) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1502
	  (nx == thumbFrame left) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1503
	    (nh == thumbFrame height) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1504
	      (nw == thumbFrame width) ifTrue:[ ^ self]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1505
	    ]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1506
	  ]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1507
	]
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1508
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1509
    thumbFrame := Rectangle left:nx top:ny width:nw height:nh
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1510
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1511
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1512
percentFromAbs:absValue
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1513
    "given a number of pixels, compute percentage"
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1514
218
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1515
    |fullSize val t|
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1516
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1517
    (orientation == #vertical) ifTrue:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1518
	fullSize := height
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1519
    ] ifFalse:[
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1520
	fullSize := width
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1521
    ].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1522
218
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1523
    t := fullSize - thumbFrameSizeDifference - (margin * 2).
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1524
    t = 0 ifTrue:[
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1525
	"/ in rare cases, this happens ...
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1526
	val := 0
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1527
    ] ifFalse:[
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1528
	val := absValue / t * (rangeEnd - rangeStart).
145c7a34c62a avoid division by zero if thumbs size is views size (rare)
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1529
    ].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1530
    val := val + rangeStart.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1531
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1532
    val < rangeStart ifTrue:[^ rangeStart].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1533
    val > rangeEnd ifTrue:[^ rangeEnd].
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1534
    ^ val
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1535
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1536
! !
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1537
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1538
!Scroller methodsFor:'queries'!
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1539
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1540
preferredExtent
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1541
    |w h|
119
claus
parents: 117
diff changeset
  1542
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1543
    h := self class defaultExtent y.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1544
    w := (device horizontalPixelPerMillimeter asFloat * 6) rounded.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1545
    ^ w @ h.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1546
! !
119
claus
parents: 117
diff changeset
  1547
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1548
!Scroller class methodsFor:'documentation'!
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1549
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1550
version
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
  1551
    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.33 1995-12-07 22:25:03 cg Exp $'
105
3d064ba4a0cc *** empty log message ***
claus
parents: 103
diff changeset
  1552
! !