MiniScr.st
author Claus Gittinger <cg@exept.de>
Thu, 21 Nov 1996 17:44:41 +0100
changeset 890 abd28e2f66ca
parent 797 2f9cd56f48ee
child 968 ba32bbfb7aad
permissions -rw-r--r--
stefan ! test your changes ;-)

"
 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|

    "/ If I have an explicit preferredExtent ..

    preferredExtent notNil ifTrue:[
        ^ preferredExtent
    ].

    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.
    ].
    preferredExtent := w @ h.
    ^ preferredExtent.

    "Modified: 19.7.1996 / 20:46:21 / cg"
! !

!MiniScroller  class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/Attic/MiniScr.st,v 1.13 1996-07-19 18:48:05 cg Exp $'
! !