author | Claus Gittinger <cg@exept.de> |
Wed, 29 May 1996 12:24:15 +0200 | |
changeset 714 | 5ff02d2d9fa7 |
parent 585 | 8f395aba0173 |
child 797 | 2f9cd56f48ee |
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 |
|
585 | 39 |
|
40 |
[author:] |
|
41 |
Claus Gittinger |
|
37 | 42 |
" |
43 |
! ! |
|
44 |
||
130 | 45 |
!MiniScroller methodsFor:'initialization'! |
37 | 46 |
|
47 |
initStyle |
|
119 | 48 |
|style lvl| |
49 |
||
37 | 50 |
super initStyle. |
119 | 51 |
style := StyleSheet name. |
37 | 52 |
style == #iris ifTrue:[ |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
53 |
tallyLevel := tallyMarks := 0. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
54 |
thumbEdgeStyle := nil. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
55 |
thumbLevel := thumbActiveLevel := 2. |
37 | 56 |
]. |
57 |
((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[ |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
58 |
style == #st80 ifTrue:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
59 |
lvl := 1. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
60 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
61 |
lvl := -1. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
62 |
]. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
63 |
self level:lvl. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
64 |
self borderWidth:0 |
37 | 65 |
]. |
66 |
shadowForm := lightForm := nil. |
|
67 |
fixThumbHeight := false |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
68 |
|
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
69 |
"Modified: 17.4.1996 / 13:57:20 / cg" |
555 | 70 |
! |
71 |
||
72 |
initialize |
|
73 |
"initialize - setup instvars from defaults" |
|
74 |
||
556 | 75 |
orientation isNil ifTrue:[orientation := #vertical]. |
555 | 76 |
super initialize. |
37 | 77 |
! ! |
205 | 78 |
|
79 |
!MiniScroller methodsFor:'queries'! |
|
80 |
||
81 |
preferredExtent |
|
572 | 82 |
"return my preferredExtent - make my width very small" |
205 | 83 |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
84 |
|defExt w h mm| |
205 | 85 |
|
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
86 |
preferredExtent notNil ifTrue:[ |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
87 |
^ preferredExtent |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
88 |
]. |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
89 |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
90 |
defExt := self class defaultExtent. |
205 | 91 |
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
|
92 |
orientation == #vertical ifTrue:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
93 |
h := defExt y. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
94 |
w := (device horizontalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
95 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
96 |
w := defExt x. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
97 |
h := (device verticalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
98 |
]. |
205 | 99 |
^ w @ h. |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
100 |
|
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
101 |
"Modified: 29.5.1996 / 12:11:32 / cg" |
205 | 102 |
! ! |
103 |
||
104 |
!MiniScroller class methodsFor:'documentation'! |
|
105 |
||
106 |
version |
|
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
107 |
^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.12 1996-05-29 10:23:10 cg Exp $' |
205 | 108 |
! ! |