HorizontalScrollBar.st
changeset 63 f4eaf04d1eaf
parent 60 f3c738c24ce6
child 70 14443a9ea4ec
equal deleted inserted replaced
62:7cc1e330da47 63:f4eaf04d1eaf
    19 
    19 
    20 HorizontalScrollBar comment:'
    20 HorizontalScrollBar comment:'
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libwidg/HorizontalScrollBar.st,v 1.8 1994-10-28 03:25:04 claus Exp $
    24 $Header: /cvs/stx/stx/libwidg/HorizontalScrollBar.st,v 1.9 1994-11-17 14:38:02 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !HorizontalScrollBar class methodsFor:'documentation'!
    27 !HorizontalScrollBar class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libwidg/HorizontalScrollBar.st,v 1.8 1994-10-28 03:25:04 claus Exp $
    45 $Header: /cvs/stx/stx/libwidg/HorizontalScrollBar.st,v 1.9 1994-11-17 14:38:02 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
    58 
    58 
    59 createElements
    59 createElements
    60     "private: create my elements"
    60     "private: create my elements"
    61 
    61 
    62     button1 := ArrowButton leftIn:self.
    62     button1 := ArrowButton leftIn:self.
    63     button1 name:'LeftButton'.
       
    64     button2 := ArrowButton rightIn:self.
    63     button2 := ArrowButton rightIn:self.
    65     button2 name:'RightButton'.
       
    66     thumb := HorizontalScroller in:self.
    64     thumb := HorizontalScroller in:self.
    67 !
    65 !
    68 
    66 
    69 computeInitialExtent
    67 computeInitialExtent
    70     "compute my extent from sub-components"
    68     "compute my extent from sub-components"
   236     thumbHeight := h.
   234     thumbHeight := h.
   237     style == #next ifTrue:[
   235     style == #next ifTrue:[
   238 	thumbHeight := thumbHeight - (thumb borderWidth * 2).
   236 	thumbHeight := thumbHeight - (thumb borderWidth * 2).
   239 	thumbWidth := thumbWidth - 1
   237 	thumbWidth := thumbWidth - 1
   240     ].
   238     ].
   241 
   239     style == #motif ifTrue:[
       
   240 	thumbWidth := thumbWidth - margin
       
   241     ].
   242 
   242 
   243     "
   243     "
   244      a kludge: views with width or height of 0 are illegal
   244      a kludge: views with width or height of 0 are illegal
   245      avoid error from view-creation (it will be hidden anyway)
   245      avoid error from view-creation (it will be hidden anyway)
   246     "
   246     "
   269 	].
   269 	].
   270 	^ self
   270 	^ self
   271     ].
   271     ].
   272     "button around thumb"
   272     "button around thumb"
   273 
   273 
       
   274 style == #motif ifTrue:[
       
   275     sep2 := sep2 + 1
       
   276 ].
   274     button1 origin:(bwn @ bwn).
   277     button1 origin:(bwn @ bwn).
   275     button2 origin:((leftWidth + thumbWidth + sep2 - (margin // 2)) @ bwn).
   278     button2 origin:((leftWidth + thumbWidth + sep2 - (margin // 2)) @ bwn).
   276     thumb extent:((thumbWidth + margin - (margin // 2)) @ thumbHeight).
   279     thumb extent:((thumbWidth + margin - (margin // 2)) @ thumbHeight).
   277     thumb origin:((leftWidth - borderWidth + elementSpacing) @ bwn)
   280     thumb origin:((leftWidth - borderWidth + elementSpacing) @ bwn)
   278 ! !
   281 ! !