MiniScroller.st
author Claus Gittinger <cg@exept.de>
Tue, 30 Apr 1996 15:59:23 +0200
changeset 605 11b03282d684
parent 585 8f395aba0173
child 714 5ff02d2d9fa7
permissions -rw-r--r--
copy selectors, args & shortKeys

"
 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

    [author:]
        Claus Gittinger
"
! !

!MiniScroller methodsFor:'initialization'!

initStyle
    |style lvl|

    super initStyle.
    style := StyleSheet name.
    style == #iris ifTrue:[
        tallyLevel := tallyMarks := 0.
        thumbEdgeStyle := nil.
        thumbLevel := thumbActiveLevel := 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

    "Modified: 17.4.1996 / 13:57:20 / cg"
!

initialize
    "initialize - setup instvars from defaults"

    orientation isNil ifTrue:[orientation := #vertical].
    super initialize.
! !

!MiniScroller methodsFor:'queries'!

preferredExtent
    "return my preferredExtent - make my width very small"

    |defExt w h mm|

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

    "Modified: 23.4.1996 / 00:16:42 / cg"
! !

!MiniScroller class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.11 1996-04-25 17:23:22 cg Exp $'
! !