LayoutFrame.st
author Claus Gittinger <cg@exept.de>
Thu, 23 Jan 2020 17:47:56 +0100
changeset 4431 732c2cd831b8
parent 4356 2e88f023b4ba
permissions -rw-r--r--
#OTHER by cg fix: if moving over an item within the same view, possibly suppress already forked and scheduled helptext (eg. when moving over close-icon in a tabList, moving within the same tab label, but away from the close icon, the tooltip was shown erronously in the previous version)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4286
add7d9220e53 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3925
diff changeset
     1
"{ Encoding: utf8 }"
add7d9220e53 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3925
diff changeset
     2
88
claus
parents: 83
diff changeset
     3
"
claus
parents: 83
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
     5
	      All Rights Reserved
88
claus
parents: 83
diff changeset
     6
claus
parents: 83
diff changeset
     7
 This software is furnished under a license and may be used
claus
parents: 83
diff changeset
     8
 only in accordance with the terms of that license and with the
claus
parents: 83
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
claus
parents: 83
diff changeset
    10
 be provided or otherwise made available to, or used by, any
claus
parents: 83
diff changeset
    11
 other person.  No title to or ownership of the software is
claus
parents: 83
diff changeset
    12
 hereby transferred.
claus
parents: 83
diff changeset
    13
"
1594
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    14
"{ Package: 'stx:libview2' }"
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    15
3793
c51420719bcf #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3414
diff changeset
    16
"{ NameSpace: Smalltalk }"
c51420719bcf #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3414
diff changeset
    17
77
claus
parents:
diff changeset
    18
LayoutOrigin subclass:#LayoutFrame
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    19
	instanceVariableNames:'rightFraction bottomFraction rightOffset bottomOffset'
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    20
	classVariableNames:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    21
	poolDictionaries:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    22
	category:'Graphics-Geometry'
77
claus
parents:
diff changeset
    23
!
claus
parents:
diff changeset
    24
88
claus
parents: 83
diff changeset
    25
!LayoutFrame class methodsFor:'documentation'!
claus
parents: 83
diff changeset
    26
claus
parents: 83
diff changeset
    27
copyright
claus
parents: 83
diff changeset
    28
"
claus
parents: 83
diff changeset
    29
 COPYRIGHT (c) 1995 by Claus Gittinger
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    30
	      All Rights Reserved
88
claus
parents: 83
diff changeset
    31
claus
parents: 83
diff changeset
    32
 This software is furnished under a license and may be used
claus
parents: 83
diff changeset
    33
 only in accordance with the terms of that license and with the
claus
parents: 83
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
claus
parents: 83
diff changeset
    35
 be provided or otherwise made available to, or used by, any
claus
parents: 83
diff changeset
    36
 other person.  No title to or ownership of the software is
claus
parents: 83
diff changeset
    37
 hereby transferred.
claus
parents: 83
diff changeset
    38
"
claus
parents: 83
diff changeset
    39
!
claus
parents: 83
diff changeset
    40
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    41
documentation
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    42
"
2763
519c58d279d9 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
    43
    This class is provided to make porting of existing ST-80/Squeak applications
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    44
    easier. Instances can be used to control the geometry of a subview, within
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    45
    its superview. Like a layoutOrigin, it controls the origin of a component
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    46
    by given fraction and offset dimensions; in addition, the bottom-right
4295
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
    47
    corner is also controlled by corresponding values. 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
    48
    Therefore, the component's preferredExtent is ignored.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    49
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    50
    Notice: 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    51
        this class was implemented using protocol information
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    52
        from alpha testers - it may not be complete or compatible to
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    53
        the corresponding ST-80 class. 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    54
        If you encounter any incompatibilities, please forward a note 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    55
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
219
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    56
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    57
    [author:]
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    58
        Claus Gittinger
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    59
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    60
    [see also:]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    61
        View
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    62
        LayoutOrigin AlignmentOrigin Layout 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    63
        Rectangle Point
94
8888ddd11323 *** empty log message ***
claus
parents: 93
diff changeset
    64
"
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    65
!
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    66
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    67
examples
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    68
"
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    69
    Although the examples below use a button as component,
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    70
    they work of course with any type of subview ....
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    71
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    72
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    73
    arrange for the button to be in 0.25 @ 0.25 -> 0.75 @ 0.75.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    74
    This is the same as with relative origin/corner.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    75
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    76
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    77
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    78
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    79
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    80
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    81
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    82
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    83
                                leftFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    84
                                topFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    85
                                rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    86
                                bottomFraction:0.75).
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    87
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    88
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    89
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    90
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    91
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    92
    like above, but adds additional offset to the origin:
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    93
    This is the same as with relative origin/corner
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    94
    and setting left & right insets.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    95
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    96
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    97
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    98
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    99
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   100
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   101
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   102
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   103
                                leftFraction:0.25; leftOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   104
                                topFraction:0.25;  topOffset:-20;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   105
                                rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   106
                                bottomFraction:0.75).
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   107
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   108
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   109
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   110
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   111
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   112
    like above, with offsets on all edges, 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   113
    actually simulating a constant inset on all four edges:
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   114
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   115
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   116
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   117
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   118
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   119
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   120
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   121
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   122
                                leftFraction:0.0; leftOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   123
                                topFraction:0.0;  topOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   124
                                rightFraction:1.0; rightOffset:-10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   125
                                bottomFraction:1.0; bottomOffset:-10).
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   126
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   127
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   128
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   129
"
88
claus
parents: 83
diff changeset
   130
! !
claus
parents: 83
diff changeset
   131
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   132
!LayoutFrame class methodsFor:'instance creation'!
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   133
3337
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   134
bottomFrame:pixels
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   135
    "create a new layoutFrame which makes the child take a fixed frame at the bottom"
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   136
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   137
    ^ self
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   138
        leftFraction:0 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   139
        rightFraction:1 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   140
        topFraction:1 offset:pixels negated 
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   141
        bottomFraction:1 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   142
!
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   143
2839
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   144
bottomInset:pixels
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   145
    "create a new layoutFrame which insets the child at the bottom by some pixels"
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   146
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   147
    ^ self
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   148
        leftFraction:0 offset:0
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   149
        rightFraction:1 offset:0
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   150
        topFraction:0 offset:0 
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   151
        bottomFraction:1 offset:pixels negated
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   152
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   153
    "Created: / 26-04-2010 / 15:07:50 / cg"
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   154
!
8fd092da727e added: #bottomInset:
Claus Gittinger <cg@exept.de>
parents: 2765
diff changeset
   155
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   156
fractions:fractionRectangle offsets:offsetRectangle
3414
ec59c0e59dfb class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   157
    "create a new layoutFrame given a rectangle of fractions and a rectangle of offsets"
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   158
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   159
    ^ self new
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   160
        fractions:fractionRectangle offsets:offsetRectangle
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   161
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   162
    "
3414
ec59c0e59dfb class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   163
     LayoutFrame 
ec59c0e59dfb class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   164
        fractions:(0 @ 0 corner:1.0 @ 1.0) 
ec59c0e59dfb class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3339
diff changeset
   165
        offsets:(0 @ 0 corner:0 @ 0)
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   166
    "
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   167
!
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   168
2221
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   169
inset:pixels
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   170
    "create a new layoutFrame which insets the child by some pixels"
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   171
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   172
    ^ self
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   173
        leftFraction:0 offset:pixels
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   174
        rightFraction:1 offset:pixels negated
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   175
        topFraction:0 offset:pixels 
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   176
        bottomFraction:1 offset:pixels negated 
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   177
!
52803ae96560 *** empty log message ***
fm
parents: 2123
diff changeset
   178
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   179
leftFraction:lF offset:lO rightFraction:rF offset:rO topFraction:tF offset:tO bottomFraction:bF offset:bO
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   180
    "create a new layoutFrame"
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   181
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   182
    ^ self new
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   183
        leftFraction:lF offset:lO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   184
        rightFraction:rF offset:rO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   185
        topFraction:tF offset:tO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   186
        bottomFraction:bF offset:bO
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   187
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   188
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   189
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   190
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   191
2765
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   192
leftFraction:lF rightFraction:rF topFraction:tF bottomFraction:bF
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   193
    "create a new layoutFrame"
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   194
4295
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   195
    ^ self new 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   196
        leftFraction:lF rightFraction:rF topFraction:tF bottomFraction:bF
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   197
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   198
    "Modified (format): / 17-07-2019 / 10:09:10 / Claus Gittinger"
2765
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   199
!
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   200
3338
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   201
leftFrame:pixels
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   202
    "create a new layoutFrame which makes the child take a fixed frame at the left"
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   203
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   204
    ^ self
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   205
        leftFraction:0 offset:0
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   206
        rightFraction:0 offset:pixels
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   207
        topFraction:0 offset:0 
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   208
        bottomFraction:1 offset:0
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   209
!
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   210
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   211
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   212
    "create a new layoutFrame"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   213
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   214
    ^ self new
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   215
        leftOffset:lO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   216
        rightOffset:rO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   217
        topOffset:tO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   218
        bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   219
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   220
    "Created: 18.4.1997 / 20:14:44 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   221
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   222
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   223
leftOffset:lO topOffset:tO rightOffset:rO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   224
    "create a new layoutFrame"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   225
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   226
    ^ self leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   227
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   228
    "Modified: 18.4.1997 / 20:15:23 / cg"
1795
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   229
!
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   230
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   231
origin:origin corner:corner
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   232
    "create a new layoutFrame from an oldStyle origin-corner rectangle.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   233
     Added to make migration from Rectangles to LayoutFrames easier."
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   234
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   235
    |leftFraction leftOffset rightFraction rightOffset
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   236
     topFraction topOffset bottomFraction bottomOffset
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   237
     orgX orgY cornerX cornerY|
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   238
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   239
    orgX := origin x.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   240
    orgY := origin y.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   241
    cornerX := corner x.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   242
    cornerY := corner y.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   243
    leftFraction := leftOffset := 0.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   244
    orgX isInteger ifTrue:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   245
        leftOffset := orgX
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   246
    ] ifFalse:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   247
        leftFraction := orgX.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   248
    ].
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   249
    orgY isInteger ifTrue:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   250
        topOffset := orgY
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   251
    ] ifFalse:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   252
        topFraction := orgY.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   253
    ].
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   254
    cornerX isInteger ifTrue:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   255
        rightOffset := cornerX
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   256
    ] ifFalse:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   257
        rightFraction := cornerX.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   258
    ].
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   259
    cornerY isInteger ifTrue:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   260
        bottomOffset := cornerY
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   261
    ] ifFalse:[
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   262
        bottomFraction := cornerY.
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   263
    ].
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   264
    ^ self
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   265
        leftFraction:leftFraction offset:leftOffset
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   266
        rightFraction:rightFraction offset:rightOffset
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   267
        topFraction:topFraction offset:rightOffset 
19dee5013803 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1601
diff changeset
   268
        bottomFraction:bottomFraction offset:bottomOffset 
3337
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   269
!
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   270
3338
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   271
rightFrame:pixels
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   272
    "create a new layoutFrame which makes the child take a fixed frame at the right"
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   273
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   274
    ^ self
3339
a2562a53f6ef class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
   275
        leftFraction:1 offset:pixels negated
a2562a53f6ef class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
   276
        rightFraction:1 offset:0
3338
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   277
        topFraction:0 offset:0 
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   278
        bottomFraction:1 offset:0
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   279
!
3205b8371f79 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   280
3337
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   281
topFrame:pixels
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   282
    "create a new layoutFrame which makes the child take a fixed frame at the top"
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   283
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   284
    ^ self
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   285
        leftFraction:0 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   286
        rightFraction:1 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   287
        topFraction:0 offset:0 
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   288
        bottomFraction:0 offset:pixels
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   289
!
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   290
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   291
topInset:pixels
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   292
    "create a new layoutFrame which insets the child at the top by some pixels"
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   293
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   294
    ^ self
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   295
        leftFraction:0 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   296
        rightFraction:1 offset:0
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   297
        topFraction:0 offset:pixels 
d0becaeb96b9 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3329
diff changeset
   298
        bottomFraction:1 offset:0
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   299
! !
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   300
77
claus
parents:
diff changeset
   301
!LayoutFrame methodsFor:'accessing'!
claus
parents:
diff changeset
   302
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   303
bottomFraction
2123
5247deafa7ef comments
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   304
    "Return the y-coordinate of the bottom of the relative rectangle as a percentage of the height of the reference rectangle."
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   305
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   306
    ^ bottomFraction
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   307
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   308
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   309
bottomFraction:aFraction
2123
5247deafa7ef comments
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   310
    "Set the y-coordinate of the bottom of the relative rectangle to be a fraction of the height of the reference rectangle."
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   311
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   312
    bottomFraction := aFraction.
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   313
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   314
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   315
bottomFraction:aFraction offset:o
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   316
    "set both bottomFraction (0..1) and offset"
77
claus
parents:
diff changeset
   317
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   318
    bottomFraction := aFraction.
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   319
    bottomOffset := o
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   320
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   321
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   322
bottomInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   323
    "set bottomOffset for an inset at the bottom"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   324
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   325
    bottomOffset := pixels negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   326
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   327
    "Created: 26.5.1996 / 17:38:30 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   328
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   329
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   330
bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   331
    "return bottomOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   332
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   333
    ^ bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   334
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   335
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   336
bottomOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   337
    "set bottomOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   338
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   339
    bottomOffset := something.
77
claus
parents:
diff changeset
   340
!
claus
parents:
diff changeset
   341
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   342
fractions:fractionRectangle offsets:offsetRectangle
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   343
    "LayoutFrame fractions:(0 @ 0 corner:1.0 @ 1.0) offsets:(0 @ 0 corner:0 @ 0)"
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   344
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   345
    self
2765
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   346
        leftFraction:(fractionRectangle left) offset:(offsetRectangle left)
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   347
        rightFraction:(fractionRectangle right) offset:(offsetRectangle right)
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   348
        topFraction:(fractionRectangle top) offset:(offsetRectangle top)
827160ff9feb added: #leftFraction:rightFraction:topFraction:bottomFraction:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
   349
        bottomFraction:(fractionRectangle bottom) offset:(offsetRectangle bottom)
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   350
!
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   351
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   352
horizontalInset:aNumber
2123
5247deafa7ef comments
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   353
    "setup the offsets for insetting horizontally the frame aNumber pixels at all sides"
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   354
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   355
    leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   356
    rightOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   357
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   358
    "Created: 26.5.1996 / 17:39:35 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   359
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   360
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   361
inset:aNumber
2123
5247deafa7ef comments
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   362
    "setup the offsets for insetting the frame aNumber pixels at all sides"
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   363
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   364
    topOffset := leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   365
    rightOffset := bottomOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   366
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   367
    "Created: 26.5.1996 / 17:36:49 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   368
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   369
425
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   370
leftFraction:lF offset:lO rightFraction:rF offset:rO topFraction:tF offset:tO bottomFraction:bF offset:bO
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   371
    "set all fields"
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   372
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   373
    leftFraction := lF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   374
    rightFraction := rF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   375
    topFraction := tF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   376
    bottomFraction := bF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   377
    leftOffset := lO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   378
    rightOffset := rO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   379
    topOffset := tO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   380
    bottomOffset := bO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   381
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   382
!
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   383
4295
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   384
leftFraction:lF rightFraction:rF
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   385
    leftFraction := lF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   386
    rightFraction := rF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   387
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   388
    "Created: / 17-07-2019 / 10:05:53 / Claus Gittinger"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   389
!
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   390
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   391
leftFraction:lF rightFraction:rF topFraction:tF bottomFraction:bF
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   392
    leftFraction := lF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   393
    rightFraction := rF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   394
    topFraction := tF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   395
    bottomFraction := bF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   396
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   397
    "Created: / 17-07-2019 / 10:07:46 / Claus Gittinger"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   398
!
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   399
1597
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   400
leftOffset:lO rightOffset:rO
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   401
    "set the horizontal offset fields"
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   402
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   403
    leftOffset := lO.
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   404
    rightOffset := rO.
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   405
!
7f14cbd5b7ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   406
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   407
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   408
    "set all offset fields"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   409
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   410
    leftOffset := lO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   411
    rightOffset := rO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   412
    topOffset := tO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   413
    bottomOffset := bO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   414
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   415
    "Created: 18.4.1997 / 20:16:08 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   416
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   417
77
claus
parents:
diff changeset
   418
rightFraction
claus
parents:
diff changeset
   419
    "return rightFraction"
claus
parents:
diff changeset
   420
claus
parents:
diff changeset
   421
    ^ rightFraction
claus
parents:
diff changeset
   422
!
claus
parents:
diff changeset
   423
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   424
rightFraction:aFraction
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   425
    "set rightFraction (0..1)"
77
claus
parents:
diff changeset
   426
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   427
    rightFraction := aFraction.
77
claus
parents:
diff changeset
   428
!
claus
parents:
diff changeset
   429
4305
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   430
rightFraction:rF bottomFraction:bF
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   431
    rightFraction := rF.
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   432
    bottomFraction := bF.
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   433
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   434
    "Created: / 17-07-2019 / 10:26:24 / Claus Gittinger"
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   435
!
8a53ddd46ce8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4295
diff changeset
   436
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   437
rightFraction:aFraction offset:o
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   438
    "set rightFraction (0..1) and offset"
77
claus
parents:
diff changeset
   439
4356
2e88f023b4ba #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   440
    rightFraction := aFraction.
77
claus
parents:
diff changeset
   441
    rightOffset := o
claus
parents:
diff changeset
   442
!
claus
parents:
diff changeset
   443
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   444
rightInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   445
    "set rightOffset for an inset at the right"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   446
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   447
    rightOffset := pixels negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   448
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   449
    "Created: 26.5.1996 / 17:38:38 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   450
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   451
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   452
rightOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   453
    "return rightOffset"
77
claus
parents:
diff changeset
   454
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   455
    ^ rightOffset
77
claus
parents:
diff changeset
   456
!
claus
parents:
diff changeset
   457
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   458
rightOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   459
    "set rightOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   460
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   461
    rightOffset := something.
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   462
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   463
4295
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   464
topFraction:tF bottomFraction:bF
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   465
    topFraction := tF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   466
    bottomFraction := bF.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   467
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   468
    "Created: / 17-07-2019 / 10:07:15 / Claus Gittinger"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   469
!
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   470
1594
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
   471
topOffset:newTopOffset bottomOffset:newBottomOffset
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
   472
    topOffset := newTopOffset.
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
   473
    bottomOffset := newBottomOffset.
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
   474
!
1b87b322f268 accessor added
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
   475
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   476
verticalInset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   477
    "setup the offsets for insetting vertically the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   478
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   479
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   480
    topOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   481
    bottomOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   482
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   483
    "Created: 26.5.1996 / 17:39:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   484
! !
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   485
3329
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   486
!LayoutFrame methodsFor:'comparing'!
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   487
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   488
= anObject
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   489
    ^ super = anObject
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   490
        and:[ anObject rightFraction = rightFraction
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   491
        and:[ anObject bottomFraction = bottomFraction
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   492
        and:[ anObject rightOffset = rightOffset
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   493
        and:[ anObject bottomOffset = bottomOffset ]]]]
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   494
!
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   495
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   496
hash
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   497
    ^ super hash
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   498
      + rightFraction hash + bottomFraction hash + rightOffset hash + bottomOffset hash
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   499
! !
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   500
4295
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   501
!LayoutFrame methodsFor:'computing'!
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   502
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   503
rectangleRelativeTo:superRectangle preferred:prefRectHolder
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   504
    "compute the rectangle represented by the receiver,
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   505
     given the superView's rectangle and the view's preferredExtent."
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   506
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   507
    |x1 y1 x2 y2 superWidth superHeight|
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   508
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   509
    x1 := x2 := superRectangle left.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   510
    y1 := y2 := superRectangle top.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   511
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   512
    leftOffset notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   513
        x1 := x1 + leftOffset value
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   514
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   515
    topOffset notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   516
        y1 := y1 + topOffset value
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   517
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   518
    rightOffset notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   519
        x2 := x2 + rightOffset value
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   520
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   521
    bottomOffset notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   522
        y2 := y2 + bottomOffset value
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   523
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   524
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   525
    leftFraction notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   526
        superWidth := superRectangle width.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   527
        x1 := x1 + (superWidth * leftFraction value) 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   528
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   529
    topFraction notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   530
        superHeight := superRectangle height.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   531
        y1 := y1 + (superHeight * topFraction value) 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   532
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   533
    rightFraction notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   534
        superWidth isNil ifTrue:[superWidth := superRectangle width].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   535
        x2 := x2 + (superWidth * rightFraction value) 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   536
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   537
    bottomFraction notNil ifTrue:[
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   538
        superHeight isNil ifTrue:[superHeight := superRectangle height].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   539
        y2 := y2 + (superHeight * bottomFraction value) 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   540
    ].
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   541
    ^ Rectangle left:x1 top:y1 right:x2 bottom:y2
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   542
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   543
    "
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   544
     |superRect lF|
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   545
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   546
     superRect := 0@0 corner:99@99.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   547
     lF := (LayoutFrame new).
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   548
     lF leftFraction:0.25;
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   549
        topFraction:0.25;
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   550
        rightFraction:0.75;
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   551
        bottomFraction:0.75.
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   552
     lF rectangleRelativeTo:superRect preferred:(0@0 corner:30@30) 
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   553
    "
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   554
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   555
    "Created: / 06-03-1997 / 21:07:51 / cg"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   556
    "Modified: / 13-08-1998 / 18:33:59 / cg"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   557
    "Modified (comment): / 17-07-2019 / 10:03:07 / Claus Gittinger"
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   558
! !
a3333891d7f3 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4286
diff changeset
   559
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   560
!LayoutFrame methodsFor:'converting'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   561
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   562
fromLiteralArrayEncoding:encoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   563
    "read my values from an encoding.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   564
     The encoding is supposed to be of the form: 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   565
	(LayoutFrame orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   566
     This is the reverse to literalArrayEncoding."
77
claus
parents:
diff changeset
   567
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   568
    leftOffset := encoding at:2.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   569
    leftFraction := encoding at:3.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   570
    topOffset := encoding at:4.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   571
    topFraction := encoding at:5.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   572
    rightOffset := encoding at:6.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   573
    rightFraction := encoding at:7.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   574
    bottomOffset := encoding at:8.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   575
    bottomFraction := encoding at:9.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   576
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   577
    "
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   578
      LayoutFrame new fromLiteralArrayEncoding:#(#LayoutFrame 70 0 2 0 0 1 25 0 )
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   579
      #(#LayoutFrame 70 0 2 0 0 1 25 0 ) decodeAsLiteralArray 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   580
    "
77
claus
parents:
diff changeset
   581
!
claus
parents:
diff changeset
   582
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   583
literalArrayEncoding
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   584
    "encode myself as an array, from which a copy of the receiver
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   585
     can be reconstructed with #decodeAsLiteralArray.
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   586
     The encoding is: 
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   587
        (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)"
77
claus
parents:
diff changeset
   588
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   589
    ^ super literalArrayEncoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   590
      , (Array
2618
fb52a0f3e1e8 Fix preferred and dynamic preferred sizes
Stefan Vogel <sv@exept.de>
parents: 2221
diff changeset
   591
            with:rightOffset value          "take care of blocks (dynamic preferred extent)"
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   592
            with:rightFraction
2618
fb52a0f3e1e8 Fix preferred and dynamic preferred sizes
Stefan Vogel <sv@exept.de>
parents: 2221
diff changeset
   593
            with:bottomOffset value
fb52a0f3e1e8 Fix preferred and dynamic preferred sizes
Stefan Vogel <sv@exept.de>
parents: 2221
diff changeset
   594
            with:bottomFraction)            "take care of blocks (dynamic preferred extent)"
77
claus
parents:
diff changeset
   595
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   596
    "Modified: 1.9.1995 / 02:43:35 / claus"
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   597
    "Modified: 22.4.1996 / 13:00:17 / cg"
77
claus
parents:
diff changeset
   598
! !
claus
parents:
diff changeset
   599
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   600
!LayoutFrame methodsFor:'initialization'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   601
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   602
initialize
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   603
    leftOffset := rightOffset := bottomOffset := topOffset := 0.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   604
    leftFraction := topFraction := 0.
468
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   605
    "/ bottomFraction := rightFraction := 1.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   606
    bottomFraction := rightFraction := 0.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   607
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   608
    "Modified: 1.3.1997 / 16:12:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   609
! !
77
claus
parents:
diff changeset
   610
83
claus
parents: 77
diff changeset
   611
!LayoutFrame methodsFor:'printing & storing'!
claus
parents: 77
diff changeset
   612
3018
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   613
displayOn:aGCOrStream
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   614
    "return a printed representation of the receiver for displaying"
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   615
3018
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   616
    "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
3925
b761235ce4d5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
   617
    "/ old ST80 means: draw-yourself on a GC.
3018
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   618
    (aGCOrStream isStream) ifFalse:[
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   619
        ^ super displayOn:aGCOrStream
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   620
    ].
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   621
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   622
    aGCOrStream 
4286
add7d9220e53 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3925
diff changeset
   623
        nextPutAll:self className;
3018
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   624
        nextPutAll:'(l: '.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   625
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   626
    leftFraction displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   627
    aGCOrStream nextPut:$+. 
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   628
    leftOffset displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   629
    aGCOrStream nextPutAll:' t: '.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   630
    topFraction displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   631
    aGCOrStream nextPut:$+. 
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   632
    topOffset displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   633
    aGCOrStream nextPutAll:' r: '.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   634
    rightFraction displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   635
    aGCOrStream nextPut:$+. 
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   636
    rightOffset displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   637
    aGCOrStream nextPutAll:' b: '.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   638
    bottomFraction displayOn:aGCOrStream.
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   639
    aGCOrStream nextPut:$+. 
e7f336370c9f Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 2839
diff changeset
   640
    bottomOffset displayOn:aGCOrStream.
3925
b761235ce4d5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
   641
    aGCOrStream nextPut:$).
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   642
3925
b761235ce4d5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
   643
    "Modified: / 20-09-1997 / 11:40:14 / cg"
b761235ce4d5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
   644
    "Modified (comment): / 22-02-2017 / 16:52:10 / cg"
4286
add7d9220e53 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3925
diff changeset
   645
    "Modified: / 28-06-2019 / 09:03:55 / Claus Gittinger"
83
claus
parents: 77
diff changeset
   646
! !
claus
parents: 77
diff changeset
   647
77
claus
parents:
diff changeset
   648
!LayoutFrame methodsFor:'queries'!
claus
parents:
diff changeset
   649
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   650
corner
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   651
    ^ rightFraction asFloat @ bottomFraction asFloat
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   652
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   653
416
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   654
isLayoutFrame
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   655
    "return true, if this is a layoutFrame"
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   656
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   657
    ^ true
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   658
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   659
77
claus
parents:
diff changeset
   660
! !
100
claus
parents: 96
diff changeset
   661
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   662
!LayoutFrame class methodsFor:'documentation'!
100
claus
parents: 96
diff changeset
   663
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   664
version
3793
c51420719bcf #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3414
diff changeset
   665
    ^ '$Header$'
2762
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   666
!
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   667
80249bee736b added: #fractions:offsets: for squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 2618
diff changeset
   668
version_CVS
3793
c51420719bcf #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3414
diff changeset
   669
    ^ '$Header$'
100
claus
parents: 96
diff changeset
   670
! !
3329
d885d47a0693 class: LayoutFrame
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   671