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