ScrollableView.st
author Claus Gittinger <cg@exept.de>
Mon, 28 Jul 1997 12:32:51 +0200
changeset 1286 42740ebf473a
parent 1253 385bb80488f5
child 1344 0912e7165023
permissions -rw-r--r--
*** empty log message ***
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
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
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
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
119
claus
parents: 113
diff changeset
    13
SimpleView subclass:#ScrollableView
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
    14
	instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
    15
		hideScrollBars hasHorizontalScrollBar hasVerticalScrollBar
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
    16
		horizontalMini verticalMini vScrollBarHidden hScrollBarHidden
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
    17
		vScrollBarVisible hScrollBarVisible'
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
    18
	classVariableNames:'DefaultScrolledViewLevel DefaultScrolledViewMargin
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
    19
		DefaultScrollBarSpacing DefaultScrolledViewBorderWidth
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
    20
		DefaultLevel DefaultScrollBarLevel MyDefaultViewBackgroundColor'
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    21
	poolDictionaries:''
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
    22
	category:'Views-Basic'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    23
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    24
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
    25
!ScrollableView class methodsFor:'documentation'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    26
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    27
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    28
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    29
 COPYRIGHT (c) 1989 by Claus Gittinger
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
    30
              All Rights Reserved
38
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
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    33
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    35
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    36
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    37
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    38
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    39
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    40
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    41
documentation
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
    a view containing a scrollbar and some other (slave-)view.
130
claus
parents: 122
diff changeset
    44
    This view wraps scrollbar(s) around the view to be scrolled.
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    45
    The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    46
    and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved.
130
claus
parents: 122
diff changeset
    47
    The view itself has to implement these (there is a default implementation
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    48
    in the common View class for this.
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    49
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    50
    For the scrollbars to know about the full (maximum) size, the view
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    51
    must implement #heightOfContents and/or #widthOfContents.
130
claus
parents: 122
diff changeset
    52
    The values returned by these methods are used to compute the fraction
claus
parents: 122
diff changeset
    53
    which is visible (i.e. the scrollers thumb heights).
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    54
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    55
    There are two ways to create a ScrollableView:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    56
    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
    57
    use:
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    58
        v := ScrollableView for:<ViewClass>
130
claus
parents: 122
diff changeset
    59
    or:
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    60
        v := ScrollableView for:<ViewClass> in:someSuperView
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    61
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    62
    otherwise, create the scrollableView empty with:
130
claus
parents: 122
diff changeset
    63
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    64
        v := ScrollableView new
130
claus
parents: 122
diff changeset
    65
    or:
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    66
        v := ScrollableView in:someSuperView
130
claus
parents: 122
diff changeset
    67
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    68
    and define the view later with:
130
claus
parents: 122
diff changeset
    69
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    70
        v scrolledView:aViewToBeScrolled
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    71
130
claus
parents: 122
diff changeset
    72
    Finally, if the view to be scrolled has been already created,
claus
parents: 122
diff changeset
    73
    use:
claus
parents: 122
diff changeset
    74
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    75
        v := ScrollableView forView:aViewToBeScrolled
130
claus
parents: 122
diff changeset
    76
    or:    
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    77
        v := ScrollableView forView:aViewToBeScrolled in:someSuperView
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    78
130
claus
parents: 122
diff changeset
    79
    It is also possible to change the scrolledView later (even multiple times).
claus
parents: 122
diff changeset
    80
    This may be useful, if different views are needed to display different types
claus
parents: 122
diff changeset
    81
    of data (see example2) and at creation time, it is not known what type
claus
parents: 122
diff changeset
    82
    of view is required (multimedia applications).
claus
parents: 122
diff changeset
    83
claus
parents: 122
diff changeset
    84
    If you want to scroll views (instead of a views contents), you need a 
claus
parents: 122
diff changeset
    85
    companion class (ViewScroller). See the documentation there.
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    86
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
    87
    If you need horizontal scrolling too, use an instance of HVScrollableView.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    88
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    89
    By default, scrollbars are full size scrollbars - for horizontal scrolling
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    90
    (which is less often used), scrollableViews can optionally be created with
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
    91
    miniscrollers which take up less screen space.
130
claus
parents: 122
diff changeset
    92
claus
parents: 122
diff changeset
    93
    TODO:
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    94
        this is pretty old and needs a rewrite. There are quite some
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    95
        historic leftovers found here and things can be done better
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    96
        (especially in initializeFor...)
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    97
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    98
        Also, it should be rewritten into one class which supports both
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
    99
        Vertical-only, Horizontal-only and HV scrolling.
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   100
        Currently, horizontal-only scrolling is not available.
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   101
        (you have to write your own class ...)
130
claus
parents: 122
diff changeset
   102
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   103
        Finally, some means to hide scrollbars should be added - this would
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   104
        give more screenspace to the view when all is visible 
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   105
        (and therefore, the scrollbars are not needed, anyway)
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   106
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   107
        Expect the above things to be fixed in an upcoming version.
130
claus
parents: 122
diff changeset
   108
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   109
    [author:]
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   110
        Claus Gittinger
130
claus
parents: 122
diff changeset
   111
584
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   112
    [see also:]
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   113
        ScrollBar Scroller
e3b11115fc18 documentation
Claus Gittinger <cg@exept.de>
parents: 572
diff changeset
   114
         HVScrollableView
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   115
"
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   116
!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   117
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   118
examples
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   119
"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   120
  simple scrolled text:
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   121
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   122
        |top scr txt|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   123
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   124
        top := StandardSystemView label:'scroll example1'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   125
        top extent:200@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   126
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   127
        scr := ScrollableView for:EditTextView in:top.
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   128
        scr origin:0.0@0.0 corner:1.0@1.0.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   129
        txt := scr scrolledView.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   130
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   131
        txt list:#('line1'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   132
                   'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   133
                   'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   134
                   'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   135
                   'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   136
                   'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   137
                   'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   138
                   'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   139
                   'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   140
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   141
        top open
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   142
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   143
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
   144
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   145
  changing the scrolledView later:
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   146
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   147
        |top scr txtView1 txtView2 browserView|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   148
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   149
        top := StandardSystemView label:'scroll example2'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   150
        top extent:300@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   151
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   152
        scr := ScrollableView in:top.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   153
        scr origin:0.0@0.0 corner:1.0@1.0.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   154
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   155
        top open.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   156
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   157
        (Delay forSeconds:5) wait.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   158
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   159
        txtView1 := EditTextView new.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   160
        txtView1 list:#(
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   161
                        'wait 5 seconds to see the other text'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   162
                        'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   163
                        'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   164
                        'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   165
                        'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   166
                        'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   167
                        'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   168
                        'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   169
                        'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   170
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   171
        scr scrolledView:txtView1.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   172
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   173
        (Delay forSeconds:5) wait.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   174
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   175
        txtView2 := EditTextView new.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   176
        txtView2 list:#('this is the other views text' 
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   177
                        'alternative line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   178
                        'alternative line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   179
                        'alternative line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   180
                        'alternative line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   181
                        'alternative line6').
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   182
        scr scrolledView:txtView2.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   183
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   184
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   185
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   186
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   187
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   188
  using a miniscroller:
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   189
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   190
        |top scr txt|
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   191
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   192
        top := StandardSystemView label:'scroll example3'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   193
        top extent:200@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   194
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   195
        scr := ScrollableView for:EditTextView miniScroller:true in:top.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   196
        scr origin:0.0@0.0 corner:1.0@1.0.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   197
        txt := scr scrolledView.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   198
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   199
        txt list:#('line1'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   200
                   'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   201
                   'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   202
                   'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   203
                   'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   204
                   'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   205
                   'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   206
                   'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   207
                   'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   208
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   209
        top open
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   210
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   211
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   212
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   213
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   214
  scrolling in both directions:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   215
    Notice: HVScrollableView remains existent for backward compatibility;
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   216
            scrollability can now be controlled in both directions at any
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   217
            time (see examples below).
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   218
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   219
        |top scr txt|
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   220
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   221
        top := StandardSystemView label:'scroll example4'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   222
        top extent:200@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   223
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   224
        scr := HVScrollableView for:EditTextView in:top.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   225
        scr origin:0.0@0.0 corner:1.0@1.0.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   226
        txt := scr scrolledView.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   227
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   228
        txt list:#('line1'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   229
                   'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   230
                   'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   231
                   'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   232
                   'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   233
                   'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   234
                   'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   235
                   'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   236
                   'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   237
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   238
        top open
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   239
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   240
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   241
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   242
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   243
  using a full scroller vertically, miniscroller horizontally:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   244
    Notice: HVScrollableView remains existent for backward compatibility;
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   245
            scrollability can now be controlled in both directions at any
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   246
            time (see examples below).
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   247
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   248
        |top scr txt|
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   249
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   250
        top := StandardSystemView label:'scroll example5'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   251
        top extent:200@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   252
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   253
        scr := HVScrollableView for:EditTextView miniScrollerH:true in:top.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   254
        scr origin:0.0@0.0 corner:1.0@1.0.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   255
        txt := scr scrolledView.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   256
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   257
        txt list:#('line1'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   258
                   'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   259
                   'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   260
                   'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   261
                   'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   262
                   'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   263
                   'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   264
                   'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   265
                   'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   266
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   267
        top open
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   268
                                                                        [exEnd]
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   269
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   270
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   271
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   272
  using miniscrollers for both directions:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   273
    Notice: HVScrollableView remains existent for backward compatibility;
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   274
            scrollability can now be controlled in both directions at any
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   275
            time (see examples below).
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   276
                                                                        [exBegin]
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   277
        |top scr txt|
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   278
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   279
        top := StandardSystemView label:'scroll example6'.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   280
        top extent:200@100.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   281
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   282
        scr := HVScrollableView for:EditTextView miniScroller:true in:top.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   283
        scr origin:0.0@0.0 corner:1.0@1.0.
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   284
        txt := scr scrolledView.
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   285
591
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   286
        txt list:#('line1'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   287
                   'line2'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   288
                   'line3'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   289
                   'line4'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   290
                   'line5'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   291
                   'line7'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   292
                   'line8'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   293
                   'line9'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   294
                   'line10'
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   295
                  ).
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   296
        top open
c746e5229f3d examples
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
   297
                                                                        [exEnd]
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   298
  controlling scrollability:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   299
                                                                        [exBegin]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   300
        |top scr txt|
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   301
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   302
        top := StandardSystemView label:'scroll example6'.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   303
        top extent:200@100.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   304
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   305
        txt := EditTextView new.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   306
        
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   307
        scr := ScrollableView forView:txt in:top.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   308
        scr origin:0.0@0.0 corner:1.0@1.0.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   309
        scr horizontalScrollable:true.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   310
        scr verticalScrollable:false.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   311
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   312
        txt list:#('line1'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   313
                   'line2'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   314
                   'line3'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   315
                   'line4'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   316
                   'line5'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   317
                   'line7'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   318
                   'line8'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   319
                   'line9'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   320
                   'line10'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   321
                  ).
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   322
        top open
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   323
                                                                        [exEnd]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   324
  controlling scrollability and miniScroller:
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   325
                                                                        [exBegin]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   326
        |top scr txt|
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   327
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   328
        top := StandardSystemView label:'scroll example6'.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   329
        top extent:200@100.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   330
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   331
        txt := EditTextView new.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   332
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   333
        scr := ScrollableView forView:txt in:top.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   334
        scr origin:0.0@0.0 corner:1.0@1.0.
1139
8114f5fafdf5 example
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   335
        scr horizontalScrollable:true; horizontalMini:false.
8114f5fafdf5 example
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   336
        scr verticalScrollable:true; verticalMini:true.
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   337
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   338
        txt list:#('line1'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   339
                   'line2'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   340
                   'line3'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   341
                   'line4'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   342
                   'line5'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   343
                   'line7'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   344
                   'line8'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   345
                   'line9'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   346
                   'line10'
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   347
                  ).
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   348
        top open
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   349
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   350
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   351
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   352
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   353
!ScrollableView class methodsFor:'instance creation'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   354
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   355
for:aViewClass
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   356
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   357
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   358
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   359
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   360
    ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   361
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   362
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   363
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   364
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   365
        miniScrollerV:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   366
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   367
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   368
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   369
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   370
    "Created: 6.3.1997 / 18:06:22 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   371
    "Modified: 6.3.1997 / 23:18:32 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   372
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   373
1183
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   374
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   375
    "return a new scrolling view scrolling an instance of aViewClass.
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   376
     The subview is created here.
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   377
     The view will have full scrollbars if the corresponding miniH/miniV
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   378
     is false, miniscrollers if true."
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   379
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   380
    |newView|
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   381
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   382
    aViewClass notNil ifTrue:[
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   383
        newView := aViewClass new.
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   384
    ].
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   385
    ^ self
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   386
        forView:newView
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   387
        hasHorizontalScrollBar:hasH 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   388
        hasVerticalScrollBar:hasV 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   389
        miniScrollerH:miniH 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   390
        miniScrollerV:miniV 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   391
        origin:nil 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   392
        corner:nil 
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   393
        in:nil
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   394
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   395
    "Created: 7.4.1997 / 19:00:14 / cg"
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   396
!
8d69b0c8d289 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   397
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   398
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
   399
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   400
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   401
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   402
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   403
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   404
    |newView|
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   405
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   406
    aViewClass notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   407
        newView := aViewClass new.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   408
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   409
    ^ self
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   410
        forView:newView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   411
        hasHorizontalScrollBar:hasH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   412
        hasVerticalScrollBar:hasV 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   413
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   414
        miniScrollerV:miniV 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   415
        origin:org 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   416
        corner:corn 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   417
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   418
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   419
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   420
     |top scr|
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   421
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   422
     top := StandardSystemView extent:200@200.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   423
     scr := NewScrollableView for:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   424
                 hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   425
                 hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   426
                 miniScrollerH:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   427
                 miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   428
                 origin:0.0@0.0
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   429
                 corner:1.0@1.0
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   430
                 in:top.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   431
     top open
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   432
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   433
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   434
    "Modified: 6.3.1997 / 18:36:01 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   435
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   436
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   437
for:aViewClass in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   439
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   440
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   441
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   442
    ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   443
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   444
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   445
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   446
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   447
        miniScrollerV:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   448
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   449
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   450
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   451
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   452
    "Modified: 6.3.1997 / 23:18:41 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   454
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   455
for:aViewClass miniScroller:mini
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   456
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   457
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
     The view will have full scrollbars if mini is false, miniscrollers
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   459
     if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   460
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   461
    ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   462
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   463
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   464
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   465
        miniScrollerH:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   466
        miniScrollerV:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   467
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   468
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   469
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   470
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   471
    "Modified: 6.3.1997 / 23:18:45 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   472
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   473
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   474
for:aViewClass miniScroller:mini in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   477
     The view will have full scrollbars if mini is false, miniscrollers
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   478
     if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   479
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   480
    ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   481
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   482
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   483
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   484
        miniScrollerH:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   485
        miniScrollerV:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   486
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   487
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   488
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   489
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   490
    "Modified: 6.3.1997 / 23:18:50 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   491
!
153
claus
parents: 132
diff changeset
   492
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   493
for:aViewClass miniScroller:mini origin:org corner:corn in:aView
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   494
    "return a new scrolling view scrolling an instance of aViewClass.
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   495
     The subview is created here.
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   496
     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
   497
     if true."
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   498
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   499
    ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   500
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   501
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   502
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   503
        miniScrollerH:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   504
        miniScrollerV:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   505
        origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   506
        corner:corn 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   507
        in:aView
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   508
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   509
    "Modified: 6.3.1997 / 23:18:53 / cg"
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   510
!
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   511
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   512
for:aViewClass miniScrollerH:miniH
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   513
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   514
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   515
     The view will have full scrollbars if miniH is false, 
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   516
     and a horizontal miniscroller if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   517
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   518
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   519
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   520
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   521
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   522
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   523
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   524
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   525
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   526
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   527
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   528
    "Modified: 6.3.1997 / 18:30:15 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   529
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   530
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   531
for:aViewClass miniScrollerH:miniH in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   532
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   533
     The subview is created here.
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   534
     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
   535
     is false, miniscrollers if true."
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   536
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   537
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   538
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   539
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   540
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   541
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   542
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   543
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   544
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   545
        in:aView
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   546
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   547
    "Modified: 6.3.1997 / 18:30:31 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   548
!
153
claus
parents: 132
diff changeset
   549
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   550
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   551
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   552
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   553
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   554
     is false, miniscrollers if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   555
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   556
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   557
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   558
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   559
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   560
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   561
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   562
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   563
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   564
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   565
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   566
    "Modified: 6.3.1997 / 18:30:47 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   567
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   568
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   569
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   570
    "return a new scrolling view scrolling an instance of aViewClass.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   571
     The subview is created here.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   572
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   573
     is false, miniscrollers if true."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   574
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   575
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   576
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   577
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   578
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   579
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   580
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   581
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   582
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   583
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   584
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   585
    "Modified: 6.3.1997 / 18:31:02 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   586
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   587
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   588
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
   589
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   590
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   591
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   592
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   593
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   594
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   595
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   596
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   597
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   598
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   599
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   600
        origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   601
        corner:corn 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   602
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   603
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   604
    "Modified: 6.3.1997 / 18:31:17 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   605
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   606
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   607
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   608
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   609
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   610
     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
   611
     a miniscroller if true."
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
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   614
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   615
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   616
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   617
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   618
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   619
        origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   620
        corner:corn 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   621
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   622
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   623
    "Modified: 6.3.1997 / 18:31:28 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   624
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   625
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   626
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   627
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   628
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   629
     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
   630
     a miniscroller if true."
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
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   633
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   634
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   635
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   636
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   637
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   638
        origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   639
        corner:corn 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   640
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   641
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   642
    "Modified: 6.3.1997 / 18:31:41 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   643
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   644
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   645
for:aViewClass origin:org corner:corner in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   646
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   647
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   648
     The view will have full scrollbars."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   649
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   650
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   651
        for:aViewClass
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   652
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   653
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   654
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   655
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   656
        origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   657
        corner:corner 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   658
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   659
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   660
    "Modified: 6.3.1997 / 23:19:05 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   661
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   662
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   663
forView:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   664
    "return a new scrolling view scrolling aView.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   665
     The view will have full scrollbars."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   666
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   667
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   668
        forView:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   669
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   670
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   671
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   672
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   673
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   674
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   675
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   676
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   677
    "Modified: 6.3.1997 / 23:19:08 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   678
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   679
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   680
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
   681
    "return a new scrolling view scrolling an instance of aViewClass.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   682
     The subview is created here.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   683
     The view will have full scrollbars if the corresponding miniH/miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   684
     is false, miniscrollers if true."
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   685
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   686
    |newView dev|
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   687
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   688
    aView notNil ifTrue:[
703
8889152157c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   689
        dev := aView graphicsDevice
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   690
    ] ifFalse:[ 
703
8889152157c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   691
        dev := Screen current
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   692
    ].
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   693
    newView := self basicNew device:dev.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   694
    newView initialize.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   695
    newView setupVertical:hasV mini:miniV horizontal:hasH mini:miniH.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   696
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   697
    aScrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   698
        newView scrolledView:aScrolledView.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   699
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   700
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   701
    org notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   702
        newView origin:org
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   703
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   704
    corn notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   705
        newView corner:corn
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   706
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   707
300
0823ef38e629 adding/removing views to Panels
ah
parents: 248
diff changeset
   708
    aView notNil ifTrue:[
703
8889152157c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   709
        aView addSubView:newView
153
claus
parents: 132
diff changeset
   710
    ].
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   711
    ^ newView
703
8889152157c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   712
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   713
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   714
     |top scr|
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   715
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   716
     top := StandardSystemView extent:200@200.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   717
     scr := NewScrollableView 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   718
                 forView:(TextView new)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   719
                 hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   720
                 hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   721
                 miniScrollerH:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   722
                 miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   723
                 origin:0.0@0.0
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   724
                 corner:1.0@1.0
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   725
                 in:top.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   726
     top open
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   727
    "
546
b643875bda30 more inst creation variations
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   728
1135
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
   729
    "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
   730
    "Modified: 19.3.1997 / 15:32:51 / stefan"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   731
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   732
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   733
forView:aView in:aSuperView
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   734
    "return a new scrolling view scrolling aView.
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   735
     The view will have full scrollbars."
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   736
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   737
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   738
        forView:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   739
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   740
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   741
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   742
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   743
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   744
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   745
        in:aSuperView
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   746
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   747
    "Modified: 6.3.1997 / 23:19:12 / cg"
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   748
!
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   749
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   750
forView:aView miniScrollerH:mini
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   751
    "return a new scrolling view scrolling aView.
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   752
     The view will have a full vertical scrollbar and a horizontal
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   753
     miniScroller if mini is true."
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   754
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   755
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   756
        forView:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   757
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   758
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   759
        miniScrollerH:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   760
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   761
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   762
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   763
        in:nil
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   764
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   765
    "Modified: 6.3.1997 / 18:32:58 / cg"
248
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   766
!
c58fabf73c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   767
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   768
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   769
    "return a new scrolling view, scrolling aView.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   770
     The view will have full scrollbars if the corresponding miniH/miniV
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   771
     is false, miniscrollers if true."
153
claus
parents: 132
diff changeset
   772
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   773
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   774
        forView:scrolledView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   775
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   776
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   777
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   778
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   779
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   780
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   781
        in:aView
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   782
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   783
    "Modified: 6.3.1997 / 18:33:20 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   784
!
153
claus
parents: 132
diff changeset
   785
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   786
in:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   787
    "return a new scrolling view to be contained in aView.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   788
     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
   789
     the scrolledView: method.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   790
     The view will have full scrollbars."
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   791
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   792
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   793
        forView:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   794
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   795
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   796
        miniScrollerH:false 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   797
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   798
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   799
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   800
        in:aView
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   801
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   802
    "Modified: 6.3.1997 / 23:19:19 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   803
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   804
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   805
miniScroller:mini
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   806
    "return a new scrolling view. The subview will be created later.
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   807
     The view will have full scrollbars if mini is false, 
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   808
     miniscrollers if true."
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   809
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   810
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   811
        forView:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   812
        hasHorizontalScrollBar:(self == HVScrollableView)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   813
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   814
        miniScrollerH:mini 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   815
        miniScrollerV:mini
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   816
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   817
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   818
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   819
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   820
    "Modified: 6.3.1997 / 23:19:21 / cg"
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   821
!
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   822
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   823
miniScrollerH:miniH
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   824
    "return a new scrolling view. The subview will be created later.
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   825
     The view will have full scrollbars if miniH is false, 
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   826
     and a horizontal miniscroller if true."
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   827
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   828
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   829
        forView:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   830
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   831
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   832
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   833
        miniScrollerV:false
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   834
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   835
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   836
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   837
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   838
    "Modified: 6.3.1997 / 18:34:06 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   839
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   840
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   841
miniScrollerH:miniH miniScrollerV:miniV
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   842
    "return a new scrolling view. The subview will be created later.
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   843
     The view will have full scrollbars if the corresponding miniH/miniV
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   844
     is false, miniscrollers if true."
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   845
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   846
     ^ self 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   847
        forView:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   848
        hasHorizontalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   849
        hasVerticalScrollBar:true
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   850
        miniScrollerH:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   851
        miniScrollerV:miniV
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   852
        origin:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   853
        corner:nil 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   854
        in:nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   855
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   856
    "Modified: 6.3.1997 / 18:34:16 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   857
! !
93
f608d94e31ff *** empty log message ***
claus
parents: 77
diff changeset
   858
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
   859
!ScrollableView class methodsFor:'defaults'!
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   860
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   861
updateStyleCache
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   862
    "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
   863
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   864
    <resource: #style (#scrolledViewLevel #scrolledViewMargin)>
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   865
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   866
    |defLevel defMargin defSpacing|
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
   867
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   868
    StyleSheet is3D ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   869
        defLevel := -1.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   870
        defMargin := ViewSpacing // 2.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   871
        defSpacing := defMargin.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   872
    ] ifFalse:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   873
        defLevel := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   874
        defMargin := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   875
        defSpacing := 0
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   876
    ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   877
    DefaultScrolledViewLevel := StyleSheet at:'scrolledViewLevel' default:defLevel.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   878
    DefaultScrolledViewBorderWidth := StyleSheet at:'scrolledViewBorderWidth' default:nil.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   879
    DefaultScrolledViewMargin := StyleSheet at:'scrolledViewMargin' default:defMargin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   880
    DefaultScrollBarSpacing := StyleSheet at:'scrollBarSpacing' default:defSpacing.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   881
    DefaultLevel := StyleSheet at:'scrollableViewLevel' default:nil.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   882
    DefaultScrollBarLevel := StyleSheet at:'scrollBarLevel' default:nil.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   883
    MyDefaultViewBackgroundColor := StyleSheet at:'scrollableViewBackgroundColor' default:DefaultViewBackgroundColor.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   884
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   885
    "
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   886
     self updateStyleCache
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   887
    "
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: 7.3.1997 / 15:03:37 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   890
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   891
1140
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   892
!ScrollableView methodsFor:'accessing-behavior'!
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   893
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   894
autoHideScrollBars:aBoolean
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   895
    "set/clear the flag which controls if scrollBars should
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   896
     be made invisible dynamically, if there is nothing to scroll
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   897
     (and shown if there is). 
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   898
     This flags setting is normally controlled by the styleSheet."
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   899
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   900
    hideScrollBars := aBoolean.
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   901
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   902
    "Modified: 19.3.1997 / 16:28:42 / cg"
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   903
    "Created: 19.3.1997 / 17:24:39 / cg"
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   904
! !
cb2adac34c6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   905
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   906
!ScrollableView methodsFor:'accessing-components'!
119
claus
parents: 113
diff changeset
   907
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   908
horizontalScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   909
    "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
   910
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   911
    ^ hScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   912
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   913
    "Modified: 6.3.1997 / 16:59:24 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   914
    "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
   915
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   916
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   917
scrollBar
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   918
    "return the vertical scrollbar (or nil, if there is none)"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   919
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   920
    ^ vScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   921
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   922
    "Modified: 6.3.1997 / 16:59:29 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   923
    "Created: 6.3.1997 / 18:06:23 / cg"
119
claus
parents: 113
diff changeset
   924
!
claus
parents: 113
diff changeset
   925
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   926
scrolledView
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   927
    "return the scrolled view (or nil, if there is none)"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   928
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   929
    ^ scrolledView
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   930
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   931
    "Modified: 6.3.1997 / 16:48:09 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   932
    "Created: 6.3.1997 / 18:06:23 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   933
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
   934
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   935
scrolledView:aView
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   936
    "set the view to scroll"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   937
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   938
    scrolledView notNil ifTrue:[
982
bd9d2993a1be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   939
        scrolledView removeDependent:self.
814
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   940
        scrolledView destroy.
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   941
        scrolledView := nil.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   942
    ].
982
bd9d2993a1be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
   943
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   944
    scrolledView := aView.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   945
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   946
    super addSubViewFirst:aView.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   947
    scrolledView notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   948
        self setScrollActions.
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   949
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   950
        realized ifTrue:[
1134
f4f1e67f1ff2 setupDimension late in realize
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
   951
            self setupDimensions.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   952
            self sizeChanged:nil.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   953
            scrolledView realize
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   954
        ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   955
    ]
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   956
1135
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
   957
    "Modified: 7.3.1997 / 22:24:43 / cg"
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
   958
    "Modified: 19.3.1997 / 15:32:37 / stefan"
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   959
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   960
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   961
verticalScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   962
    "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
   963
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   964
    ^ vScrollBar
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   965
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
   966
    "Modified: 6.3.1997 / 16:59:24 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   967
    "Created: 6.3.1997 / 18:06:23 / cg"
1253
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   968
!
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   969
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   970
widget
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   971
    "for ST80 compatibility (where a wrapper returns its wrapped
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   972
     widget), return the scrolledView here"
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   973
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   974
    ^ scrolledView
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   975
385bb80488f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
   976
    "Created: 20.6.1997 / 14:45:16 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   977
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   978
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   979
!ScrollableView methodsFor:'accessing-look'!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   980
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   981
horizontalMini:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   982
    "control the horizontal scrollBar to be either a miniScroller,
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   983
     or a full scrollBar."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   984
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   985
    horizontalMini ~~ aBoolean ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   986
        horizontalMini := aBoolean.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
   987
        self setupViews.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
   988
        shown ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
   989
            self setupDimensions.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
   990
        ]
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   991
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   992
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   993
    "Created: 7.3.1997 / 21:57:02 / cg"
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
   994
    "Modified: 8.4.1997 / 00:45:03 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   995
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   996
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
   997
horizontalScrollable:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   998
    "enable/disable horizontal scrollability.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   999
     If disabled, the horizontal scrollBar is made invisible."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1000
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1001
    hasHorizontalScrollBar ~~ aBoolean ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1002
        hasHorizontalScrollBar := aBoolean.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1003
        hScrollBarHidden := false.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1004
        self setupViews.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1005
        shown ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1006
            self setupDimensions.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1007
        ]
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1008
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1009
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1010
    "Created: 7.3.1997 / 21:56:28 / cg"
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1011
    "Modified: 8.4.1997 / 00:45:00 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1012
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1013
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1014
verticalMini:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1015
    "control the vertical scrollBar to be either a miniScroller,
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1016
     or a full scrollBar."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1017
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1018
    verticalMini ~~ aBoolean ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1019
        verticalMini := aBoolean.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1020
        self setupViews.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1021
        shown ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1022
            self setupDimensions.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1023
        ]
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1024
    ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1025
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1026
    "Created: 7.3.1997 / 21:56:57 / cg"
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1027
    "Modified: 8.4.1997 / 00:44:57 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1028
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1029
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1030
verticalScrollable:aBoolean
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1031
    "enable/disable vertical scrollability.
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1032
     If disabled, the vertical scrollBar is made invisible."
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1033
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1034
    hasVerticalScrollBar ~~ aBoolean ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1035
        hasVerticalScrollBar := aBoolean.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1036
        vScrollBarHidden := false.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1037
        self setupViews.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1038
        shown ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1039
            self setupDimensions.
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1040
        ]
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1041
    ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1042
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1043
    "Created: 7.3.1997 / 21:56:39 / cg"
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1044
    "Modified: 8.4.1997 / 00:44:53 / cg"
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1045
! !
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1046
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1047
!ScrollableView methodsFor:'changes '!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1048
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1049
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
  1050
    "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
  1051
     be updated as well"
132
claus
parents: 130
diff changeset
  1052
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1053
    changedObject == scrolledView ifTrue:[
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1054
        something == #sizeOfContents ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1055
            vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1056
                vScrollBar setThumbFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1057
            ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1058
            hScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1059
                hScrollBar setThumbFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1060
            ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1061
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1062
        something == #originOfContents ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1063
            lockUpdates ifFalse:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1064
                vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1065
                    vScrollBar setThumbOriginFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1066
                ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1067
                hScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1068
                    hScrollBar setThumbOriginFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1069
                ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1070
            ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1071
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1072
1231
aba877015224 specClass
ca
parents: 1201
diff changeset
  1073
       self updateScrollBarVisibility
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1074
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1075
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1076
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1077
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1078
updateScrollBarVisibility
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1079
    "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
  1080
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1081
    |anyChange|
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1082
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1083
    hideScrollBars ifFalse:[^ self].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1084
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1085
    anyChange := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1086
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1087
    vScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1088
        vScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1089
            vScrollBarHidden ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1090
                vScrollBarHidden := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1091
                vScrollBar beInvisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1092
                anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1093
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1094
        ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1095
            vScrollBarHidden ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1096
                vScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1097
                vScrollBar beVisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1098
                anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1099
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1100
        ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1101
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1102
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1103
    hScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1104
        hScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1105
            hScrollBarHidden ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1106
                hScrollBarHidden := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1107
                hScrollBar beInvisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1108
                anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1109
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1110
        ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1111
            hScrollBarHidden ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1112
                hScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1113
                hScrollBar beVisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1114
                anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1115
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1116
        ]
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1117
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1118
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1119
    anyChange ifTrue:[
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1120
        self setupDimensions.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1121
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1122
        "/ force him to recompute its dimension ...
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1123
        scrolledView notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1124
            vScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1125
                vScrollBar setThumbFor:scrolledView.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1126
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1127
            hScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1128
                hScrollBar setThumbFor:scrolledView.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1129
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1130
        ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1131
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1132
        "/ stupid - showing one may need the other ...
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1133
        "/ and vice versa; do it again.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1134
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1135
        anyChange := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1136
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1137
        vScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1138
            vScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1139
                vScrollBarHidden ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1140
                    vScrollBarHidden := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1141
                    vScrollBar beInvisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1142
                    anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1143
                ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1144
            ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1145
                vScrollBarHidden ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1146
                    vScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1147
                    vScrollBar beVisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1148
                    anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1149
                ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1150
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1151
        ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1152
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1153
        hScrollBar notNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1154
            hScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1155
                hScrollBarHidden ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1156
                    hScrollBarHidden := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1157
                    hScrollBar beInvisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1158
                    anyChange := true.
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
            ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1161
                hScrollBarHidden ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1162
                    hScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1163
                    hScrollBar beVisible.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1164
                    anyChange := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1165
                ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1166
            ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1167
        ].
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
        anyChange ifTrue:[
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1170
            self setupDimensions.
1135
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
  1171
        ].
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
1135
acdeed6efc13 Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents: 1134
diff changeset
  1174
    "Modified: 19.3.1997 / 15:33:36 / stefan"
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1175
    "Modified: 28.3.1997 / 17:32:09 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1176
! !
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1177
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1178
!ScrollableView methodsFor:'event processing'!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1179
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1180
keyPress:key x:x y:y
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1181
    "a key was pressed - handle page-keys here"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1182
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1183
    <resource: #keyboard ( #Prior #Next ) >
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1184
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1185
    (key == #Prior)    ifTrue: [^ self pageUp].
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1186
    (key == #Next)     ifTrue: [^ self pageDown].
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1187
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1188
    super keyPress:key x:x y:y
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1189
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1190
    "Created: 6.3.1997 / 18:06:23 / cg"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1191
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1192
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1193
sizeChanged:how
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1194
    "handle size changes - this may change any scrollBars visibility"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1195
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1196
    |orgX orgY scroll|
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1197
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1198
    "/ resize components manually, in an order which is optimal
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1199
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1200
    how == #smaller ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1201
        "/ first resize the horizontalScrollBar,
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1202
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1203
        scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1204
            scrolledView containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1205
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1206
        hScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1207
            hScrollBar containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1208
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1209
        vScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1210
            vScrollBar containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1211
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1212
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1213
        hScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1214
            hScrollBar containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1215
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1216
        vScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1217
            vScrollBar containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1218
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1219
        scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1220
            scrolledView containerChangedSize
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1221
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1222
    ].
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1223
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1224
    scrolledView isNil ifTrue:[^ self].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1225
    (hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[^ self].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1226
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1227
    vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1228
        vScrollBar setThumbFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1229
    ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1230
    hScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1231
        hScrollBar setThumbFor:scrolledView.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1232
    ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1233
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1234
    "/ 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
  1235
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1236
    hScrollBar isNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1237
        "/ only care for vertical ...
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1238
        vScrollBar thumbOrigin + vScrollBar thumbHeight >= 100 ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1239
            vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1240
            scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin.
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1241
        ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1242
    ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1243
        vScrollBar isNil ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1244
            "/ only care for horizontal ...
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1245
            hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1246
                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1247
                scrolledView scrollVerticalToPercent:hScrollBar thumbOrigin.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1248
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1249
        ] ifFalse:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1250
            "/ care for both ...
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1251
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1252
            orgY := vScrollBar thumbOrigin.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1253
            orgX := hScrollBar thumbOrigin.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1254
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1255
            scroll := false.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1256
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1257
            orgY + vScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1258
                vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1259
                orgY := vScrollBar thumbOrigin.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1260
                scroll := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1261
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1262
            orgX + hScrollBar thumbHeight >= 100 ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1263
                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1264
                orgX := hScrollBar thumbOrigin.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1265
                scroll := true.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1266
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1267
            scroll ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1268
                scrolledView scrollToPercent:(orgX@orgY).
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1269
            ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1270
        ]
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1271
    ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1272
    self updateScrollBarVisibility.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1273
1160
f3204cabcce8 must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1274
    "Modified: 28.3.1997 / 17:25:38 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1275
! !
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1276
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1277
!ScrollableView methodsFor:'forced scroll'!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1278
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1279
pageDown
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1280
    "page down - but only if there is a vertical scrollbar"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1281
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1282
    vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1283
        vScrollBar pageDown
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1284
    ]
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1285
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1286
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1287
    "Modified: 19.3.1997 / 16:32:34 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1288
!
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1289
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1290
pageLeft
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1291
    "page left - but only if there is a horizontal scrollbar"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1292
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1293
    hScrollBar notNil ifTrue:[
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1294
        hScrollBar pageDown
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1295
    ]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1296
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1297
    "Created: 19.3.1997 / 16:32:14 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1298
    "Modified: 19.3.1997 / 16:32:44 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1299
!
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1300
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1301
pageRight
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1302
    "page right - but only if there is a horizontal scrollbar"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1303
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1304
    hScrollBar notNil ifTrue:[
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1305
        hScrollBar pageUp
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1306
    ]
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1307
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1308
    "Created: 19.3.1997 / 16:32:22 / cg"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1309
    "Modified: 19.3.1997 / 16:32:48 / cg"
113
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1310
!
fdd18cfff57e *** empty log message ***
claus
parents: 110
diff changeset
  1311
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1312
pageUp
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1313
    "page up - but only if there is a vertical scrollbar"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1314
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1315
    vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1316
        vScrollBar pageUp
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1317
    ]
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1318
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1319
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1320
    "Modified: 19.3.1997 / 16:32:38 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1321
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1322
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1323
!ScrollableView methodsFor:'initialization'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1324
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1325
initStyle
958
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
  1326
    "initialize style specifics"
b75025112346 commentary
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
  1327
1141
1db65b164cd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  1328
    <resource: #style (#scrollBarPosition #scrollBarHiding)>
608
aedd7bf72edc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 591
diff changeset
  1329
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1330
    super initStyle.
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1331
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1332
    viewBackground := MyDefaultViewBackgroundColor. 
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1333
    scrollBarPosition := styleSheet at:'scrollBarPosition' default:#left.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1334
    hideScrollBars := styleSheet at:'scrollBarHiding' default:false.
608
aedd7bf72edc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 591
diff changeset
  1335
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1336
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1337
    "Modified: 19.3.1997 / 16:32:59 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1338
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1339
1247
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1340
initialize
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1341
    "setup some default"
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1342
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1343
    verticalMini := horizontalMini := false.
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1344
    hasVerticalScrollBar := hasHorizontalScrollBar := false.
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1345
    super initialize.
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1346
!
98f8f679f480 set defaults
ca
parents: 1243
diff changeset
  1347
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1348
realize
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1349
    "realize (i.e. make me visible).
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1350
     Since scrolledView may have done something to its contents
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1351
     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
  1352
     changes; do it now"
1160
f3204cabcce8 must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1353
1161
5142fbafeb92 must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1354
    self setupDimensions.
1176
29d0a646cbdf must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents: 1161
diff changeset
  1355
    super realize.
1201
e7f1cf0180ca must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1356
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1357
    scrolledView notNil ifTrue:[
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1358
        vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1359
            vScrollBar setThumbFor:scrolledView
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1360
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1361
        hScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1362
            hScrollBar setThumbFor:scrolledView
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1363
        ].
1201
e7f1cf0180ca must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1364
        self updateScrollBarVisibility.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1365
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1366
1201
e7f1cf0180ca must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1367
    "Modified: 23.4.1997 / 13:59:59 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1368
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1369
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1370
releaseHorizontalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1371
    "destroy any horizontal scrollBar"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1372
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1373
    hScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1374
        hScrollBar destroy.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1375
        hScrollBar := nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1376
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1377
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1378
    "Modified: 6.3.1997 / 17:43:20 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1379
    "Created: 6.3.1997 / 18:06:23 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1380
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1381
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1382
releaseVerticalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1383
    "destroy any vertical scrollBar"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1384
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1385
    vScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1386
        vScrollBar destroy.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1387
        vScrollBar := nil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1388
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1389
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1390
    "Created: 6.3.1997 / 18:06:23 / cg"
1097
9f3ae8f08ffe checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  1391
!
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1392
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1393
setScrollActions
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1394
    "lock prevents repositioning the scroller to the
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1395
     actual (often rounded) position while scrolling,
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1396
     and keeps it instead at the pointer position.
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1397
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1398
     (this avoids run-away scroller when scrolling
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1399
      textviews, when the text is aligned line-wise).
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1400
      Consider this as a kludge."
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1401
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
  1402
    lockUpdates := false.
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1403
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1404
    vScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1405
        vScrollBar scrollAction:[:position |
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1406
            lockUpdates := true.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1407
            scrolledView scrollVerticalToPercent:position.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1408
            lockUpdates := false
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1409
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1410
        vScrollBar scrollUpAction:[scrolledView scrollUp].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1411
        vScrollBar scrollDownAction:[scrolledView scrollDown].
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1412
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1413
    hScrollBar notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1414
        hScrollBar scrollAction:[:position |
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1415
            lockUpdates := true.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1416
            scrolledView scrollHorizontalToPercent:position.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1417
            lockUpdates := false
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1418
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1419
        hScrollBar scrollUpAction:[scrolledView scrollLeft].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1420
        hScrollBar scrollDownAction:[scrolledView scrollRight].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1421
    ].
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1422
65
b33e4f3a264e *** empty log message ***
claus
parents: 63
diff changeset
  1423
    scrolledView addDependent:self.
814
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1424
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1425
    "
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1426
     pass my keyboard input (and other subviews input) 
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1427
     to the scrolled view ...
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1428
    "
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1429
    self delegate:(KeyboardForwarder toView:scrolledView).
5b80bc44f52b share code
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
  1430
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1431
    "Modified: 6.3.1997 / 17:03:43 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1432
    "Created: 6.3.1997 / 18:06:23 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1433
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1434
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1435
setupDimensions
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1436
    "set the components dimensions (i.e. layouts) according to
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1437
     the scrollability and hidden settings"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1438
1113
c0933ddd159d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1111
diff changeset
  1439
    |scrolledViewMargin scrollBarSpacing
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1440
     scrolledViewLayout hScrollBarLayout vScrollBarLayout
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1441
     vBd         "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1442
     hBd         "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1443
     sBd         "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1444
     wVScroll    "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1445
     hHScroll    "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1446
     hLeftOffs   "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1447
     hRightOffs  "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1448
     hTopOffs    "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1449
     hBottomOffs "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1450
     sLeftOffs   "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1451
     sRightOffs  "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1452
     sTopOffs    "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1453
     sBottomOffs "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1454
     vLeftOffs   "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1455
     vRightOffs  "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1456
     vTopOffs    "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1457
     vBottomOffs "{ Class: SmallInteger }"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1458
     addMargin   "{ Class: SmallInteger }"|
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1459
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1460
    DefaultLevel notNil ifTrue:[self level:DefaultLevel].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1461
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1462
    sBd := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1463
    DefaultScrolledViewBorderWidth notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1464
        sBd := DefaultScrolledViewBorderWidth.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1465
        scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1466
            scrolledView borderWidth:DefaultScrolledViewBorderWidth.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1467
        ]
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1468
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1469
        scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1470
            sBd := scrolledView borderWidth
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1471
        ]
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1472
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1473
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1474
    (vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1475
        vBd := vScrollBar borderWidth.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1476
        wVScroll := vScrollBar widthIncludingBorder.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1477
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1478
        vBd := wVScroll := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1479
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1480
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1481
    (hScrollBar notNil and:[hScrollBarHidden not])  ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1482
        hBd := hScrollBar borderWidth.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1483
        hHScroll := hScrollBar heightIncludingBorder.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1484
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1485
        hBd := hHScroll := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1486
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1487
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1488
    "/ the raw layout ...
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1489
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1490
    scrolledViewLayout := ((0.0 @ 0.0) corner:(1.0@1.0)) asLayout.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1491
    hScrollBarLayout := ((0.0 @ 1.0) corner:(1.0@1.0)) asLayout.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1492
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1493
    "/ the painful details; mostly complicated for 2D styles,
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1494
    "/ where the positions are setUp to overlay borders ...
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1495
    "/ (well, with 3D styles, a single pixel error will not be noticed;
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1496
    "/  but 2D styles are very sensitive to those;
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1497
    "/  the code below may not work correctly with different borderWidths).
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1498
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1499
    scrolledViewMargin := DefaultScrolledViewMargin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1500
    scrollBarSpacing := DefaultScrollBarSpacing.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1501
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1502
    vTopOffs := 0 - vBd + scrolledViewMargin + margin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1503
    scrolledViewMargin == 0 ifTrue:[
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1504
        vBottomOffs := vBd - scrolledViewMargin - sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1505
    ] ifFalse:[
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1506
        vBottomOffs := vBd - scrolledViewMargin + sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1507
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1508
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1509
    hLeftOffs := 0 - hBd + scrolledViewMargin + margin.
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1510
    hRightOffs := hBd - scrolledViewMargin - sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1511
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1512
    sLeftOffs := 0 - hBd + scrolledViewMargin + margin.
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1513
    sRightOffs := hBd - scrolledViewMargin - sBd - sBd - sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1514
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1515
    scrolledViewMargin == 0 ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1516
        sTopOffs := 0 - sBd + margin.
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1517
        sBottomOffs := sBd - sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1518
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1519
        sTopOffs := 0 + scrolledViewMargin + margin.
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1520
        sBottomOffs := sBd - scrolledViewMargin - sBd - sBd - sBd.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1521
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1522
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1523
    addMargin := 0.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1524
"/    DefaultScrollBarLevel == DefaultScrolledViewLevel
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1525
"/        addMargin := 1.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1526
"/    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1527
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1528
    (vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1529
        scrollBarPosition == #right ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1530
            "/ right/bottom
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1531
            vScrollBarLayout := ((1.0 @ 0.0) corner:(1.0@1.0)) asLayout.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1532
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1533
            vRightOffs := 0 - scrolledViewMargin + margin "???".
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1534
            vLeftOffs := vRightOffs - wVScroll.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1535
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1536
            sRightOffs := sRightOffs - scrollBarSpacing - wVScroll + sBd.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1537
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1538
            hRightOffs := hRightOffs - wVScroll - scrollBarSpacing - sBd.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1539
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1540
            sRightOffs := sRightOffs - addMargin
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1541
        ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1542
            "/ left/bottom
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1543
            vScrollBarLayout := ((0.0 @ 0.0) corner:(0.0@1.0)) asLayout.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1544
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1545
            vLeftOffs := 0 - vBd + scrolledViewMargin + margin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1546
            vRightOffs := vLeftOffs + wVScroll + margin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1547
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1548
            sLeftOffs := wVScroll + scrolledViewMargin + scrollBarSpacing + margin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1549
            sRightOffs := 0 - scrolledViewMargin - margin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1550
            hLeftOffs := hLeftOffs + wVScroll + vBd + scrollBarSpacing.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1551
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1552
            sLeftOffs := sLeftOffs + addMargin
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1553
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1554
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1555
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1556
    (hScrollBar notNil and:[hScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1557
        hBottomOffs := 0 - scrolledViewMargin - hBd + margin "???".
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1558
        hTopOffs := hBottomOffs - hHScroll.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1559
        scrolledViewMargin == 0 ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1560
            hTopOffs := hTopOffs + sBd + sBd
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1561
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1562
        sBottomOffs := sBottomOffs - scrollBarSpacing - hHScroll.
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1563
        (vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1564
            vBottomOffs := vBottomOffs - scrollBarSpacing - hHScroll.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1565
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1566
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1567
        sBottomOffs := sBottomOffs - addMargin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1568
        hRightOffs := hRightOffs - addMargin.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1569
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1570
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1571
    scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1572
        scrolledViewLayout leftOffset:sLeftOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1573
        scrolledViewLayout rightOffset:sRightOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1574
        scrolledViewLayout topOffset:sTopOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1575
        scrolledViewLayout bottomOffset:sBottomOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1576
1243
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1577
        ((hScrollBar isNil or:[hScrollBarHidden])
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1578
        and:[(vScrollBar isNil or:[vScrollBarHidden])]) ifTrue:[
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1579
            scrolledView level:0
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1580
        ] ifFalse:[
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1581
            scrolledView level:DefaultScrolledViewLevel.
064852ff0ef7 set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents: 1231
diff changeset
  1582
        ].
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1583
        scrolledView layout:scrolledViewLayout.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1584
    ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1585
    (hScrollBar notNil and:[hScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1586
        hScrollBarLayout leftOffset:hLeftOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1587
        hScrollBarLayout rightOffset:hRightOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1588
        hScrollBarLayout topOffset:hTopOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1589
        hScrollBarLayout bottomOffset:hBottomOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1590
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1591
        hScrollBar level:DefaultScrollBarLevel.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1592
        hScrollBar layout:hScrollBarLayout
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1593
    ].
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1594
    (vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1595
        vScrollBarLayout leftOffset:vLeftOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1596
        vScrollBarLayout rightOffset:vRightOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1597
        vScrollBarLayout topOffset:vTopOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1598
        vScrollBarLayout bottomOffset:vBottomOffs.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1599
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1600
        vScrollBar level:DefaultScrollBarLevel.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1601
        vScrollBar layout:vScrollBarLayout
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1602
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1603
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1604
    "Created: 6.3.1997 / 18:06:23 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1605
    "Modified: 19.3.1997 / 16:33:56 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1606
!
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1607
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1608
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH 
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1609
    "setup scrollbars as specified in the arguments"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1610
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1611
    |noMiniScrollers|
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1612
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1613
    vScrollBarHidden := hScrollBarHidden := false.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1614
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1615
    hasVerticalScrollBar := isVertical.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1616
    hasHorizontalScrollBar := isHorizontal.
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1617
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1618
    noMiniScrollers := styleSheet at:'scrollBarNeverMini' default:false.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1619
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1620
    verticalMini := miniV.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1621
    verticalMini ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1622
        noMiniScrollers ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1623
            verticalMini := false
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1624
        ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1625
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1626
    horizontalMini := miniH.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1627
    horizontalMini ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1628
        noMiniScrollers ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1629
            horizontalMini := false
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1630
        ]
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1631
    ].
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1632
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1633
    self setupViews.
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1634
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1635
    "Modified: 7.3.1997 / 22:09:12 / cg"
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1636
!
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1637
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1638
setupViews 
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1639
    "setup scrollbars as specified in the arguments"
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1640
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1641
    |cls|
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1642
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1643
    hasVerticalScrollBar ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1644
        cls := ScrollBar. 
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1645
        verticalMini ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1646
            cls := MiniScroller
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1647
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1648
        (vScrollBar notNil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1649
        and:[vScrollBar class ~~ cls]) ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1650
            self releaseVerticalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1651
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1652
        vScrollBar isNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1653
            vScrollBar := cls in:self.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1654
            realized ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1655
                vScrollBar realize
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1656
            ]
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1657
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1658
        vScrollBar thumbOrigin:0 thumbHeight:100.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1659
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1660
        vScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1661
            self releaseVerticalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1662
        ]
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1663
    ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1664
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1665
    hasHorizontalScrollBar ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1666
        cls := HorizontalScrollBar. 
1126
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1667
        horizontalMini ifTrue:[
2c698745c81f added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1668
            cls := HorizontalMiniScroller
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1669
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1670
        (hScrollBar notNil
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1671
        and:[hScrollBar class ~~ cls]) ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1672
            self releaseHorizontalScrollBar
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1673
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1674
        hScrollBar isNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1675
            hScrollBar := cls in:self.
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1676
            realized ifTrue:[
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1677
                hScrollBar realize
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1678
            ]
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1679
        ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1680
        hScrollBar thumbOrigin:0 thumbHeight:100.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1681
    ] ifFalse:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1682
        hScrollBar notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1683
            self releaseHorizontalScrollBar
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
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1687
    scrolledView notNil ifTrue:[
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1688
        self setScrollActions.
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1689
    ]
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1690
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1691
    "Created: 6.3.1997 / 18:06:23 / cg"
1184
733373c4f445 dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents: 1183
diff changeset
  1692
    "Modified: 8.4.1997 / 00:44:33 / cg"
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1693
! !
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
  1694
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1695
!ScrollableView methodsFor:'queries'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1696
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1697
isHorizontalScrollable
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1698
    "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
  1699
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1700
    ^ hScrollBar notNil
819
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1701
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1702
    "Modified: 6.3.1997 / 17:03:49 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1703
    "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
  1704
!
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1705
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1706
isVerticalScrollable
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1707
    "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
  1708
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1709
    ^ vScrollBar notNil
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1710
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1711
    "Modified: 6.3.1997 / 17:03:52 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1712
    "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
  1713
!
32ac89843fa8 Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents: 814
diff changeset
  1714
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1715
preferredExtent
572
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1716
    "return my preferredExtent from the scrolledViews prefExtent
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1717
     plus the size of the scrollBar"
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1718
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1719
    |slavesPref prefX prefY|
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1720
799
64f8700489a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  1721
    "/ If I have an explicit preferredExtent ..
64f8700489a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  1722
713
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  1723
    preferredExtent notNil ifTrue:[
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  1724
        ^ preferredExtent
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  1725
    ].
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  1726
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1727
    scrolledView notNil ifTrue:[ 
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1728
        slavesPref := scrolledView preferredExtent.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1729
        prefX := slavesPref x.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1730
        prefY := slavesPref y.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1731
        vScrollBar notNil ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1732
            prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1733
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1734
        hScrollBar notNil ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1735
            prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1736
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1737
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1738
        ^ prefX @ prefY.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1739
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1740
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1741
    ^ super preferredExtent.
572
121735c2aff6 commentary
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1742
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1743
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1744
    "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
  1745
!
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1746
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1747
preferredExtentForLines:numLines cols:numCols
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1748
    "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
  1749
     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
  1750
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1751
    |slavesPref prefX prefY|
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1752
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1753
    "/ 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
  1754
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1755
    preferredExtent notNil ifTrue:[
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1756
        ^ preferredExtent
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1757
    ].
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1758
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1759
    scrolledView notNil ifTrue:[ 
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1760
        slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1761
        prefX := slavesPref x.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1762
        prefY := slavesPref y.
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1763
        vScrollBar notNil ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1764
            prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1765
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1766
        hScrollBar notNil ifTrue:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1767
            prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing.
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1768
        ].
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1769
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1770
        ^ prefX @ prefY.
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1771
    ].
1104
88b80680773e about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1772
678
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1773
    ^ super preferredExtent.
c1967a46b2c1 added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
  1774
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1775
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1776
    "Modified: 6.3.1997 / 22:34:30 / cg"
1231
aba877015224 specClass
ca
parents: 1201
diff changeset
  1777
!
aba877015224 specClass
ca
parents: 1201
diff changeset
  1778
aba877015224 specClass
ca
parents: 1201
diff changeset
  1779
specClass
aba877015224 specClass
ca
parents: 1201
diff changeset
  1780
    ^ ScrollableViewSpec
aba877015224 specClass
ca
parents: 1201
diff changeset
  1781
aba877015224 specClass
ca
parents: 1201
diff changeset
  1782
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1783
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1784
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1785
!ScrollableView methodsFor:'slave-view messages'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1786
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1787
clear
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1788
    "convenient method: forward this to the scrolledView"
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1789
1073
1be1af284d3b care for nil scrolledView in #clear
ca
parents: 1024
diff changeset
  1790
    scrolledView notNil ifTrue:[scrolledView clear]
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1791
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1792
    "Created: 6.3.1997 / 18:06:24 / cg"
1138
b05fec461045 comments added;
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1793
    "Modified: 19.3.1997 / 16:34:19 / cg"
1024
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1794
!
a4ca85a880ca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1795
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1796
doesNotUnderstand:aMessage
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1797
    "this is funny: all message we do not understand, are passed
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1798
     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
  1799
     possible messages ...(thanks to the Message class)"
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1800
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1801
     scrolledView isNil ifFalse:[
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1802
         ^ scrolledView perform:(aMessage selector)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1803
                  withArguments:(aMessage arguments)
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1804
     ].
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1805
     ^ super doesNotUnderstand:aMessage
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1806
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1807
    "Created: 6.3.1997 / 18:06:24 / cg"
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1808
    "Modified: 6.3.1997 / 18:38:54 / cg"
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1809
!
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1810
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1811
leftButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1812
    "return scrolledViews leftbuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1813
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1814
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1815
    ^ scrolledView leftButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1816
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1817
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1818
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1819
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1820
leftButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1821
    "pass on leftbuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1822
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1823
    scrolledView leftButtonMenu:aMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1824
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1825
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1826
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1827
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1828
middleButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1829
    "return scrolledViews middlebuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1830
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1831
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1832
    ^ scrolledView middleButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1833
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1834
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1835
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1836
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1837
middleButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1838
    "pass on middlebuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1839
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1840
    scrolledView middleButtonMenu:aMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1841
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1842
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1843
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1844
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1845
model
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1846
    "return my scrolledViews model"
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1847
1085
25c315911e69 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
  1848
    scrolledView isNil ifTrue:[^ nil].
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1849
    ^ scrolledView model
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1850
1085
25c315911e69 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
  1851
    "Modified: 1.3.1997 / 01:38:07 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1852
    "Created: 6.3.1997 / 18:06:24 / cg"
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1853
!
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1854
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1855
model:aModel
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1856
    "forward model change to my scrolledViews"
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1857
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1858
    ^ scrolledView model:aModel
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1859
754
4db5b854cc88 comment
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1860
    "Modified: 5.6.1996 / 17:09:50 / cg"
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1861
    "Created: 6.3.1997 / 18:06:24 / cg"
562
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1862
!
1199debbda51 forward model access
Claus Gittinger <cg@exept.de>
parents: 546
diff changeset
  1863
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1864
rightButtonMenu
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1865
    "return scrolledViews rightbuttonmenu"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1866
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1867
    scrolledView isNil ifTrue:[^ nil].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1868
    ^ scrolledView rightButtonMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1869
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1870
    "Created: 6.3.1997 / 18:06:24 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1871
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1872
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1873
rightButtonMenu:aMenu
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1874
    "pass on rightbuttonmenu to scrolledView"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1875
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1876
    scrolledView rightButtonMenu:aMenu
1111
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1877
bdad313b2397 defined source container
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
  1878
    "Created: 6.3.1997 / 18:06:24 / cg"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1879
! !
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
  1880
852
3d828d54ebee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 819
diff changeset
  1881
!ScrollableView class methodsFor:'documentation'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1882
217
c208ce696327 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1883
version
1286
42740ebf473a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1884
    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.71 1997-07-28 10:32:51 cg Exp $'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
  1885
! !