author | ca |
Fri, 19 Apr 1996 18:50:04 +0200 | |
changeset 556 | 4c3edf42c03e |
parent 555 | c0792488192b |
child 572 | 121735c2aff6 |
permissions | -rw-r--r-- |
37 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
64 | 3 |
All Rights Reserved |
37 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
Scroller subclass:#MiniScroller |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
14 |
instanceVariableNames:'' |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
15 |
classVariableNames:'' |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
16 |
poolDictionaries:'' |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
17 |
category:'Views-Interactors' |
37 | 18 |
! |
19 |
||
20 |
!MiniScroller class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
64 | 25 |
All Rights Reserved |
37 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
like a scroller, but taking less screen space |
|
39 |
" |
|
40 |
! ! |
|
41 |
||
130 | 42 |
!MiniScroller methodsFor:'initialization'! |
37 | 43 |
|
44 |
initStyle |
|
119 | 45 |
|style lvl| |
46 |
||
37 | 47 |
super initStyle. |
119 | 48 |
style := StyleSheet name. |
37 | 49 |
style == #iris ifTrue:[ |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
50 |
tallyLevel := tallyMarks := 0. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
51 |
thumbEdgeStyle := nil. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
52 |
thumbLevel := thumbActiveLevel := 2. |
37 | 53 |
]. |
54 |
((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[ |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
55 |
style == #st80 ifTrue:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
56 |
lvl := 1. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
57 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
58 |
lvl := -1. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
59 |
]. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
60 |
self level:lvl. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
61 |
self borderWidth:0 |
37 | 62 |
]. |
63 |
shadowForm := lightForm := nil. |
|
64 |
fixThumbHeight := false |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
65 |
|
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
66 |
"Modified: 17.4.1996 / 13:57:20 / cg" |
555 | 67 |
! |
68 |
||
69 |
initialize |
|
70 |
"initialize - setup instvars from defaults" |
|
71 |
||
556 | 72 |
orientation isNil ifTrue:[orientation := #vertical]. |
555 | 73 |
super initialize. |
37 | 74 |
! ! |
205 | 75 |
|
76 |
!MiniScroller methodsFor:'queries'! |
|
77 |
||
78 |
preferredExtent |
|
79 |
"make my width very small" |
|
80 |
||
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
81 |
|defExt w h mm| |
205 | 82 |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
83 |
defExt := self class defaultExtent. |
205 | 84 |
mm := (thumbLevel ~~ 0) ifTrue:[2.5] ifFalse:[2.0]. |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
85 |
orientation == #vertical ifTrue:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
86 |
h := defExt y. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
87 |
w := (device horizontalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
88 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
89 |
w := defExt x. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
90 |
h := (device verticalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
91 |
]. |
205 | 92 |
^ w @ h. |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
93 |
|
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
94 |
"Modified: 17.4.1996 / 14:02:43 / cg" |
205 | 95 |
! ! |
96 |
||
97 |
!MiniScroller class methodsFor:'documentation'! |
|
98 |
||
99 |
version |
|
556 | 100 |
^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.9 1996-04-19 16:49:07 ca Exp $' |
205 | 101 |
! ! |