MiniScroller.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 12 Aug 2022 22:38:28 +0100
branchjv
changeset 6857 58d68f671fa1
parent 5948 fd5f4677ea52
child 6493 8707ca079e1f
permissions -rw-r--r--
cherry-picked GenericToolbarIconLibrary.st from 020158c929bb: * 4ecbe3a93aec: Merge, HG Automerge * 8e9dcb2a6533: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * 58d88b144b2b: Merge, HG Automerge * 33c75b4a9999: #REFACTORING by mawalch, mawalch * 74f6a697ee26: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 7b8ba07cb680: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 0122e4e6c587: #FEATURE by cg, Claus Gittinger <cg@exept.de> * e296fa4b5ccb: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 6db292aae07d: #OTHER by mawalch, mawalch * 4366b65a2c8a: Copyright updates, Jan Vrany <jan.vrany@fit.cvut.cz> * 6b79d8bfdcd9: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 6a0103018ab9: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 87fbb0b00ca6: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * 5c977f62957a: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 0ccfd6c3c75f: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 3926b9ae0a3c: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * 8cebd063aeb5: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * 5445f50f8b2b: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * 272618940466: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 56bd6e2384a4: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * ffa93f79e6ae: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * 9410312a11cb: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 0036104e42ed: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 21fad03d5f11: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 8fd99a9d1d84: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * e4ed7fc09ca1: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 2c79a677e38a: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * 81227f5c6bfa: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * a7d893a3c1e1: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 7928d87ff963: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 6ed15ff79b07: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * a1a9e33d6daf: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 07f0100f7064: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 23d027d53e04: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 823ff944a2a5: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 046733c3db59: #REFACTORING by exept, Claus Gittinger <cg@exept.de> * 040921add07a: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 5777bb6431cb: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 27448b51c873: #FEATURE by exept, Claus Gittinger <cg@exept.de> * 1309dd75d7f5: #FEATURE by exept, Claus Gittinger <cg@exept.de> * 6415731ee5e5: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * c7802dbb6d7d: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 23bf1e00dc95: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 645f74e46f86: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 236c24a6ce6c: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 8db4c188c57a: #REFACTORING by exept, Claus Gittinger <cg@exept.de> * 5d1367f2f32a: #BUGFIX by exept, Claus Gittinger <cg@exept.de> * e012b62927a6: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * cec8de8d957c: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 8e9b8e68a545: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 5274979b30fb: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 73e483e60e05: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * dc6e33c97410: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 041ace9885e8: #TUNING by cg, Claus Gittinger <cg@exept.de> * bdfd1b407c29: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 52afc5fcc948: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * f9c23ed981dc: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 2678c19d0794: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 043c6c163b4f: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 5e779e09b004: version method, Claus Gittinger <cg@exept.de> * 51394e1ee44c: #FEATURE by exept, Claus Gittinger <cg@exept.de> * c6a190f66fb7: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 34b9831cd1ee: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 3fa783b7f48d: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * b46f5a561997: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 3bedf44e10d1: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * d0ccad2a39b8: #FEATURE by exept, Claus Gittinger <cg@exept.de> * 20f0d7ec75e0: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 86c9b274be4e: #FEATURE by stefan, Stefan Vogel <sv@exept.de> * 4c58992375bb: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 4facc54a9585: #OTHER by exept, Claus Gittinger <cg@exept.de> * d9b1c96aa2b8: #REFACTORING by exept, Claus Gittinger <cg@exept.de> * de0b89624b00: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 8d5a93082103: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * c06c9bee59db: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     1
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
64
c4e3323a5348 *** empty log message ***
claus
parents: 37
diff changeset
     3
	      All Rights Reserved
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     4
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    11
"
3165
58b08c376a6e *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1519
diff changeset
    12
"{ Package: 'stx:libwidg' }"
58b08c376a6e *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1519
diff changeset
    13
5628
57821ff41509 device access
Claus Gittinger <cg@exept.de>
parents: 4901
diff changeset
    14
"{ NameSpace: Smalltalk }"
57821ff41509 device access
Claus Gittinger <cg@exept.de>
parents: 4901
diff changeset
    15
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    16
Scroller subclass:#MiniScroller
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    17
	instanceVariableNames:''
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    18
	classVariableNames:'MiniScrollerSize'
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    19
	poolDictionaries:''
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    20
	category:'Views-Interactors'
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    21
!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    22
968
ba32bbfb7aad commentary
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
    23
!MiniScroller class methodsFor:'documentation'!
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    24
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    25
copyright
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    26
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    27
 COPYRIGHT (c) 1994 by Claus Gittinger
64
c4e3323a5348 *** empty log message ***
claus
parents: 37
diff changeset
    28
	      All Rights Reserved
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    29
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    30
 This software is furnished under a license and may be used
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    35
 hereby transferred.
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    36
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    37
!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    38
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    39
documentation
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    40
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    41
    like a scroller, but taking less screen space
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    42
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    43
    [author:]
1427
f73bcbd3b994 dont let miniscroller become too small (motif style)
Claus Gittinger <cg@exept.de>
parents: 1386
diff changeset
    44
	Claus Gittinger
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    45
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    46
! !
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    47
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    48
!MiniScroller class methodsFor:'defaults'!
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    49
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    50
updateStyleCache
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    51
    "extract values from the styleSheet and cache them in class variables"
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    52
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
    53
    <resource: #style (#'miniScroller.size')>
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    54
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
    55
    MiniScrollerSize := StyleSheet at:'miniScroller.size'.
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    56
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    57
    "
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    58
     self updateStyleCache
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    59
    "
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    60
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    61
    "Created: 15.8.1997 / 01:51:38 / cg"
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
    62
    "Modified: 20.10.1997 / 15:06:36 / cg"
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    63
! !
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
    64
130
claus
parents: 119
diff changeset
    65
!MiniScroller methodsFor:'initialization'!
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    66
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    67
initStyle
968
ba32bbfb7aad commentary
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
    68
    "setup viewStyle specifics"
ba32bbfb7aad commentary
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
    69
119
claus
parents: 64
diff changeset
    70
    |style lvl|
claus
parents: 64
diff changeset
    71
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    72
    super initStyle.
119
claus
parents: 64
diff changeset
    73
    style := StyleSheet name.
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    74
    style == #iris ifTrue:[
1519
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    75
        tallyLevel := tallyMarks := 0.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    76
        thumbEdgeStyle := nil.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    77
        thumbLevel := thumbActiveLevel := 2.
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    78
    ].
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    79
    ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[
1519
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    80
        style == #st80 ifTrue:[
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    81
            lvl := 1.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    82
            "/ lvl := 0.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    83
        ] ifFalse:[
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    84
            lvl := -1.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    85
        ].
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    86
        self level:lvl.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    87
        self borderWidth:0
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    88
    ].
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    89
    shadowForm := lightForm := nil.
1519
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    90
    fixThumbHeight := false.
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    91
1519
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    92
    thumbImage := nil.
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    93
7be06f0bb911 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    94
    "Modified: / 12.5.1998 / 20:41:52 / cg"
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    95
! !
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    96
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    97
!MiniScroller methodsFor:'queries'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    98
1116
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
    99
isMiniScroller
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   100
    ^ true
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   101
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   102
    "Created: 7.3.1997 / 16:20:22 / cg"
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   103
!
e4a28d306bd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   104
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   105
preferredExtent
572
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   106
    "return my preferredExtent - make my width very small"
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   107
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   108
    |defExt w h mm|
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   109
3762
98ab29020786 changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3498
diff changeset
   110
    "/ If I have an explicit preferredExtent..
98ab29020786 changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3498
diff changeset
   111
    explicitExtent notNil ifTrue:[
98ab29020786 changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3498
diff changeset
   112
        ^ explicitExtent
98ab29020786 changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3498
diff changeset
   113
    ].
797
2f9cd56f48ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 714
diff changeset
   114
3762
98ab29020786 changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3498
diff changeset
   115
    "/ If I have a cached preferredExtent value..
714
5ff02d2d9fa7 care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   116
    preferredExtent notNil ifTrue:[
3498
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   117
        ^ preferredExtent
714
5ff02d2d9fa7 care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   118
    ].
5ff02d2d9fa7 care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   119
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   120
    defExt := self class defaultExtent.
1114
ddd752f834d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 968
diff changeset
   121
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   122
    (mm := MiniScrollerSize) isNil ifTrue:[
3498
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   123
        mm := (thumbLevel ~~ 0) ifTrue:[1.8] ifFalse:[1.5].
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   124
        mm := (thumbLevel ~~ 0) ifTrue:[2.5] ifFalse:[2].
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   125
        styleSheet name == #st80 ifTrue:[
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   126
            mm := 2
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   127
        ].
1305
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   128
    ].
02af46047b4a allow miniscrollers thickness to be defined in styleSheet
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   129
1114
ddd752f834d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 968
diff changeset
   130
    w := defExt x.
ddd752f834d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 968
diff changeset
   131
    h := defExt y.
ddd752f834d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 968
diff changeset
   132
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   133
    orientation == #vertical ifTrue:[
5628
57821ff41509 device access
Claus Gittinger <cg@exept.de>
parents: 4901
diff changeset
   134
        w := (device horizontalPixelPerMillimeter asFloat * mm) rounded.
5948
fd5f4677ea52 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5628
diff changeset
   135
        "/ don't let it become too small for thumb ...
3498
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   136
        w := w max:((level abs + thumbLevel) * 2 + 1).
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   137
    ] ifFalse:[
5628
57821ff41509 device access
Claus Gittinger <cg@exept.de>
parents: 4901
diff changeset
   138
        h := (device verticalPixelPerMillimeter asFloat * mm) rounded.
5948
fd5f4677ea52 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 5628
diff changeset
   139
        "/ don't let it become too small for thumb ...
3498
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   140
        h := h max:((level abs + thumbLevel) * 2 + 1).
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   141
    ].
797
2f9cd56f48ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 714
diff changeset
   142
    preferredExtent := w @ h.
2f9cd56f48ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 714
diff changeset
   143
    ^ preferredExtent.
539
c7c5585e77f6 use common code for H/V miniScrollers
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   144
3498
1170b64bde6e default thicknes changed a bit
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
   145
    "Modified: / 08-10-2007 / 17:24:32 / cg"
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   146
! !
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   147
968
ba32bbfb7aad commentary
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   148
!MiniScroller class methodsFor:'documentation'!
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   149
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   150
version
5628
57821ff41509 device access
Claus Gittinger <cg@exept.de>
parents: 4901
diff changeset
   151
    ^ '$Header$'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   152
! !
4901
4fc7b7366975 class: MiniScroller
Stefan Vogel <sv@exept.de>
parents: 3762
diff changeset
   153