author | Claus Gittinger <cg@exept.de> |
Wed, 22 Jan 1997 18:25:17 +0100 | |
changeset 968 | ba32bbfb7aad |
parent 797 | 2f9cd56f48ee |
child 1114 | ddd752f834d5 |
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 |
||
968 | 20 |
!MiniScroller class methodsFor:'documentation'! |
37 | 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 |
|
968 | 48 |
"setup viewStyle specifics" |
49 |
||
119 | 50 |
|style lvl| |
51 |
||
37 | 52 |
super initStyle. |
119 | 53 |
style := StyleSheet name. |
37 | 54 |
style == #iris ifTrue:[ |
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
55 |
tallyLevel := tallyMarks := 0. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
56 |
thumbEdgeStyle := nil. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
57 |
thumbLevel := thumbActiveLevel := 2. |
37 | 58 |
]. |
59 |
((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[ |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
60 |
style == #st80 ifTrue:[ |
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 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
63 |
lvl := -1. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
64 |
]. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
65 |
self level:lvl. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
66 |
self borderWidth:0 |
37 | 67 |
]. |
68 |
shadowForm := lightForm := nil. |
|
69 |
fixThumbHeight := false |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
70 |
|
968 | 71 |
"Modified: 22.1.1997 / 11:57:30 / cg" |
555 | 72 |
! |
73 |
||
74 |
initialize |
|
75 |
"initialize - setup instvars from defaults" |
|
76 |
||
556 | 77 |
orientation isNil ifTrue:[orientation := #vertical]. |
555 | 78 |
super initialize. |
37 | 79 |
! ! |
205 | 80 |
|
81 |
!MiniScroller methodsFor:'queries'! |
|
82 |
||
83 |
preferredExtent |
|
572 | 84 |
"return my preferredExtent - make my width very small" |
205 | 85 |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
86 |
|defExt w h mm| |
205 | 87 |
|
797 | 88 |
"/ If I have an explicit preferredExtent .. |
89 |
||
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
90 |
preferredExtent notNil ifTrue:[ |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
91 |
^ preferredExtent |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
92 |
]. |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
93 |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
94 |
defExt := self class defaultExtent. |
205 | 95 |
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
|
96 |
orientation == #vertical ifTrue:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
97 |
h := defExt y. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
98 |
w := (device horizontalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
99 |
] ifFalse:[ |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
100 |
w := defExt x. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
101 |
h := (device verticalPixelPerMillimeter asFloat * mm) rounded. |
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
102 |
]. |
797 | 103 |
preferredExtent := w @ h. |
104 |
^ preferredExtent. |
|
539
c7c5585e77f6
use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
105 |
|
797 | 106 |
"Modified: 19.7.1996 / 20:46:21 / cg" |
205 | 107 |
! ! |
108 |
||
968 | 109 |
!MiniScroller class methodsFor:'documentation'! |
205 | 110 |
|
111 |
version |
|
968 | 112 |
^ '$Header: /cvs/stx/stx/libwidg/MiniScroller.st,v 1.14 1997-01-22 17:24:23 cg Exp $' |
205 | 113 |
! ! |