ScrollableView.st
author Claus Gittinger <cg@exept.de>
Wed, 02 Feb 2011 13:29:16 +0100
changeset 4222 53a2a6433f59
parent 3767 30ede36bb2ee
child 4827 243957c13134
permissions -rw-r--r--
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
     3
              All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
2195
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
    12
"{ Package: 'stx:libwidg' }"
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
    13
119
claus
parents: 113
diff changeset
    14
SimpleView subclass:#ScrollableView
3013
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    15
	instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    16
		hideVScrollBar hideHScrollBar hasHorizontalScrollBar
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    17
		hasVerticalScrollBar horizontalMini verticalMini vScrollBarHidden
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    18
		hScrollBarHidden scrolledViewHMargin scrolledViewVMargin
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    19
		scrollBarVSpacing scrollBarHSpacing scrolledViewLayout
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    20
		hScrollBarLayout vScrollBarLayout'
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    21
	classVariableNames:'DefaultScrolledViewLevel DefaultScrolledViewMargin
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    22
		DefaultScrollBarSpacing DefaultScrolledViewBorderWidth
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    23
		DefaultLevel DefaultScrollBarLevel MyDefaultViewBackgroundColor'
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    24
	poolDictionaries:''
41f3341f9c32 *** empty log message ***
ca
parents: 3012
diff changeset
    25
	category:'Views-Basic'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    26
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    27
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    28
!ScrollableView class methodsFor:'documentation'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    29
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    30
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    31
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    32
 COPYRIGHT (c) 1989 by Claus Gittinger
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    33
              All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    34
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    35
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    36
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    38
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    39
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    40
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    41
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    42
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    43
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    44
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    45
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    46
    a view containing a scrollbar and some other (slave-)view.
130
claus
parents: 122
diff changeset
    47
    This view wraps scrollbar(s) around the view to be scrolled.
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    48
    The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    49
    and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved.
130
claus
parents: 122
diff changeset
    50
    The view itself has to implement these (there is a default implementation
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    51
    in the common View class for this - so your widgets usually dont have to
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    52
    care for this).
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    53
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    54
    For the scrollbars to know about the full (maximum) size, the view
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    55
    MUST implement #heightOfContents and/or #widthOfContents.
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    56
    The values returned by those methods are used to compute the fraction
130
claus
parents: 122
diff changeset
    57
    which is visible (i.e. the scrollers thumb heights).
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    58
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    59
    There are three ways to setup a scrollableView:
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    60
    if the type of the view to be scrolled is known in advance,
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    61
    use:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    62
        v := ScrollableView for:<ViewClass>
130
claus
parents: 122
diff changeset
    63
    or:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    64
        v := ScrollableView for:<ViewClass> in:someSuperView
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    65
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    66
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    67
    otherwise, create an empty scrollableView with:
130
claus
parents: 122
diff changeset
    68
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    69
        v := ScrollableView new
130
claus
parents: 122
diff changeset
    70
    or:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    71
        v := ScrollableView in:someSuperView
130
claus
parents: 122
diff changeset
    72
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    73
    and define the view later with:
130
claus
parents: 122
diff changeset
    74
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    75
        v scrolledView:aViewToBeScrolled
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    76
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    77
130
claus
parents: 122
diff changeset
    78
    Finally, if the view to be scrolled has been already created,
claus
parents: 122
diff changeset
    79
    use:
claus
parents: 122
diff changeset
    80
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    81
        v := ScrollableView forView:aViewToBeScrolled
130
claus
parents: 122
diff changeset
    82
    or:    
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    83
        v := ScrollableView forView:aViewToBeScrolled in:someSuperView
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    84
130
claus
parents: 122
diff changeset
    85
    It is also possible to change the scrolledView later (even multiple times).
claus
parents: 122
diff changeset
    86
    This may be useful, if different views are needed to display different types
claus
parents: 122
diff changeset
    87
    of data (see example2) and at creation time, it is not known what type
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    88
    of view is required (multidocument format applications).
130
claus
parents: 122
diff changeset
    89
3568
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
    90
    If you want to scroll a bunch of other views (instead of a views contents),
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    91
    you need a companion class (ViewScroller). See the documentation there.
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    92
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    93
    By default, scrollbars are full size scrollbars - for horizontal scrolling
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    94
    (which is less often used), scrollableViews can optionally be created with
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    95
    miniscrollers which take up less screen space.
130
claus
parents: 122
diff changeset
    96
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
    97
    Recent changes:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    98
        Originally, there where two classes, for vertical-only and
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
    99
        horizontal+vertical scrollability.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   100
        These have now been merged into the common ScrollableView class,
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   101
        and each scrollability can be controlled individually.
3568
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
   102
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
   103
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   104
    [author:]
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   105
        Claus Gittinger
130
claus
parents: 122
diff changeset
   106
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   107
    [see also:]
3568
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
   108
        ScrollBar 
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
   109
        Scroller
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
   110
        ScrolledView
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   111
"
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   112
!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   113
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   114
examples
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   115
"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   116
  simple scrolled text:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   117
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   118
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   119
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   120
        top := StandardSystemView label:'scroll example1'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   121
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   122
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   123
        scr := ScrollableView for:EditTextView in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   124
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   125
        txt := scr scrolledView.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   126
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   127
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   128
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   129
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   130
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   131
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   132
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   133
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   134
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   135
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   136
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   137
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   138
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   139
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
   140
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   141
  changing the scrolledView later:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   142
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   143
        |top scr txtView1 txtView2 browserView|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   144
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   145
        top := StandardSystemView label:'scroll example2'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   146
        top extent:300@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   147
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   148
        scr := ScrollableView in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   149
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   150
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   151
        top open.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   152
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   153
        (Delay forSeconds:5) wait.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   154
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   155
        txtView1 := EditTextView new.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   156
        txtView1 list:#(
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   157
                        'wait 5 seconds to see the other text'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   158
                        'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   159
                        'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   160
                        'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   161
                        'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   162
                        'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   163
                        'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   164
                        'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   165
                        'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   166
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   167
        scr scrolledView:txtView1.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   168
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   169
        (Delay forSeconds:5) wait.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   170
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   171
        txtView2 := EditTextView new.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   172
        txtView2 list:#('this is the other views text' 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   173
                        'alternative line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   174
                        'alternative line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   175
                        'alternative line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   176
                        'alternative line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   177
                        'alternative line6').
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   178
        scr scrolledView:txtView2.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   179
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   180
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   181
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   182
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   183
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   184
  using a miniscroller:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   185
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   186
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   187
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   188
        top := StandardSystemView label:'scroll example3'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   189
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   190
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   191
        scr := ScrollableView for:EditTextView miniScroller:true in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   192
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   193
        txt := scr scrolledView.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   194
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   195
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   196
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   197
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   198
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   199
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   200
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   201
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   202
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   203
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   204
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   205
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   206
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   207
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   208
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   209
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   210
  scrolling in both directions:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   211
    Notice: HVScrollableView remains existent for backward compatibility;
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   212
            scrollability can now be controlled in both directions at any
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   213
            time (see examples below).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   214
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   215
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   216
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   217
        top := StandardSystemView label:'scroll example4'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   218
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   219
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   220
        scr := HVScrollableView for:EditTextView in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   221
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   222
        txt := scr scrolledView.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   223
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   224
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   225
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   226
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   227
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   228
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   229
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   230
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   231
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   232
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   233
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   234
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   235
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   236
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   237
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   238
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   239
  using a full scroller vertically, miniscroller horizontally:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   240
    Notice: HVScrollableView remains existent for backward compatibility;
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   241
            scrollability can now be controlled in both directions at any
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   242
            time (see examples below).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   243
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   244
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   245
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   246
        top := StandardSystemView label:'scroll example5'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   247
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   248
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   249
        scr := HVScrollableView for:EditTextView miniScrollerH:true in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   250
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   251
        txt := scr scrolledView.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   252
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   253
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   254
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   255
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   256
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   257
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   258
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   259
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   260
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   261
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   262
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   263
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   264
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   265
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   266
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   267
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   268
  using miniscrollers for both directions:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   269
    Notice: HVScrollableView remains existent for backward compatibility;
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   270
            scrollability can now be controlled in both directions at any
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   271
            time (see examples below).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   272
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   273
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   274
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   275
        top := StandardSystemView label:'scroll example6'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   276
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   277
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   278
        scr := HVScrollableView for:EditTextView miniScroller:true in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   279
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   280
        txt := scr scrolledView.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   281
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   282
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   283
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   284
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   285
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   286
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   287
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   288
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   289
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   290
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   291
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   292
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   293
                                                                        [exEnd]
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   294
  controlling scrollability:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   295
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   296
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   297
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   298
        top := StandardSystemView label:'scroll example6'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   299
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   300
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   301
        txt := EditTextView new.
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   302
        
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   303
        scr := ScrollableView forView:txt in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   304
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   305
        scr horizontalScrollable:true.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   306
        scr verticalScrollable:false.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   307
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   308
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   309
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   310
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   311
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   312
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   313
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   314
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   315
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   316
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   317
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   318
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   319
                                                                        [exEnd]
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   320
  controlling scrollability and miniScroller:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   321
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   322
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   323
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   324
        top := StandardSystemView label:'scroll example6'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   325
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   326
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   327
        txt := EditTextView new.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   328
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   329
        scr := ScrollableView forView:txt in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   330
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   331
        scr horizontalScrollable:true; horizontalMini:false.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   332
        scr verticalScrollable:true; verticalMini:true.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   333
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   334
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   335
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   336
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   337
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   338
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   339
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   340
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   341
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   342
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   343
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   344
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   345
                                                                        [exEnd]
1459
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
   346
  autohiding scrollbars (edit the text to make scrollbars visible/invisible)
2e96c4f14554 documentation comments
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
   347
  (NOTICE:
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   348
        this is controlled by the styleSheet and 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   349
        should normally NOT be done by the program):
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   350
                                                                        [exBegin]
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   351
        |top scr txt|
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   352
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   353
        top := StandardSystemView label:'scroll example6'.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   354
        top extent:200@100.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   355
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   356
        txt := EditTextView new.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   357
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   358
        scr := ScrollableView forView:txt in:top.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   359
        scr origin:0.0@0.0 corner:1.0@1.0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   360
        scr horizontalScrollable:true; horizontalMini:false.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   361
        scr verticalScrollable:true; verticalMini:true.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   362
        scr autoHideScrollBars:true.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   363
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   364
        txt list:#('line1'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   365
                   'line2'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   366
                   'line3'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   367
                   'line4'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   368
                   'line5'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   369
                   'line7'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   370
                   'line8'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   371
                   'line9'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   372
                   'line10'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   373
                  ).
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   374
        top open
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   375
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   376
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   377
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   378
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   379
!ScrollableView class methodsFor:'instance creation'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   380
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   381
for:aViewClass
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   382
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   383
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   384
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   385
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   386
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   387
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   388
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   389
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   390
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   391
        miniScrollerV:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   392
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   393
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   394
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   395
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   396
    "Created: 6.3.1997 / 18:06:22 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   397
    "Modified: 6.3.1997 / 23:18:32 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   398
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   399
1183
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   400
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   401
    "return a new scrolling view scrolling an instance of aViewClass.
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   402
     The subview is created here.
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   403
     The view will have full scrollbars if the corresponding miniH/miniV
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   404
     is false, miniscrollers if true."
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   405
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   406
    |newView|
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   407
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   408
    aViewClass notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   409
        newView := aViewClass new.
1183
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   410
    ].
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   411
    ^ self
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   412
        forView:newView
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   413
        hasHorizontalScrollBar:hasH 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   414
        hasVerticalScrollBar:hasV 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   415
        miniScrollerH:miniH 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   416
        miniScrollerV:miniV 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   417
        origin:nil 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   418
        corner:nil 
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   419
        in:nil
1183
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   420
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   421
    "Created: 7.4.1997 / 19:00:14 / cg"
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   422
!
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   423
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   424
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   425
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   426
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   427
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   428
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   429
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   430
    |newView|
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   431
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   432
    aViewClass notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   433
        newView := aViewClass new.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   434
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   435
    ^ self
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   436
        forView:newView
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   437
        hasHorizontalScrollBar:hasH 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   438
        hasVerticalScrollBar:hasV 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   439
        miniScrollerH:miniH 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   440
        miniScrollerV:miniV 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   441
        origin:org 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   442
        corner:corn 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   443
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   444
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   445
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   446
     |top scr|
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   447
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   448
     top := StandardSystemView extent:200@200.
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   449
     scr := ScrollableView for:nil
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   450
                 hasHorizontalScrollBar:true
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   451
                 hasVerticalScrollBar:true
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   452
                 miniScrollerH:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   453
                 miniScrollerV:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   454
                 origin:0.0@0.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   455
                 corner:1.0@1.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   456
                 in:top.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   457
     top open
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   458
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   459
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   460
    "Modified: 6.3.1997 / 18:36:01 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   462
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   463
for:aViewClass in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   464
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   465
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   466
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   467
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   468
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   469
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   470
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   471
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   472
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   473
        miniScrollerV:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   474
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   475
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   476
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   477
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   478
    "Modified: 6.3.1997 / 23:18:41 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   479
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   480
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   481
for:aViewClass miniScroller:mini
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   482
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   484
     The view will have full scrollbars if mini is false, miniscrollers
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   485
     if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   486
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   487
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   488
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   489
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   490
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   491
        miniScrollerH:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   492
        miniScrollerV:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   493
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   494
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   495
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   496
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   497
    "Modified: 6.3.1997 / 23:18:45 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   499
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   500
for:aViewClass miniScroller:mini in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   501
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   502
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   503
     The view will have full scrollbars if mini is false, miniscrollers
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   504
     if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   505
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   506
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   507
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   508
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   509
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   510
        miniScrollerH:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   511
        miniScrollerV:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   512
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   513
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   514
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   515
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   516
    "Modified: 6.3.1997 / 23:18:50 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   517
!
153
claus
parents: 132
diff changeset
   518
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   519
for:aViewClass miniScroller:mini origin:org corner:corn in:aView
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   520
    "return a new scrolling view scrolling an instance of aViewClass.
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   521
     The subview is created here.
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   522
     The view will have full scrollbars if mini is false, miniscrollers
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   523
     if true."
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   524
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   525
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   526
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   527
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   528
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   529
        miniScrollerH:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   530
        miniScrollerV:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   531
        origin:org
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   532
        corner:corn 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   533
        in:aView
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   534
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   535
    "Modified: 6.3.1997 / 23:18:53 / cg"
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   536
!
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   537
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   538
for:aViewClass miniScrollerH:miniH
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   539
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   540
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   541
     The view will have full scrollbars if miniH is false, 
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   542
     and a horizontal miniscroller if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   543
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   544
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   545
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   546
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   547
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   548
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   549
        miniScrollerV:false
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   550
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   551
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   552
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   553
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   554
    "Modified: 6.3.1997 / 18:30:15 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   555
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   556
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   557
for:aViewClass miniScrollerH:miniH in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   558
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   559
     The subview is created here.
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   560
     The view will have full scrollbars if the corresponding miniH/miniV
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   561
     is false, miniscrollers if true."
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   562
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   563
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   564
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   565
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   566
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   567
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   568
        miniScrollerV:false
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   569
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   570
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   571
        in:aView
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   572
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   573
    "Modified: 6.3.1997 / 18:30:31 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   574
!
153
claus
parents: 132
diff changeset
   575
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   576
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   577
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   578
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   579
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   580
     is false, miniscrollers if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   581
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   582
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   583
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   584
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   585
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   586
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   587
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   588
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   589
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   590
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   591
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   592
    "Modified: 6.3.1997 / 18:30:47 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   593
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   594
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   595
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   596
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   597
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   598
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   599
     is false, miniscrollers if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   600
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   601
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   602
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   603
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   604
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   605
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   606
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   607
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   608
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   609
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   610
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   611
    "Modified: 6.3.1997 / 18:31:02 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   612
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   613
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   614
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   615
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   616
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   617
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   618
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   619
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   620
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   621
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   622
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   623
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   624
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   625
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   626
        origin:org
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   627
        corner:corn 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   628
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   629
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   630
    "Modified: 6.3.1997 / 18:31:17 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   631
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   632
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   633
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   634
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   635
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   636
     The view will have a full horizontal scrollbar if miniH is false,
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   637
     a miniscroller if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   638
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   639
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   640
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   641
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   642
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   643
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   644
        miniScrollerV:false
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   645
        origin:org
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   646
        corner:corn 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   647
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   648
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   649
    "Modified: 6.3.1997 / 18:31:28 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   650
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   651
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   652
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   653
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   654
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   655
     The view will have a full vertical scrollbar if miniV is false,
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   656
     a miniscroller if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   657
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   658
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   659
        for:aViewClass
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   660
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   661
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   662
        miniScrollerH:false 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   663
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   664
        origin:org
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   665
        corner:corn 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   666
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   667
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   668
    "Modified: 6.3.1997 / 18:31:41 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   669
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   670
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   671
for:aViewClass origin:org corner:corner in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   672
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   673
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   674
     The view will have full scrollbars."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   675
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   676
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   677
        for:aViewClass
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   678
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   679
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   680
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   681
        miniScrollerV:false
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   682
        origin:org
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   683
        corner:corner 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   684
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   685
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   686
    "Modified: 6.3.1997 / 23:19:05 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   687
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   688
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   689
forView:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   690
    "return a new scrolling view scrolling aView.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   691
     The view will have full scrollbars."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   692
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   693
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   694
        forView:aView
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   695
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   696
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   697
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   698
        miniScrollerV:false
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   699
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   700
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   701
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   702
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   703
    "Modified: 6.3.1997 / 23:19:08 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   704
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   705
3590
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   706
forView:aView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   707
    "return a new scrolling view scrolling a aView.
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   708
     The view will have full scrollbars if the corresponding miniH/miniV
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   709
     is false, miniscrollers if true."
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   710
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   711
    ^ self
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   712
        forView:aView
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   713
        hasHorizontalScrollBar:hasH 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   714
        hasVerticalScrollBar:hasV 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   715
        miniScrollerH:miniH 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   716
        miniScrollerV:miniV 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   717
        origin:nil 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   718
        corner:nil 
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   719
        in:nil
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   720
!
1380c107d581 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
   721
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   722
forView:aScrolledView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   723
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   724
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   725
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   726
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   727
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   728
    |newView dev|
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   729
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   730
    aView notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   731
        dev := aView graphicsDevice
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   732
    ] ifFalse:[ 
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   733
        dev := Screen current
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   734
    ].
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   735
    newView := self basicNew device:dev.
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
   736
    "/ preset flags to avoid creation and later destruction of scrollBars ...
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
   737
    newView setVertical:hasV mini:miniV horizontal:hasH mini:miniH.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   738
    newView initialize.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   739
    newView setupVertical:hasV mini:miniV horizontal:hasH mini:miniH.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   740
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   741
    aScrolledView notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   742
        newView scrolledView:aScrolledView.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   743
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   744
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   745
    org notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   746
        newView origin:org
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   747
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   748
    corn notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   749
        newView corner:corn
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   750
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   751
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   752
    aView notNil ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   753
        aView addSubView:newView
153
claus
parents: 132
diff changeset
   754
    ].
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   755
    ^ newView
703
8889152157c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   756
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   757
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   758
     |top scr|
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   759
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   760
     top := StandardSystemView extent:200@200.
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   761
     scr := ScrollableView 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   762
                 forView:(TextView new)
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   763
                 hasHorizontalScrollBar:true
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   764
                 hasVerticalScrollBar:true
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   765
                 miniScrollerH:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   766
                 miniScrollerV:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   767
                 origin:0.0@0.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   768
                 corner:1.0@1.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   769
                 in:top.
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   770
     top open
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   771
    "
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   772
    "
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   773
     |top scr|
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   774
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   775
     top := StandardSystemView extent:200@200.
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   776
     scr := ScrollableView 
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   777
                 forView:(TextView new)
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   778
                 hasHorizontalScrollBar:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   779
                 hasVerticalScrollBar:true
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   780
                 miniScrollerH:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   781
                 miniScrollerV:false
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   782
                 origin:0.0@0.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   783
                 corner:1.0@1.0
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   784
                 in:top.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   785
     top open
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   786
    "
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   787
1135
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
   788
    "Modified: 6.3.1997 / 18:42:40 / cg"
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
   789
    "Modified: 19.3.1997 / 15:32:51 / stefan"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   790
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   791
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   792
forView:aView in:aSuperView
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   793
    "return a new scrolling view scrolling aView.
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   794
     The view will have full scrollbars."
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   795
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   796
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   797
        forView:aView
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   798
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   799
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   800
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   801
        miniScrollerV:false
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   802
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   803
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   804
        in:aSuperView
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   805
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   806
    "Modified: 6.3.1997 / 23:19:12 / cg"
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   807
!
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   808
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   809
forView:aView miniScrollerH:mini
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   810
    "return a new scrolling view scrolling aView.
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   811
     The view will have a full vertical scrollbar and a horizontal
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   812
     miniScroller if mini is true."
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   813
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   814
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   815
        forView:aView
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   816
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   817
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   818
        miniScrollerH:mini 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   819
        miniScrollerV:false
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   820
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   821
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   822
        in:nil
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   823
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   824
    "Modified: 6.3.1997 / 18:32:58 / cg"
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   825
!
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   826
3401
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   827
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   828
    "return a new scrolling view, scrolling aView.
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   829
     The view will have full scrollbars if the corresponding miniH/miniV
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   830
     is false, miniscrollers if true."
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   831
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   832
    ^ self forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:nil
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   833
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   834
    "Created: / 06-10-2006 / 14:30:30 / cg"
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   835
!
2090b3f38af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   836
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   837
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   838
    "return a new scrolling view, scrolling aView.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   839
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   840
     is false, miniscrollers if true."
153
claus
parents: 132
diff changeset
   841
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   842
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   843
        forView:scrolledView
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   844
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   845
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   846
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   847
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   848
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   849
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   850
        in:aView
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   851
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   852
    "Modified: 6.3.1997 / 18:33:20 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   853
!
153
claus
parents: 132
diff changeset
   854
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   855
in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   856
    "return a new scrolling view to be contained in aView.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   857
     There is no slave view now - this has to be set later via
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   858
     the scrolledView: method.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   859
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   860
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   861
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   862
        forView:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   863
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   864
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   865
        miniScrollerH:false 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   866
        miniScrollerV:false
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   867
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   868
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   869
        in:aView
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   870
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   871
    "Modified: 6.3.1997 / 23:19:19 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   872
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   873
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   874
miniScroller:mini
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   875
    "return a new scrolling view. The subview will be created later.
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   876
     The view will have full scrollbars if mini is false, 
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   877
     miniscrollers if true."
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   878
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   879
    ^ self 
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   880
        forView:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   881
        hasHorizontalScrollBar:self defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   882
        hasVerticalScrollBar:self defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   883
        miniScrollerH:mini 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   884
        miniScrollerV:mini
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   885
        origin:nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   886
        corner:nil 
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   887
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   888
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   889
    "Modified: 6.3.1997 / 23:19:21 / cg"
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   890
!
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   891
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   892
miniScrollerH:miniH
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   893
    "return a new scrolling view. The subview will be created later.
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   894
     The view will have full scrollbars if miniH is false, 
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   895
     and a horizontal miniscroller if true."
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   896
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   897
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   898
        forView:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   899
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   900
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   901
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   902
        miniScrollerV:false
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   903
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   904
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   905
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   906
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   907
    "Modified: 6.3.1997 / 18:34:06 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   908
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   909
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   910
miniScrollerH:miniH miniScrollerV:miniV
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   911
    "return a new scrolling view. The subview will be created later.
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   912
     The view will have full scrollbars if the corresponding miniH/miniV
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   913
     is false, miniscrollers if true."
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   914
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   915
    ^ self 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   916
        forView:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   917
        hasHorizontalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   918
        hasVerticalScrollBar:true
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   919
        miniScrollerH:miniH 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   920
        miniScrollerV:miniV
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   921
        origin:nil
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   922
        corner:nil 
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   923
        in:nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   924
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   925
    "Modified: 6.3.1997 / 18:34:16 / cg"
1719
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   926
!
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   927
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   928
new
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   929
    "return a new scrolling view.
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   930
     There is no slave view now - this has to be set later via
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   931
     the scrolledView: method.
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   932
     The view will have full scrollbars."
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   933
2777
4e447946cac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   934
    ^ self in:nil
1719
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   935
3d4adf98c079 added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents: 1695
diff changeset
   936
    "Modified: / 12.11.1998 / 14:55:54 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   937
! !
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   938
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   939
!ScrollableView class methodsFor:'defaults'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   940
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   941
defaultHorizontalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   942
    ^ false
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   943
!
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   944
1378
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   945
defaultScrollBarPosition
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   946
    "return the default position of the scrollBar.
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   947
     (max be of interest to panels, to make the handlePosition alike)"
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   948
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   949
    <resource: #style (#'scrollBar.position')>
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   950
1870
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   951
    ^ StyleSheet at:#'scrollBar.position' default:#left.
1378
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   952
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   953
    "
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   954
     self defaultScrollBarPosition
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   955
    "
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   956
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   957
    "Modified: / 31.10.1997 / 12:58:15 / cg"
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   958
!
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   959
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   960
defaultVerticalScrollable
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   961
    ^ true
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   962
!
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
   963
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   964
updateStyleCache
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   965
    "extract values from the styleSheet and cache them in class variables"
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   966
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   967
    <resource: #style (#'scrolledView.level' #'scrolledView.margin'
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   968
                       #'scrolledView.borderWidth'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   969
                       #'scrollBar.spacing' #'scrollBar.level'
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   970
                       #'scrollableView.level' #'scrollableView.backgroundColor' )>
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   971
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   972
    |defLevel defMargin defSpacing|
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   973
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   974
    StyleSheet is3D ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   975
        defLevel := -1.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   976
        defMargin := ViewSpacing // 2.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   977
        defSpacing := defMargin.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   978
    ] ifFalse:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   979
        defLevel := 0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   980
        defMargin := 0.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
   981
        defSpacing := 0
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   982
    ].
1870
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   983
    DefaultScrolledViewLevel := StyleSheet at:#'scrolledView.level' default:defLevel.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   984
    DefaultScrolledViewBorderWidth := StyleSheet at:#'scrolledView.borderWidth' default:nil.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   985
    DefaultScrolledViewMargin := StyleSheet at:#'scrolledView.margin' default:defMargin.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   986
    DefaultScrollBarSpacing := StyleSheet at:#'scrollBar.spacing' default:defSpacing.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   987
    DefaultLevel := StyleSheet at:#'scrollableView.level' default:nil.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   988
    DefaultScrollBarLevel := StyleSheet at:#'scrollBar.level' default:nil.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   989
    MyDefaultViewBackgroundColor := StyleSheet at:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   990
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   991
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   992
     self updateStyleCache
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   993
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   994
1378
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
   995
    "Modified: / 31.10.1997 / 20:57:10 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   996
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   997
1140
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   998
!ScrollableView methodsFor:'accessing-behavior'!
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   999
1556
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1000
autoHideHorizontalScrollBar:aBoolean
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1001
    "set/clear the flag which controls if the horizontal scrollBar should
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1002
     be made invisible dynamically, if there is nothing to scroll
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1003
     (and shown if there is). 
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1004
     This flags setting is normally controlled by the styleSheet."
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1005
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1006
    hideHScrollBar := aBoolean.
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1007
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1008
    "Modified: 19.3.1997 / 16:28:42 / cg"
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1009
    "Created: 19.3.1997 / 17:24:39 / cg"
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1010
!
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1011
1140
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1012
autoHideScrollBars:aBoolean
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1013
    "set/clear the flag which controls if scrollBars should
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1014
     be made invisible dynamically, if there is nothing to scroll
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1015
     (and shown if there is). 
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1016
     This flags setting is normally controlled by the styleSheet."
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1017
1556
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1018
    hideVScrollBar := hideHScrollBar := aBoolean.
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1019
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1020
    "Modified: 19.3.1997 / 16:28:42 / cg"
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1021
    "Created: 19.3.1997 / 17:24:39 / cg"
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1022
!
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1023
1904
9f887101f2b0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
  1024
autoHideVerticalScrollBar:aBoolean
1556
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1025
    "set/clear the flag which controls if the vertical scrollBar should
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1026
     be made invisible dynamically, if there is nothing to scroll
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1027
     (and shown if there is). 
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1028
     This flags setting is normally controlled by the styleSheet."
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1029
c4c7839aced4 allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents: 1549
diff changeset
  1030
    hideVScrollBar := aBoolean.
1140
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1031
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1032
    "Modified: 19.3.1997 / 16:28:42 / cg"
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1033
    "Created: 19.3.1997 / 17:24:39 / cg"
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1034
! !
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  1035
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1036
!ScrollableView methodsFor:'accessing-components'!
119
claus
parents: 113
diff changeset
  1037
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1038
horizontalScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1039
    "return the horizontal scrollbar (or nil, if there is none)"
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1040
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1041
"/    hScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1042
"/        self horizontalScrollable:true.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1043
"/    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1044
    ^ hScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1045
1549
b64b2dd7d5df create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
  1046
    "Created: / 6.3.1997 / 18:06:23 / cg"
b64b2dd7d5df create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
  1047
    "Modified: / 25.5.1998 / 12:53:58 / cg"
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1048
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1049
1923
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1050
removeSubView:aView
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1051
    super removeSubView:aView.
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1052
    aView == scrolledView ifTrue:[
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1053
        scrolledView := nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1054
    ].
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1055
    aView == vScrollBar ifTrue:[
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1056
        vScrollBar := nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1057
    ].
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1058
    aView == hScrollBar ifTrue:[
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1059
        hScrollBar := nil
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1060
    ].
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1061
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1062
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1063
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1064
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1065
!
cc9c075f0bc5 defaults for hasHVScrollbar now defined in a class method.
tm
parents: 1904
diff changeset
  1066
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1067
scrollBar
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1068
    "return the vertical scrollbar (or nil, if there is none)"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1069
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1070
"/    vScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1071
"/        self verticalScrollable:true.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1072
"/    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1073
    ^ vScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1074
1549
b64b2dd7d5df create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
  1075
    "Created: / 6.3.1997 / 18:06:23 / cg"
b64b2dd7d5df create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
  1076
    "Modified: / 25.5.1998 / 12:54:06 / cg"
119
claus
parents: 113
diff changeset
  1077
!
claus
parents: 113
diff changeset
  1078
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1079
scrolledView
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1080
    "return the scrolled view (or nil, if there is none)"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1081
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1082
    ^ scrolledView
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1083
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1084
    "Modified: 6.3.1997 / 16:48:09 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1085
    "Created: 6.3.1997 / 18:06:23 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1086
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1087
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1088
scrolledView:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1089
    "set the view to scroll"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1090
2319
83b000a1928a ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents: 2272
diff changeset
  1091
    aView == scrolledView ifTrue:[^ self "already"].
83b000a1928a ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents: 2272
diff changeset
  1092
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1093
    scrolledView notNil ifTrue:[
2271
martin
parents: 2227
diff changeset
  1094
        scrolledView removeDependent:self.
martin
parents: 2227
diff changeset
  1095
        scrolledView destroy.
martin
parents: 2227
diff changeset
  1096
        scrolledView := nil.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1097
    ].
982
bd9d2993a1be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1098
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1099
    scrolledView := aView.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1100
2320
158b10553017 scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  1101
    aView notNil ifTrue:[
158b10553017 scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  1102
        super addSubViewFirst:aView.
2271
martin
parents: 2227
diff changeset
  1103
        self setScrollActions.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1104
2271
martin
parents: 2227
diff changeset
  1105
        realized ifTrue:[
martin
parents: 2227
diff changeset
  1106
            self setupDimensionsConfigureScrolledView:true.
martin
parents: 2227
diff changeset
  1107
            self sizeChanged:nil.
2320
158b10553017 scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  1108
            aView realize
2271
martin
parents: 2227
diff changeset
  1109
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1110
    ]
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1111
1535
b769ae01e418 preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  1112
    "Modified: / 19.3.1997 / 15:32:37 / stefan"
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1113
    "Modified: / 21.5.1998 / 00:48:57 / cg"
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1114
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1115
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1116
verticalScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1117
    "return the vertical scrollbar (or nil, if there is none)"
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1118
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1119
"/    vScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1120
"/        self verticalScrollable:true.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1121
"/    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1122
    ^ vScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1123
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1124
    "Modified: 6.3.1997 / 16:59:24 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1125
    "Created: 6.3.1997 / 18:06:23 / cg"
1253
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1126
!
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1127
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1128
widget
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1129
    "for ST80 compatibility (where a wrapper returns its wrapped
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1130
     widget), return the scrolledView here"
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1131
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1132
    ^ scrolledView
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1133
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1134
    "Created: 20.6.1997 / 14:45:16 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1135
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1136
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1137
!ScrollableView methodsFor:'accessing-look'!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1138
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1139
horizontalMini:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1140
    "control the horizontal scrollBar to be either a miniScroller,
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1141
     or a full scrollBar."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1142
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1143
    |newMini|
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1144
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1145
    newMini := aBoolean.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1146
    (styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1147
        newMini := false.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1148
    ].
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1149
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1150
    horizontalMini ~~ newMini ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1151
        horizontalMini := newMini.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1152
        self setupForChangedScrollbars.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1153
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1154
1498
1da0a03c28e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
  1155
    "Created: / 7.3.1997 / 21:57:02 / cg"
1502
f0318a055faa oops - mini-attribute
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1156
    "Modified: / 22.4.1998 / 22:42:25 / ca"
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1157
    "Modified: / 21.5.1998 / 00:48:25 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1158
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1159
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1160
horizontalScrollable:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1161
    "enable/disable horizontal scrollability.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1162
     If disabled, the horizontal scrollBar is made invisible."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1163
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1164
    hasHorizontalScrollBar ~~ aBoolean ifTrue:[
1953
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  1165
        hasHorizontalScrollBar := aBoolean.
a511a0fbd452 comment examples fixed
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  1166
        hScrollBarHidden := false.
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1167
        self setupForChangedScrollbars.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1168
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1169
1498
1da0a03c28e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
  1170
    "Created: / 7.3.1997 / 21:56:28 / cg"
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1171
    "Modified: / 21.5.1998 / 00:48:44 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1172
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1173
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1174
horizontalScrollable:scrollableBoolean miniScroller:miniScrollerBoolean
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1175
    "enable/disable horizontal scrollability.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1176
     If disabled, the horizontal scrollBar is made invisible."
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1177
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1178
    |newMini|
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1179
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1180
    newMini := miniScrollerBoolean.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1181
    (styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1182
        newMini := false.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1183
    ].
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1184
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1185
    (hasHorizontalScrollBar ~~ scrollableBoolean 
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1186
    or:[scrollableBoolean and:[horizontalMini ~~ newMini]]) ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1187
        horizontalMini := newMini.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1188
        hasHorizontalScrollBar := scrollableBoolean.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1189
        hScrollBarHidden := false.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1190
        self setupForChangedScrollbars.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1191
    ].
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1192
    horizontalMini := newMini.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1193
!
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1194
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1195
setupForChangedScrollbars
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1196
    self setupViews.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1197
    shown ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1198
        self setupDimensionsConfigureScrolledView:false.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1199
    ]
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1200
!
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1201
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1202
verticalMini:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1203
    "control the vertical scrollBar to be either a miniScroller,
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1204
     or a full scrollBar."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1205
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1206
    |newMini|
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1207
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1208
    newMini := aBoolean.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1209
    (styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1210
        newMini := false.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1211
    ].
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1212
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1213
    verticalMini ~~ newMini ifTrue:[
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1214
        verticalMini := newMini.
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1215
        self setupForChangedScrollbars.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1216
    ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1217
1498
1da0a03c28e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
  1218
    "Created: / 7.3.1997 / 21:56:57 / cg"
1502
f0318a055faa oops - mini-attribute
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1219
    "Modified: / 22.4.1998 / 22:42:32 / ca"
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1220
    "Modified: / 21.5.1998 / 00:49:10 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1221
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1222
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1223
verticalScrollable:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1224
    "enable/disable vertical scrollability.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1225
     If disabled, the vertical scrollBar is made invisible."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1226
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1227
    hasVerticalScrollBar ~~ aBoolean ifTrue:[
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1228
        hasVerticalScrollBar := aBoolean.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1229
        "/ vScrollBarHidden := false.
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1230
        self setupForChangedScrollbars.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1231
    ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1232
1498
1da0a03c28e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
  1233
    "Created: / 7.3.1997 / 21:56:39 / cg"
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1234
    "Modified: / 24.8.2001 / 14:55:20 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1235
! !
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1236
2227
58426f7611f2 category changes
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1237
!ScrollableView methodsFor:'change & update'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1238
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1239
update:something with:argument from:changedObject
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1240
    "whenever the scrolledView changes its contents, the scroller(s) must
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1241
     be updated as well"
132
claus
parents: 130
diff changeset
  1242
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1243
    |doUpdate|
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1244
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1245
    doUpdate := false.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1246
    changedObject == scrolledView ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1247
        something == #sizeOfContents ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1248
            vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1249
                vScrollBar setThumbFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1250
                doUpdate := true
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1251
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1252
            hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1253
                hScrollBar setThumbFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1254
                doUpdate := true
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1255
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1256
        ] ifFalse:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1257
            something == #originOfContents ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1258
                lockUpdates ifFalse:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1259
                    vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1260
                        vScrollBar setThumbOriginFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1261
                        doUpdate := true
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1262
                    ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1263
                    hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1264
                        hScrollBar setThumbOriginFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1265
                        doUpdate := true
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1266
                    ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1267
                ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1268
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1269
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1270
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1271
        doUpdate ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1272
            self updateScrollBarVisibility
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1273
        ]
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1274
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1275
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1276
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1277
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1278
updateHScrollBarVisibility
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1279
    |hide anyChange|
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1280
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1281
    anyChange := false.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1282
    hideHScrollBar ~~ false ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1283
        hScrollBar notNil ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1284
            hide := hScrollBar thumbHeight >= 100.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1285
            hide ~~ hScrollBar realized not "hScrollBarHidden" ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1286
                hScrollBarHidden := hide.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1287
                hide ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1288
                    "/ just in case: scroll to left
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1289
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1290
                    scrolledView scrollHorizontalToPercent:0.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1291
                    hScrollBar beInvisible
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1292
                ] ifFalse:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1293
                    hScrollBar beVisible
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1294
                ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1295
                anyChange := true.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1296
            ]
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1297
        ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1298
    ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1299
    ^ anyChange
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1300
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1301
    "Modified: / 24.8.2001 / 15:05:57 / cg"
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1302
    "Created: / 24.8.2001 / 15:06:05 / cg"
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1303
!
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1304
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1305
updateScrollBarVisibility
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1306
    "check if any scrollbar needs to be hidden or shown"
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1307
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1308
    |anyChange hide|
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1309
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1310
    anyChange := self updateVScrollBarVisibility.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1311
    anyChange := anyChange | self updateHScrollBarVisibility.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1312
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1313
    anyChange ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1314
        self setupDimensionsConfigureScrolledView:false.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1315
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1316
        "/ force him to recompute its dimension ...
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1317
        scrolledView notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1318
            vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1319
                vScrollBar setThumbFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1320
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1321
            hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1322
                hScrollBar setThumbFor:scrolledView.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1323
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1324
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1325
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1326
        "/ stupid - showing one may need the other ...
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1327
        "/ and vice versa; do it again.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1328
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1329
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1330
"/        anyChange := false.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1331
"/        hideVScrollBar ~~ false ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1332
"/            vScrollBar notNil ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1333
"/                hide := vScrollBar thumbHeight >= 100.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1334
"/                hide ~~ vScrollBar realized not "vScrollBarHidden" ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1335
"/                    vScrollBarHidden := hide.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1336
"/                    hide ifTrue:[vScrollBar beInvisible] ifFalse:[vScrollBar beVisible].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1337
"/                    anyChange := true.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1338
"/                ]
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1339
"/            ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1340
"/        ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1341
"/        hideHScrollBar ~~ false ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1342
"/            hScrollBar notNil ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1343
"/                hide := hScrollBar thumbHeight >= 100.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1344
"/                hide ~~ hScrollBar realized not "hScrollBarHidden" ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1345
"/                    hScrollBarHidden := hide.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1346
"/                    hide ifTrue:[hScrollBar beInvisible] ifFalse:[hScrollBar beVisible].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1347
"/                    anyChange := true.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1348
"/                ]
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1349
"/            ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1350
"/        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1351
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1352
        anyChange := self updateVScrollBarVisibility.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1353
        anyChange := anyChange | self updateHScrollBarVisibility.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1354
        anyChange ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1355
            self setupDimensionsConfigureScrolledView:false.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1356
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1357
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1358
1535
b769ae01e418 preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  1359
    "Modified: / 19.3.1997 / 15:33:36 / stefan"
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1360
    "Modified: / 24.8.2001 / 15:08:58 / cg"
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1361
!
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1362
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1363
updateVScrollBarVisibility
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1364
    |hide anyChange|
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1365
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1366
    anyChange := false.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1367
    hideVScrollBar ~~ false ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1368
        vScrollBar notNil ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1369
            hide := vScrollBar thumbHeight >= 100.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1370
            hide ~~ vScrollBar realized not" vScrollBarHidden" ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1371
                vScrollBarHidden := hide.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1372
                hide ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1373
                    "/ just in case: scroll to top
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1374
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1375
                    scrolledView scrollVerticalToPercent:0.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1376
                    vScrollBar beInvisible
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1377
                ] ifFalse:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1378
                    vScrollBar beVisible
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1379
                ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1380
                anyChange := true.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1381
            ]
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1382
        ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1383
    ].
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1384
    ^ anyChange
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1385
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1386
    "Modified: / 24.8.2001 / 15:05:57 / cg"
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1387
    "Created: / 24.8.2001 / 15:07:38 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1388
! !
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1389
3395
c3e89984796a category
Claus Gittinger <cg@exept.de>
parents: 3263
diff changeset
  1390
!ScrollableView methodsFor:'drag & drop'!
3242
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1391
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1392
dropTarget
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1393
    scrolledView isNil ifTrue:[^ nil].
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1394
    ^ scrolledView dropTarget
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1395
!
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1396
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1397
dropTarget:aDropTarget
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1398
    scrolledView isNil ifTrue:[^ self].
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1399
    scrolledView dropTarget:aDropTarget
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1400
! !
d01395c1b760 dropTarget forwarding
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1401
2752
5650a9ab5935 method category rename
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
  1402
!ScrollableView methodsFor:'event handling'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1403
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1404
keyPress:key x:x y:y
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1405
    "a key was pressed - handle page-keys here"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1406
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1407
    <resource: #keyboard ( #Prior #Next ) >
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1408
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1409
    (key == #Prior)    ifTrue: [^ self pageUp].
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1410
    (key == #Next)     ifTrue: [^ self pageDown].
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1411
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1412
    super keyPress:key x:x y:y
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1413
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1414
    "Created: 6.3.1997 / 18:06:23 / cg"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1415
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1416
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1417
sizeChanged:how
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1418
    "handle size changes - this may change any scrollBars visibility"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1419
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1420
    |orgX orgY thV thH scrollH scrollV|
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1421
3671
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1422
    self changed:#sizeOfView with:how.
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1423
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1424
    superView notNil ifTrue:[
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1425
        superView subViewChangedSize
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1426
    ].
15b7958e549b dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents: 3590
diff changeset
  1427
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1428
    "/ resize components manually, in an order which is optimal
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1429
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1430
    how == #smaller ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1431
        "/ first resize the horizontalScrollBar,
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1432
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1433
        scrolledView notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1434
            scrolledView containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1435
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1436
        hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1437
            hScrollBar containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1438
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1439
        vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1440
            vScrollBar containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1441
        ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1442
    ] ifFalse:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1443
        hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1444
            hScrollBar containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1445
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1446
        vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1447
            vScrollBar containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1448
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1449
        scrolledView notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1450
            scrolledView containerChangedSize
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1451
        ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1452
    ].
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1453
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1454
    scrolledView isNil ifTrue:[^ self].
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1455
    (hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1456
        ^ self
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1457
    ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1458
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1459
    vScrollBar notNil ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1460
        vScrollBar setThumbFor:scrolledView.
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1461
        orgY := vScrollBar thumbOrigin.
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1462
        thV := vScrollBar thumbHeight.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1463
    ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1464
    hScrollBar notNil ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1465
        hScrollBar setThumbFor:scrolledView.
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1466
        orgX := hScrollBar thumbOrigin.
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1467
        thH := hScrollBar thumbHeight.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1468
    ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1469
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1470
    "/ splitted, since there are optimized scrollProcedures for each case ...
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1471
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1472
    hScrollBar isNil ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1473
        "/ only care for vertical ...
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1474
        orgY + thV >= 100 ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1475
            vScrollBar thumbOrigin:(100 - thV).
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1476
            scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1477
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1478
    ] ifFalse:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1479
        vScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1480
            "/ only care for horizontal ...
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1481
            orgX + thH >= 100 ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1482
                hScrollBar thumbOrigin:(100 - thH).
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1483
                scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1484
            ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1485
        ] ifFalse:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1486
            "/ care for both ...
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1487
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1488
            scrollH := scrollV := false.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1489
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1490
            orgY + thV >= 100 ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1491
                vScrollBar thumbOrigin:(100 - thV).
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1492
                orgY := vScrollBar thumbOrigin.
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1493
                scrollV := true.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1494
            ].
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1495
            orgX + thH >= 100 ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1496
                hScrollBar thumbOrigin:(100 - thH).
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1497
                orgX := hScrollBar thumbOrigin.
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1498
                scrollH := true.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1499
            ].
1986
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1500
            scrollV ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1501
                scrollH ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1502
                    scrolledView scrollToPercent:(orgX@orgY).
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1503
                ] ifFalse:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1504
                    scrolledView scrollVerticalToPercent:orgY.
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1505
                ]
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1506
            ] ifFalse:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1507
                scrollH ifTrue:[
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1508
                    scrolledView scrollHorizontalToPercent:orgX.
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1509
                ]
7083145a236b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1510
            ]
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1511
        ]
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1512
    ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1513
    self updateScrollBarVisibility.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1514
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1515
    "/ just in case there are more views... (DSV - sigh)
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1516
    subViews do:[:eachSubView |
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1517
        ((eachSubView ~~ scrolledView)
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1518
        and:[(eachSubView ~~ hScrollBar)
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1519
        and:[eachSubView ~~ vScrollBar]])   
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1520
        ifTrue:[
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1521
            eachSubView containerChangedSize
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1522
        ]
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1523
    ]
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1524
1160
f3204cabcce8 must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1525
    "Modified: 28.3.1997 / 17:25:38 / cg"
3508
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1526
!
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1527
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1528
win32NativeScroll:scrollCode position:newPosition
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1529
    "this is generated by a native scrollBar widget"
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1530
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1531
    scrollCode == #SB_LINEDOWN ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1532
        scrolledView scrollDown.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1533
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1534
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1535
    scrollCode == #SB_LINEUP ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1536
        scrolledView scrollUp.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1537
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1538
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1539
    scrollCode == #SB_LINELEFT ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1540
        scrolledView scrollLeft.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1541
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1542
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1543
    scrollCode == #SB_LINERIGHT ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1544
        scrolledView scrollRight.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1545
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1546
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1547
    scrollCode == #SB_PAGEDOWN ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1548
        self pageDown.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1549
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1550
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1551
    scrollCode == #SB_PAGEUP ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1552
        self pageUp.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1553
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1554
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1555
    scrollCode == #SB_PAGELEFT ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1556
        self pageLeft.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1557
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1558
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1559
    scrollCode == #SB_PAGERIGHT ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1560
        self pageRight.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1561
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1562
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1563
    scrollCode == #SB_THUMBPOSITIONVERTICAL ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1564
        scrolledView scrollVerticalToPercent:newPosition.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1565
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1566
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1567
    scrollCode == #SB_THUMBPOSITIONHORIZONTAL ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1568
        scrolledView scrollHorizontalToPercent:newPosition.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1569
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1570
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1571
    scrollCode == #SB_THUMBTRACKVERTICAL ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1572
        vScrollBar isSynchronous ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1573
            scrolledView scrollVerticalToPercent:newPosition.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1574
        ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1575
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1576
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1577
    scrollCode == #SB_THUMBTRACKHORIZONTAL ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1578
        hScrollBar isSynchronous ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1579
            scrolledView scrollHorizontalToPercent:newPosition.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1580
        ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1581
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1582
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1583
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1584
    scrollCode == #SB_ENDSCROLL ifTrue:[
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1585
        ^ self.
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1586
    ].
a95b6cffbb18 *** empty log message ***
fm
parents: 3507
diff changeset
  1587
    self halt:'unexpected scroll operation'.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1588
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1589
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1590
!ScrollableView methodsFor:'forced scroll'!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1591
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1592
pageDown
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1593
    "page down - but only if there is a vertical scrollbar"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1594
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1595
    vScrollBar notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1596
        vScrollBar pageDown
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1597
    ]
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1598
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1599
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1600
    "Modified: 19.3.1997 / 16:32:34 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1601
!
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1602
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1603
pageLeft
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1604
    "page left - but only if there is a horizontal scrollbar"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1605
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1606
    hScrollBar notNil ifTrue:[
3037
49287d5cc645 *** empty log message ***
ca
parents: 3034
diff changeset
  1607
        hScrollBar pageUp
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1608
    ]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1609
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1610
    "Created: 19.3.1997 / 16:32:14 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1611
    "Modified: 19.3.1997 / 16:32:44 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1612
!
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1613
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1614
pageRight
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1615
    "page right - but only if there is a horizontal scrollbar"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1616
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1617
    hScrollBar notNil ifTrue:[
3037
49287d5cc645 *** empty log message ***
ca
parents: 3034
diff changeset
  1618
        hScrollBar pageDown
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1619
    ]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1620
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1621
    "Created: 19.3.1997 / 16:32:22 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1622
    "Modified: 19.3.1997 / 16:32:48 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1623
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1624
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1625
pageUp
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1626
    "page up - but only if there is a vertical scrollbar"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1627
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1628
    vScrollBar notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1629
        vScrollBar pageUp
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1630
    ]
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1631
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1632
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1633
    "Modified: 19.3.1997 / 16:32:38 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1634
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1635
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1636
!ScrollableView methodsFor:'initialization'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1637
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1638
initStyle
958
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
  1639
    "initialize style specifics"
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
  1640
3263
648959a4c550 resource directive
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
  1641
    <resource: #style (#'scrollBar.position' 
648959a4c550 resource directive
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
  1642
                       #'scrollBar.hiding')>
608
aedd7bf72edc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 591
diff changeset
  1643
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1644
    super initStyle.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1645
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1646
    viewBackground := MyDefaultViewBackgroundColor. 
1870
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
  1647
    scrollBarPosition := styleSheet at:#'scrollBar.position' default:#left.
9bce9ea89db3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
  1648
    hideHScrollBar := hideVScrollBar := styleSheet at:#'scrollBar.hiding' default:false.
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1649
    DefaultLevel notNil ifTrue:[self level:DefaultLevel].
608
aedd7bf72edc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 591
diff changeset
  1650
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1651
    scrolledViewHMargin := scrolledViewVMargin := DefaultScrolledViewMargin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1652
    scrollBarVSpacing := scrollBarHSpacing := DefaultScrollBarSpacing.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1653
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1654
1247
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1655
initialize
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1656
    "setup some default"
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1657
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1658
    verticalMini := horizontalMini := false.
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1659
    hasVerticalScrollBar := hasHorizontalScrollBar := false.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1660
    vScrollBarHidden := hScrollBarHidden := true.
1247
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1661
    super initialize.
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1662
!
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1663
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1664
realize
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1665
    "realize (i.e. make me visible).
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1666
     Since scrolledView may have done something to its contents
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1667
     during init-time we had no chance yet to catch contents-
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1668
     changes; do it now"
1160
f3204cabcce8 must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1669
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1670
    self setupDimensionsConfigureScrolledView:true.
1176
29d0a646cbdf must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents: 1161
diff changeset
  1671
    super realize.
1201
e7f1cf0180ca must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1672
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1673
    scrolledView notNil ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1674
        vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1675
            vScrollBar setThumbFor:scrolledView
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1676
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1677
        hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1678
            hScrollBar setThumbFor:scrolledView
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1679
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1680
        self updateScrollBarVisibility.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1681
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1682
1536
b8ddd185281a preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents: 1535
diff changeset
  1683
    "Modified: / 21.5.1998 / 00:52:18 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1684
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1685
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1686
releaseHorizontalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1687
    "destroy any horizontal scrollBar"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1688
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1689
    hScrollBar notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1690
        hScrollBar destroy.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1691
        hScrollBar := nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1692
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1693
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1694
    "Modified: 6.3.1997 / 17:43:20 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1695
    "Created: 6.3.1997 / 18:06:23 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1696
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1697
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1698
releaseVerticalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1699
    "destroy any vertical scrollBar"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1700
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1701
    vScrollBar notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1702
        vScrollBar destroy.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  1703
        vScrollBar := nil
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1704
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1705
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1706
    "Created: 6.3.1997 / 18:06:23 / cg"
1097
9f3ae8f08ffe checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  1707
!
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1708
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1709
setScrollActions
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1710
    "lock prevents repositioning the scroller to the
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1711
     actual (often rounded) position while scrolling,
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1712
     and keeps it instead at the pointer position.
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1713
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1714
     (this avoids run-away scroller when scrolling
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1715
      textviews, when the text is aligned line-wise).
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1716
      Consider this as a kludge."
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1717
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
  1718
    lockUpdates := false.
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1719
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1720
    vScrollBar notNil ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1721
        vScrollBar scrollAction:[:position |
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1722
            lockUpdates := true.
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1723
            scrolledView scrollVerticalToPercent:position.
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1724
            lockUpdates := false
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1725
        ].
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1726
        vScrollBar 
2730
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1727
            scrollUpAction:[ |sensor|
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1728
                            sensor := self sensor.
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1729
                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1730
                                scrolledView scrollToTop
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1731
                            ] ifFalse:[
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1732
                                scrolledView scrollUp
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1733
                            ]
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1734
                           ].
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1735
        vScrollBar 
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1736
            scrollDownAction:[|sensor|
2730
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1737
                            sensor := self sensor.
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1738
                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1739
                                scrolledView scrollToBottom
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1740
                            ] ifFalse:[
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1741
                                scrolledView scrollDown
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1742
                            ]
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1743
                           ].
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1744
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1745
    hScrollBar notNil ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1746
        hScrollBar scrollAction:[:position |
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1747
            lockUpdates := true.
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1748
            scrolledView scrollHorizontalToPercent:position.
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1749
            lockUpdates := false
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1750
        ].
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1751
        hScrollBar 
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1752
            scrollUpAction:[|sensor|
2730
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1753
                            sensor := self sensor.
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1754
                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1755
                                scrolledView scrollToLeft
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1756
                            ] ifFalse:[
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1757
                                scrolledView scrollLeft
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1758
                            ]
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1759
                           ].
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1760
        hScrollBar 
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1761
            scrollDownAction:[|sensor|
2730
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1762
                            sensor := self sensor.
61a2f1981ac6 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 2643
diff changeset
  1763
                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
1695
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1764
                                scrolledView scrollToRight
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1765
                            ] ifFalse:[
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1766
                                scrolledView scrollRight
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1767
                            ]
c289e9656d9d shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
  1768
                             ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1769
    ].
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1770
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
  1771
    scrolledView addDependent:self.
814
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1772
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1773
    "
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1774
     pass my keyboard input (and other subviews input) 
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1775
     to the scrolled view ...
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1776
    "
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1777
    self delegate:(KeyboardForwarder toView:scrolledView).
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1778
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1779
    "Modified: 6.3.1997 / 17:03:43 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1780
    "Created: 6.3.1997 / 18:06:23 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1781
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1782
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1783
setVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH 
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1784
    "set scrollbar-flags as specified in the arguments"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1785
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1786
    |noMiniScrollers|
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1787
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1788
    vScrollBarHidden := hScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1789
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1790
    hasVerticalScrollBar := isVertical.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1791
    hasHorizontalScrollBar := isHorizontal.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1792
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1793
    noMiniScrollers := StyleSheet at:#'scrollBar.neverMini' default:false.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1794
    verticalMini := miniV.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1795
    horizontalMini := miniH.
1753
d0b1ba76acdb honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents: 1719
diff changeset
  1796
d0b1ba76acdb honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents: 1719
diff changeset
  1797
    noMiniScrollers == true ifTrue:[
d0b1ba76acdb honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents: 1719
diff changeset
  1798
        verticalMini := false.
d0b1ba76acdb honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents: 1719
diff changeset
  1799
        horizontalMini := false.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1800
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1801
2526
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1802
!
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1803
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1804
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH 
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1805
    "setup scrollbars as specified in the arguments"
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1806
fef4754e6097 faster setup
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  1807
    self setVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1808
    self setupViews.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1809
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1810
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1811
setupViews 
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1812
    "setup scrollbars as specified in the arguments"
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1813
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1814
    |cls|
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1815
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1816
    hasVerticalScrollBar ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1817
        cls := ScrollBar. 
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1818
        verticalMini ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1819
            cls := MiniScroller
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1820
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1821
        (vScrollBar notNil
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1822
        and:[vScrollBar class ~~ cls]) ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1823
            self releaseVerticalScrollBar
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1824
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1825
        vScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1826
            vScrollBar := cls in:self.
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1827
            "/ realized ifTrue:[
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1828
                vScrollBar beVisible.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1829
                "/ vScrollBar realize. 
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1830
                vScrollBarHidden := false.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1831
            "/ ]
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1832
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1833
        vScrollBar thumbOrigin:0 thumbHeight:100.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1834
    ] ifFalse:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1835
        vScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1836
            self releaseVerticalScrollBar
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1837
        ]
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1838
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1839
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1840
    hasHorizontalScrollBar ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1841
        cls := HorizontalScrollBar. 
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1842
        horizontalMini ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1843
            cls := HorizontalMiniScroller
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1844
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1845
        (hScrollBar notNil
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1846
        and:[hScrollBar class ~~ cls]) ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1847
            self releaseHorizontalScrollBar
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1848
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1849
        hScrollBar isNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1850
            hScrollBar := cls in:self.
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1851
            realized ifTrue:[
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1852
                hScrollBar beVisible.
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1853
                "/ hScrollBar realize. 
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1854
                hScrollBarHidden := false.
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1855
            ]
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1856
        ].
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1857
        hScrollBar thumbOrigin:0 thumbHeight:100.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1858
    ] ifFalse:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1859
        hScrollBar notNil ifTrue:[
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1860
            self releaseHorizontalScrollBar
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1861
        ]
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1862
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1863
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1864
    scrolledView notNil ifTrue:[
1961
302546d09001 oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  1865
        self setScrollActions.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1866
    ]
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1867
2397
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1868
    "Created: / 6.3.1997 / 18:06:23 / cg"
e643a7e77af5 fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents: 2358
diff changeset
  1869
    "Modified: / 24.8.2001 / 14:58:26 / cg"
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1870
! !
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1871
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1872
!ScrollableView methodsFor:'layout'!
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1873
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1874
horizontalScrollBarLayout:aLayout
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1875
    hScrollBar layout:aLayout
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1876
!
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1877
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1878
scrolledViewLayout:aLayout
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1879
    scrolledView layout:aLayout
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1880
!
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1881
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1882
setupDimensionsConfigureScrolledView:configureScrolledView
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1883
    "set the components dimensions (i.e. layouts) according to
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1884
     the scrollability and hidden settings.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1885
     This may heavily move around the parts ...
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1886
     This method is overly complex and we should think about alternatives;
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1887
     the reason is that it tries to shift views so that borders overlap
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1888
     (to avoid thick borders in-between components).
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1889
     This is very questionable, since borders are only used with 2D styles,
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1890
     and those 2D styles are more-or-less obsolete anyway.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1891
     "
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1892
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1893
    |usedScrolledViewHMargin usedScrolledViewVMargin 
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1894
     usedScrollBarHSpacing usedScrollBarVSpacing hasV hasH
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1895
     vBd         "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1896
     hBd         "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1897
     sBd         "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1898
     wVScroll    "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1899
     hHScroll    "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1900
     hLeftOffs   "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1901
     hRightOffs  "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1902
     hTopOffs    "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1903
     hBottomOffs "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1904
     sLeftOffs   "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1905
     sRightOffs  "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1906
     sTopOffs    "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1907
     sBottomOffs "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1908
     vLeftOffs   "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1909
     vRightOffs  "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1910
     vTopOffs    "{ Class: SmallInteger }"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1911
     vBottomOffs "{ Class: SmallInteger }"
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1912
     addMargin   "{ Class: SmallInteger }"
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1913
     scrolledViewLevel
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  1914
    |
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1915
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1916
    sBd := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1917
    DefaultScrolledViewBorderWidth notNil ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1918
        sBd := DefaultScrolledViewBorderWidth.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1919
        scrolledView notNil ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1920
            scrolledView borderWidth:DefaultScrolledViewBorderWidth.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1921
        ]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1922
    ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1923
        scrolledView notNil ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1924
            sBd := scrolledView borderWidth
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1925
        ]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1926
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1927
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1928
    (hasV := (vScrollBar notNil and:[vScrollBarHidden not])) ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1929
        vBd := vScrollBar borderWidth.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1930
        wVScroll := vScrollBar widthIncludingBorder.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1931
    ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1932
        vBd := wVScroll := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1933
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1934
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1935
    (hasH := (hScrollBar notNil and:[hScrollBarHidden not])) ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1936
        hBd := hScrollBar borderWidth.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1937
        hHScroll := hScrollBar heightIncludingBorder.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1938
    ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1939
        hBd := hHScroll := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1940
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1941
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1942
    "/ the raw layout ...
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1943
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1944
    scrolledViewLayout := ((0.0 @ 0.0) corner:(1.0@1.0)) asLayout.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1945
    hScrollBarLayout := ((0.0 @ 1.0) corner:(1.0@1.0)) asLayout.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1946
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1947
    "/ the painful details; mostly complicated for 2D styles,
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1948
    "/ where the positions are setUp to overlay borders ...
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1949
    "/ (well, with 3D styles, a single pixel error will not be noticed;
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1950
    "/  but 2D styles are very sensitive to those;
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1951
    "/  the code below may not work correctly with different borderWidths).
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1952
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1953
"/ DefaultScrolledViewMargin := 10. "/ margin around
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1954
"/ DefaultScrollBarSpacing := 2.    "/ space between scrolledView and scrollBar.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1955
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1956
    usedScrolledViewHMargin := self usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1957
    usedScrolledViewVMargin := self usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1958
    usedScrollBarVSpacing := self usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1959
    usedScrollBarHSpacing := self usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1960
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1961
    vTopOffs := 0 - vBd + usedScrolledViewVMargin + margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1962
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1963
    usedScrolledViewVMargin == 0 ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1964
        vBottomOffs := vBd - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1965
    ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1966
        vBottomOffs := vBd - usedScrolledViewVMargin + sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1967
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1968
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1969
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1970
    hLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1971
    hRightOffs := hBd - usedScrolledViewHMargin - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1972
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1973
    sLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1974
    sRightOffs := hBd - usedScrolledViewHMargin - sBd - sBd - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1975
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1976
    usedScrolledViewVMargin == 0 ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1977
        sTopOffs := 0 - sBd + margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1978
        sBottomOffs := sBd - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1979
    ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1980
        sTopOffs := 0 + usedScrolledViewVMargin + margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1981
        sBottomOffs := sBd - usedScrolledViewVMargin - sBd - sBd - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1982
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1983
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1984
    "/ kludge - for now
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1985
    (styleSheet at:#'scrolledView.zeroOffsets') == true ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1986
        vTopOffs := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1987
        hLeftOffs := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1988
        sLeftOffs := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1989
        sTopOffs := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1990
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1991
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1992
    addMargin := 0.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1993
"/    DefaultScrollBarLevel == DefaultScrolledViewLevel
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1994
"/        addMargin := 1.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1995
"/    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1996
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1997
    hasV ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1998
        scrollBarPosition == #right ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1999
            "/ right/bottom
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2000
            vScrollBarLayout := ((1.0 @ 0.0) corner:(1.0@1.0)) asLayout.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2001
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2002
            vRightOffs := 0 - usedScrolledViewHMargin + margin "???".
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2003
            vLeftOffs := vRightOffs - wVScroll.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2004
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2005
            sRightOffs := sRightOffs - usedScrollBarHSpacing - wVScroll + sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2006
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2007
            hRightOffs := hRightOffs - wVScroll - usedScrollBarHSpacing - sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2008
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2009
            sRightOffs := sRightOffs - addMargin
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2010
        ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2011
            "/ left/top
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2012
            vScrollBarLayout := ((0.0 @ 0.0) corner:(0.0@1.0)) asLayout.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2013
            vLeftOffs := 0 - vBd + usedScrolledViewHMargin + margin.
2643
de4764edc27e win + leftscrollbar fix
ca
parents: 2587
diff changeset
  2014
            vRightOffs := vLeftOffs + wVScroll "+ margin".
de4764edc27e win + leftscrollbar fix
ca
parents: 2587
diff changeset
  2015
de4764edc27e win + leftscrollbar fix
ca
parents: 2587
diff changeset
  2016
            sLeftOffs := vRightOffs + usedScrollBarHSpacing.
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2017
            sRightOffs := 0 - usedScrolledViewHMargin - margin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2018
            hLeftOffs := hLeftOffs + wVScroll + vBd + usedScrollBarHSpacing.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2019
2643
de4764edc27e win + leftscrollbar fix
ca
parents: 2587
diff changeset
  2020
            sLeftOffs := sLeftOffs + addMargin.
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2021
        ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2022
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2023
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2024
    hasH ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2025
        hBottomOffs := 0 - usedScrolledViewVMargin - hBd + margin "???".
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2026
        hTopOffs := hBottomOffs - hHScroll.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2027
        usedScrolledViewVMargin == 0 ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2028
            hTopOffs := hTopOffs + sBd + sBd
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2029
        ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2030
        sBottomOffs := sBottomOffs - usedScrollBarVSpacing - hHScroll.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2031
        (vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2032
            vBottomOffs := vBottomOffs - usedScrollBarVSpacing - hHScroll.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2033
        ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2034
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2035
        sBottomOffs := sBottomOffs - addMargin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2036
        hRightOffs := hRightOffs - addMargin.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2037
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2038
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2039
    (hScrollBar notNil
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2040
     and:[ hScrollBar borderWidth == 0 
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2041
     and:[sBd ~~ 0
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2042
     and:[scrollBarPosition == #right]]]) ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2043
        hRightOffs := hRightOffs + sBd + sBd.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2044
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2045
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2046
    scrolledView notNil ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2047
        scrolledViewLayout 
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2048
            leftOffset:sLeftOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2049
            rightOffset:sRightOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2050
            topOffset:sTopOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2051
            bottomOffset:sBottomOffs.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2052
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2053
        configureScrolledView ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2054
            ((hideVScrollBar or:[hideHScrollBar]) not
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2055
            and:[(hScrollBar isNil or:[hScrollBarHidden])
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2056
            and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2057
                scrolledViewLevel := 0
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2058
            ] ifFalse:[
2337
66d637032be7 level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
  2059
                (hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2060
                    scrolledViewLevel := 0
2337
66d637032be7 level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
  2061
                ] ifFalse:[
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2062
                    scrolledViewLevel := DefaultScrolledViewLevel.
2337
66d637032be7 level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
  2063
                ]
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2064
            ].
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2065
            scrolledView level:scrolledViewLevel
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2066
        ].
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2067
        self scrolledViewLayout:scrolledViewLayout.
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2068
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2069
    hasH ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2070
        hScrollBarLayout 
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2071
            leftOffset:hLeftOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2072
            rightOffset:hRightOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2073
            topOffset:hTopOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2074
            bottomOffset:hBottomOffs.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2075
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2076
        hScrollBar level:DefaultScrollBarLevel.
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2077
        self horizontalScrollBarLayout:hScrollBarLayout.
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2078
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2079
"/        scrollBarPosition == #right ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2080
"/            "/ right/bottom
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2081
"/            hScrollBar viewGravity:#SouthWest.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2082
"/        ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2083
"/            hScrollBar viewGravity:#NorthWest.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2084
"/        ]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2085
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2086
    (hasV and:[vScrollBar notNil and:[vScrollBarHidden not]]) ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2087
        vScrollBarLayout 
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2088
            leftOffset:vLeftOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2089
            rightOffset:vRightOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2090
            topOffset:vTopOffs
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2091
            bottomOffset:vBottomOffs.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2092
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2093
        vScrollBar level:DefaultScrollBarLevel.
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2094
        self verticalScrollBarLayout:vScrollBarLayout.
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2095
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2096
"/        scrollBarPosition == #right ifTrue:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2097
"/            "/ right/bottom
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2098
"/            vScrollBar viewGravity:#NorthEast.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2099
"/        ] ifFalse:[
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2100
"/            vScrollBar viewGravity:#NorthWest.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2101
"/        ]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2102
    ].
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2103
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2104
    "Created: / 21.5.1998 / 00:48:35 / cg"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2105
    "Modified: / 11.2.2000 / 00:00:36 / cg"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2106
!
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2107
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2108
usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2109
    "return the horizontal spacing between scrollBar and scrolledView.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2110
     Made a separate method to allow subclasses to overwrite this (subCanvas)"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2111
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2112
    ^ hasV ifTrue:[scrollBarHSpacing] ifFalse:[0]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2113
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2114
!
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2115
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2116
usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2117
    "return the vertical spacing between scrollBar and scrolledView.
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2118
     Made a separate method to allow subclasses to overwrite this (subCanvas)"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2119
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2120
    ^ hasH ifTrue:[scrollBarVSpacing] ifFalse:[0]
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2121
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2122
!
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2123
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2124
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2125
    "return the horizontal margin around (outer margin).
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2126
     Made a separate method to allow subclasses to overwrite this (subCanvas)"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2127
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2128
    ^ scrolledViewHMargin
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2129
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2130
!
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2131
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2132
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2133
    "return the vertical margin around (outer margin).
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2134
     Made a separate method to allow subclasses to overwrite this (subCanvas)"
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2135
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2136
    ^ scrolledViewVMargin
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2137
2587
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2138
!
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2139
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2140
verticalScrollBarLayout:aLayout
6c5d17d2a1d7 some refactorings for easier subclassing (DataSetView)
penk
parents: 2526
diff changeset
  2141
    vScrollBar layout:aLayout
2155
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2142
! !
65e1bf19fd7f allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  2143
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2144
!ScrollableView methodsFor:'queries'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2145
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  2146
isHorizontalScrollable
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2147
    "return true if I am horizontally scrollable"
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  2148
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2149
    ^ hScrollBar notNil
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  2150
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2151
    "Modified: 6.3.1997 / 17:03:49 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2152
    "Created: 6.3.1997 / 18:06:23 / cg"
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2153
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2154
1593
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2155
isScrollWrapper
3568
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
  2156
     "answer true if this view wraps a possibly larger view and has scroll bars"
976b80ebcda7 Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents: 3509
diff changeset
  2157
1593
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2158
     ^ true
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2159
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2160
    "Created: / 20.6.1998 / 14:15:42 / cg"
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2161
!
a77a10ecde65 added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2162
2358
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2163
isScrolling
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2164
    "true, if scrollbars thumb is being moved (by user)"
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2165
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2166
    ^ (vScrollBar notNil and:[vScrollBar isScrolling])
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2167
      or:[
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2168
             (hScrollBar notNil and:[hScrollBar isScrolling])
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2169
         ]
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2170
!
eadde3a9c586 added #isScrolling query
Claus Gittinger <cg@exept.de>
parents: 2343
diff changeset
  2171
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2172
isVerticalScrollable
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2173
    "return true if I am vertically scrollable"
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2174
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2175
    ^ vScrollBar notNil
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2176
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2177
    "Modified: 6.3.1997 / 17:03:52 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2178
    "Created: 6.3.1997 / 18:06:23 / cg"
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  2179
!
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  2180
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2181
preferredExtent
572
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  2182
    "return my preferredExtent from the scrolledViews prefExtent
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  2183
     plus the size of the scrollBar"
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  2184
1855
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2185
    |slavesPref prefX prefY margin|
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2186
3767
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2187
    "/ If I have an explicit preferredExtent..
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2188
    explicitExtent notNil ifTrue:[
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2189
        ^ explicitExtent
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2190
    ].
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2191
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2192
    "/ If I have a cached preferredExtent value..
713
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  2193
    preferredExtent notNil ifTrue:[
1855
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2194
        ^ preferredExtent
713
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  2195
    ].
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  2196
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2197
    scrolledView notNil ifTrue:[ 
1855
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2198
        slavesPref := scrolledView preferredExtent.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2199
        prefX := slavesPref x.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2200
        prefY := slavesPref y.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2201
        margin := (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2202
        vScrollBar notNil ifTrue:[
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2203
            prefX := prefX + vScrollBar width + margin.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2204
        ].
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2205
        hScrollBar notNil ifTrue:[
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2206
            prefY := prefY + hScrollBar height + margin.
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2207
        ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2208
1855
20572120fbd3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  2209
        ^ prefX @ prefY.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2210
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2211
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2212
    ^ super preferredExtent.
572
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  2213
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2214
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2215
    "Modified: 6.3.1997 / 22:34:09 / cg"
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2216
!
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2217
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2218
preferredExtentForLines:numLines cols:numCols
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2219
    "return my preferredExtent from the scrolledViews prefExtent
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2220
     plus the size of the scrollBar"
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2221
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2222
    |slavesPref prefX prefY|
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2223
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2224
    "/ If I have an explicit preferredExtent ..
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2225
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2226
    preferredExtent notNil ifTrue:[
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2227
        ^ preferredExtent
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2228
    ].
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2229
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2230
    scrolledView notNil ifTrue:[ 
3012
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2231
        slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2232
        prefX := slavesPref x.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2233
        prefY := slavesPref y.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2234
        vScrollBar notNil ifTrue:[
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2235
            prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2236
        ].
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2237
        hScrollBar notNil ifTrue:[
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2238
            prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2239
        ].
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2240
dcdce8a883a2 *** empty log message ***
ca
parents: 3011
diff changeset
  2241
        ^ prefX @ prefY.
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2242
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2243
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2244
    ^ super preferredExtent.
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  2245
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2246
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2247
    "Modified: 6.3.1997 / 22:34:30 / cg"
1231
aba877015224 specClass
ca
parents: 1201
diff changeset
  2248
!
aba877015224 specClass
ca
parents: 1201
diff changeset
  2249
aba877015224 specClass
ca
parents: 1201
diff changeset
  2250
specClass
1378
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  2251
    "redefined, since my subclasses also want ScrollableViewSpecs"
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  2252
1231
aba877015224 specClass
ca
parents: 1201
diff changeset
  2253
    ^ ScrollableViewSpec
aba877015224 specClass
ca
parents: 1201
diff changeset
  2254
1378
1841005ef851 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1362
diff changeset
  2255
    "Modified: / 31.10.1997 / 19:48:48 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2256
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2257
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2258
!ScrollableView methodsFor:'slave-view messages'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2259
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2260
clear
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2261
    "convenient method: forward this to the scrolledView"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2262
1073
1be1af284d3b care for nil scrolledView in #clear
ca
parents: 1024
diff changeset
  2263
    scrolledView notNil ifTrue:[scrolledView clear]
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2264
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2265
    "Created: 6.3.1997 / 18:06:24 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  2266
    "Modified: 19.3.1997 / 16:34:19 / cg"
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2267
!
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2268
2927
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2269
clearView
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2270
    "convenient method: forward this to the scrolledView"
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2271
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2272
    scrolledView notNil ifTrue:[scrolledView clearView]
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2273
!
cdf7d130c73c clear -> clearView
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
  2274
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2275
doesNotUnderstand:aMessage
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2276
    "this is funny: all message we do not understand, are passed
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2277
     on to the scrolledView - so we do not have to care for all
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2278
     possible messages ...(thanks to the Message class)"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2279
3006
e8a68c8dc2d6 use #sendTo: to send messages
Stefan Vogel <sv@exept.de>
parents: 2986
diff changeset
  2280
     scrolledView notNil ifTrue:[
e8a68c8dc2d6 use #sendTo: to send messages
Stefan Vogel <sv@exept.de>
parents: 2986
diff changeset
  2281
         ^ aMessage sendTo:scrolledView.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2282
     ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2283
     ^ super doesNotUnderstand:aMessage
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2284
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2285
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2286
    "Modified: 6.3.1997 / 18:38:54 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2287
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2288
2195
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2289
flash
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2290
    "convenient method: forward this to the scrolledView"
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2291
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2292
    scrolledView notNil ifTrue:[scrolledView flash]
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2293
!
2117849dec53 forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  2294
2271
martin
parents: 2227
diff changeset
  2295
font:aFont
martin
parents: 2227
diff changeset
  2296
    super font:aFont.
2934
ede340a08539 forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents: 2927
diff changeset
  2297
    scrolledView notNil ifTrue:[
ede340a08539 forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents: 2927
diff changeset
  2298
        scrolledView font:aFont
ede340a08539 forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents: 2927
diff changeset
  2299
    ]
2271
martin
parents: 2227
diff changeset
  2300
!
martin
parents: 2227
diff changeset
  2301
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2302
leftButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2303
    "return scrolledViews leftbuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2304
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2305
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2306
    ^ scrolledView leftButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2307
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2308
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2309
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2310
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2311
leftButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2312
    "pass on leftbuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2313
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2314
    scrolledView leftButtonMenu:aMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2315
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2316
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2317
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2318
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2319
middleButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2320
    "return scrolledViews middlebuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2321
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2322
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2323
    ^ scrolledView middleButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2324
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2325
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2326
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2327
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2328
middleButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2329
    "pass on middlebuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2330
3685
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2331
    scrolledView notNil ifTrue:[
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2332
        scrolledView middleButtonMenu:aMenu
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2333
    ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2334
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2335
    "Created: 6.3.1997 / 18:06:24 / cg"
3685
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2336
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2337
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2338
f421d5453bf1 changed #middleButtonMenu:
Claus Gittinger <cg@exept.de>
parents: 3671
diff changeset
  2339
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2340
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2341
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2342
model
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  2343
    "return my scrolledViews model"
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  2344
1085
25c315911e69 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
  2345
    scrolledView isNil ifTrue:[^ nil].
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2346
    ^ scrolledView model
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2347
1085
25c315911e69 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
  2348
    "Modified: 1.3.1997 / 01:38:07 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2349
    "Created: 6.3.1997 / 18:06:24 / cg"
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2350
!
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2351
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2352
model:aModel
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  2353
    "forward model change to my scrolledViews"
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  2354
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2355
    ^ scrolledView model:aModel
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2356
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  2357
    "Modified: 5.6.1996 / 17:09:50 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2358
    "Created: 6.3.1997 / 18:06:24 / cg"
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2359
!
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  2360
1827
bfbf33580947 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  2361
requestFocus
2986
30f050e2a9a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
  2362
    scrolledView notNil ifTrue:[
30f050e2a9a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
  2363
        ^ scrolledView requestFocus
30f050e2a9a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
  2364
    ].
30f050e2a9a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
  2365
    ^  false.
1827
bfbf33580947 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  2366
!
bfbf33580947 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  2367
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2368
rightButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2369
    "return scrolledViews rightbuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2370
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2371
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2372
    ^ scrolledView rightButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2373
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2374
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2375
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2376
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2377
rightButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2378
    "pass on rightbuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2379
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2380
    scrolledView rightButtonMenu:aMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2381
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  2382
    "Created: 6.3.1997 / 18:06:24 / cg"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2383
! !
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  2384
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
  2385
!ScrollableView class methodsFor:'documentation'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2386
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2387
version
3767
30ede36bb2ee changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents: 3685
diff changeset
  2388
    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.149 2008-10-26 20:14:18 stefan Exp $'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  2389
! !