MiniScroller.st
author Claus Gittinger <cg@exept.de>
Fri, 07 Mar 1997 16:02:24 +0100
changeset 1114 ddd752f834d5
parent 968 ba32bbfb7aad
child 1116 e4a28d306bd7
permissions -rw-r--r--
checkin from browser

"
 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
    "setup viewStyle specifics"

    |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.
            lvl := 0.
        ] ifFalse:[
            lvl := -1.
        ].
        self level:lvl.
        self borderWidth:0
    ].
    shadowForm := lightForm := nil.
    fixThumbHeight := false

    "Modified: 7.3.1997 / 15:52:13 / 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|

    "/ If I have an explicit preferredExtent ..

    preferredExtent notNil ifTrue:[
        ^ preferredExtent
    ].

    defExt := self class defaultExtent.

    mm := (thumbLevel ~~ 0) ifTrue:[2.5] ifFalse:[2.0].
    w := defExt x.
    h := defExt y.

    styleSheet name == #st80 ifTrue:[
        mm := 2.5
    ].
    orientation == #vertical ifTrue:[
        w := (device horizontalPixelPerMillimeter asFloat * mm) rounded.
    ] ifFalse:[
        h := (device verticalPixelPerMillimeter asFloat * mm) rounded.
    ].

    preferredExtent := w @ h.
    ^ preferredExtent.

    "Modified: 7.3.1997 / 16:02:15 / cg"
! !

!MiniScroller class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.15 1997-03-07 15:02:24 cg Exp $'
! !