MiniScroller.st
author Claus Gittinger <cg@exept.de>
Fri, 09 Feb 1996 18:56:54 +0100
changeset 340 f820bcd29a51
parent 205 6814c0bf8df8
child 539 c7c5585e77f6
permissions -rw-r--r--
defaultExtent with rightSpace forgot about spacing

"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Scroller subclass:#MiniScroller
	 instanceVariableNames:''
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Views-Interactors'
!

!MiniScroller class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    like a scroller, but taking less screen space
"
! !

!MiniScroller methodsFor:'initialization'!

initStyle
    |style lvl|

    super initStyle.
    style := StyleSheet name.
    style == #iris ifTrue:[
	tallyLevel := 0.
	tallyMarks := 0.
	thumbEdgeStyle := nil.
	thumbLevel := 2.
    ].
    ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[
	style == #st80 ifTrue:[
	    lvl := 1.
	] ifFalse:[
	    lvl := -1.
	].
	self level:lvl.
	self borderWidth:0
    ].
    shadowForm := lightForm := nil.
    fixThumbHeight := false
! !

!MiniScroller methodsFor:'queries'!

preferredExtent
    "make my width very small"

    |w h mm|

    h := self class defaultExtent y.
    mm := (thumbLevel ~~ 0) ifTrue:[2.5] ifFalse:[2.0].
    w := (device horizontalPixelPerMillimeter asFloat * mm) rounded.
    ^ w @ h.
! !

!MiniScroller class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.6 1995-11-23 18:18:30 cg Exp $'
! !