LayoutFrame.st
author Claus Gittinger <cg@exept.de>
Sat, 08 Aug 1998 13:42:06 +0200
changeset 1035 308004d24f3d
parent 949 0eb888b21192
child 1039 4095e7721dad
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
88
claus
parents: 83
diff changeset
     1
"
claus
parents: 83
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
     3
	      All Rights Reserved
88
claus
parents: 83
diff changeset
     4
claus
parents: 83
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 83
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 83
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 83
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 83
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 83
diff changeset
    10
 hereby transferred.
claus
parents: 83
diff changeset
    11
"
claus
parents: 83
diff changeset
    12
77
claus
parents:
diff changeset
    13
LayoutOrigin subclass:#LayoutFrame
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    14
	instanceVariableNames:'rightFraction bottomFraction rightOffset bottomOffset'
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    15
	classVariableNames:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    16
	poolDictionaries:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    17
	category:'Graphics-Geometry'
77
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
88
claus
parents: 83
diff changeset
    20
!LayoutFrame class methodsFor:'documentation'!
claus
parents: 83
diff changeset
    21
claus
parents: 83
diff changeset
    22
copyright
claus
parents: 83
diff changeset
    23
"
claus
parents: 83
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    25
	      All Rights Reserved
88
claus
parents: 83
diff changeset
    26
claus
parents: 83
diff changeset
    27
 This software is furnished under a license and may be used
claus
parents: 83
diff changeset
    28
 only in accordance with the terms of that license and with the
claus
parents: 83
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
claus
parents: 83
diff changeset
    30
 be provided or otherwise made available to, or used by, any
claus
parents: 83
diff changeset
    31
 other person.  No title to or ownership of the software is
claus
parents: 83
diff changeset
    32
 hereby transferred.
claus
parents: 83
diff changeset
    33
"
claus
parents: 83
diff changeset
    34
!
claus
parents: 83
diff changeset
    35
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    36
documentation
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    37
"
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    38
    This class is provided to make porting of existing ST-80 applications
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    39
    easier. Instances can be used to control the geometry of a subview, within
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    40
    its superview. Like a layoutOrigin, it controls the origin of a component
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    41
    by given fraction and offset dimensions; in addition, the bottom-right
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    42
    corner is also controlled by corresponding values. Therefore, the components
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    43
    preferredExtent is ignored.
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    44
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    45
    See also:
219
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    46
        LayoutOrigin AlignmentOrigin Layout
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    47
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    48
    Notice: 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    49
        this class was implemented using protocol information
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    50
        from alpha testers - it may not be complete or compatible to
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    51
        the corresponding ST-80 class. 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    52
        If you encounter any incompatibilities, please forward a note 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    53
        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
    54
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    55
    [author:]
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    56
        Claus Gittinger
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    57
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    58
    [see also:]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    59
        View
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    60
        LayoutOrigin AlignmentOrigin Layout 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    61
        Rectangle Point
94
8888ddd11323 *** empty log message ***
claus
parents: 93
diff changeset
    62
"
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    63
!
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    64
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    65
examples
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    66
"
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    67
    Although the examples below use a button as component,
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    68
    they work of course with any type of subview ....
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    69
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    70
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    71
    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
    72
    This is the same as with relative origin/corner.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    73
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    74
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    75
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    76
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    77
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    78
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    79
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    80
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    81
                                leftFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    82
                                topFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    83
                                rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    84
                                bottomFraction:0.75).
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    85
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    86
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    87
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    88
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    89
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    90
    like above, but adds additional offset to the origin:
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    91
    This is the same as with relative origin/corner
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    92
    and setting left & right insets.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    93
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    94
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    95
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    96
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    97
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    98
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    99
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   100
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   101
                                leftFraction:0.25; leftOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   102
                                topFraction:0.25;  topOffset:-20;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   103
                                rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   104
                                bottomFraction:0.75).
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   105
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   106
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   107
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   108
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   109
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   110
    like above, with offsets on all edges, 
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   111
    actually simulating a constant inset on all four edges:
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   112
                                                                        [exBegin]
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   113
        |top button|
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   114
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   115
        top := StandardSystemView new.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   116
        top extent:300@300.
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   117
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   118
        button := Button label:'component'.
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   119
        top add:button in:(LayoutFrame new
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   120
                                leftFraction:0.0; leftOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   121
                                topFraction:0.0;  topOffset:10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   122
                                rightFraction:1.0; rightOffset:-10;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   123
                                bottomFraction:1.0; bottomOffset:-10).
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   124
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   125
        top open
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   126
                                                                        [exEnd]
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
   127
"
88
claus
parents: 83
diff changeset
   128
! !
claus
parents: 83
diff changeset
   129
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   130
!LayoutFrame class methodsFor:'instance creation'!
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   131
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   132
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
   133
    "create a new layoutFrame"
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   134
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   135
    ^ self new
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   136
        leftFraction:lF offset:lO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   137
        rightFraction:rF offset:rO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   138
        topFraction:tF offset:tO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   139
        bottomFraction:bF offset:bO
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   140
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   141
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   142
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   143
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   144
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   145
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   146
    "create a new layoutFrame"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   147
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   148
    ^ self new
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   149
        leftOffset:lO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   150
        rightOffset:rO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   151
        topOffset:tO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   152
        bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   153
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   154
    "Created: 18.4.1997 / 20:14:44 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   155
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   156
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   157
leftOffset:lO topOffset:tO rightOffset:rO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   158
    "create a new layoutFrame"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   159
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   160
    ^ self leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   161
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   162
    "Modified: 18.4.1997 / 20:15:23 / cg"
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   163
! !
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   164
77
claus
parents:
diff changeset
   165
!LayoutFrame methodsFor:'accessing'!
claus
parents:
diff changeset
   166
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   167
bottomFraction
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   168
    "return bottomFraction"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   169
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   170
    ^ bottomFraction
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   171
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   172
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   173
bottomFraction:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   174
    "set bottomFraction"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
    bottomFraction := something.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   177
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
bottomFraction:something offset:o
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
    "set bottomFraction and offset"
77
claus
parents:
diff changeset
   181
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
    bottomFraction := something.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   183
    bottomOffset := o
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   186
bottomInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   187
    "set bottomOffset for an inset at the bottom"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   188
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   189
    bottomOffset := pixels negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   190
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   191
    "Created: 26.5.1996 / 17:38:30 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   192
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   193
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   194
bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   195
    "return bottomOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   196
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   197
    ^ bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   198
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   199
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   200
bottomOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   201
    "set bottomOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   202
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   203
    bottomOffset := something.
77
claus
parents:
diff changeset
   204
!
claus
parents:
diff changeset
   205
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   206
horizontalInset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   207
    "setup the offsets for insetting horizontally the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   208
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   209
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   210
    leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   211
    rightOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   212
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   213
    "Created: 26.5.1996 / 17:39:35 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   214
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   215
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   216
inset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   217
    "setup the offsets for insetting the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   218
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   219
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   220
    topOffset := leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   221
    rightOffset := bottomOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   222
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   223
    "Created: 26.5.1996 / 17:36:49 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   224
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   225
425
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   226
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
   227
    "set all fields"
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   228
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   229
    leftFraction := lF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   230
    rightFraction := rF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   231
    topFraction := tF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   232
    bottomFraction := bF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   233
    leftOffset := lO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   234
    rightOffset := rO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   235
    topOffset := tO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   236
    bottomOffset := bO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   237
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   238
!
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   239
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   240
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   241
    "set all offset fields"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   242
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   243
    leftOffset := lO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   244
    rightOffset := rO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   245
    topOffset := tO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   246
    bottomOffset := bO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   247
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   248
    "Created: 18.4.1997 / 20:16:08 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   249
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   250
77
claus
parents:
diff changeset
   251
rightFraction
claus
parents:
diff changeset
   252
    "return rightFraction"
claus
parents:
diff changeset
   253
claus
parents:
diff changeset
   254
    ^ rightFraction
claus
parents:
diff changeset
   255
!
claus
parents:
diff changeset
   256
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   257
rightFraction:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   258
    "set rightFraction"
77
claus
parents:
diff changeset
   259
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   260
    rightFraction := something.
77
claus
parents:
diff changeset
   261
!
claus
parents:
diff changeset
   262
claus
parents:
diff changeset
   263
rightFraction:something offset:o
claus
parents:
diff changeset
   264
    "set rightFraction and offset"
claus
parents:
diff changeset
   265
claus
parents:
diff changeset
   266
    rightFraction := something.
claus
parents:
diff changeset
   267
    rightOffset := o
claus
parents:
diff changeset
   268
!
claus
parents:
diff changeset
   269
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   270
rightInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   271
    "set rightOffset for an inset at the right"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   272
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   273
    rightOffset := pixels negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   274
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   275
    "Created: 26.5.1996 / 17:38:38 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   276
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   277
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   278
rightOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   279
    "return rightOffset"
77
claus
parents:
diff changeset
   280
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   281
    ^ rightOffset
77
claus
parents:
diff changeset
   282
!
claus
parents:
diff changeset
   283
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   284
rightOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   285
    "set rightOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   286
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   287
    rightOffset := something.
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   288
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   289
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   290
verticalInset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   291
    "setup the offsets for insetting vertically the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   292
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   293
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   294
    topOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   295
    bottomOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   296
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   297
    "Created: 26.5.1996 / 17:39:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   298
! !
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   299
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   300
!LayoutFrame methodsFor:'converting'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   301
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   302
fromLiteralArrayEncoding:encoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   303
    "read my values from an encoding.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   304
     The encoding is supposed to be of the form: 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   305
	(LayoutFrame orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   306
     This is the reverse to literalArrayEncoding."
77
claus
parents:
diff changeset
   307
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   308
    leftOffset := encoding at:2.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   309
    leftFraction := encoding at:3.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   310
    topOffset := encoding at:4.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   311
    topFraction := encoding at:5.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   312
    rightOffset := encoding at:6.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   313
    rightFraction := encoding at:7.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   314
    bottomOffset := encoding at:8.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   315
    bottomFraction := encoding at:9.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   316
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   317
    "
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   318
      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
   319
      #(#LayoutFrame 70 0 2 0 0 1 25 0 ) decodeAsLiteralArray 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   320
    "
77
claus
parents:
diff changeset
   321
!
claus
parents:
diff changeset
   322
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   323
literalArrayEncoding
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   324
    "encode myself as an array, from which a copy of the receiver
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   325
     can be reconstructed with #decodeAsLiteralArray.
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   326
     The encoding is: 
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   327
        (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)"
77
claus
parents:
diff changeset
   328
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   329
    ^ super literalArrayEncoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   330
      , (Array
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   331
            with:rightOffset
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   332
            with:rightFraction
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   333
            with:bottomOffset
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   334
            with:bottomFraction)
77
claus
parents:
diff changeset
   335
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   336
    "Modified: 1.9.1995 / 02:43:35 / claus"
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   337
    "Modified: 22.4.1996 / 13:00:17 / cg"
77
claus
parents:
diff changeset
   338
! !
claus
parents:
diff changeset
   339
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   340
!LayoutFrame methodsFor:'initialization'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   341
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   342
initialize
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   343
    leftOffset := rightOffset := bottomOffset := topOffset := 0.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   344
    leftFraction := topFraction := 0.
468
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   345
    "/ bottomFraction := rightFraction := 1.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   346
    bottomFraction := rightFraction := 0.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   347
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   348
    "Modified: 1.3.1997 / 16:12:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   349
! !
77
claus
parents:
diff changeset
   350
83
claus
parents: 77
diff changeset
   351
!LayoutFrame methodsFor:'printing & storing'!
claus
parents: 77
diff changeset
   352
claus
parents: 77
diff changeset
   353
displayString
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   354
    "return a printed representation of the receiver for displaying"
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   355
83
claus
parents: 77
diff changeset
   356
    ^ (self class name) , '(' 
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   357
        , 'l: ' , leftFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   358
        , '+' , leftOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   359
        , ' t: ' , topFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   360
        , '+' , topOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   361
        , ' r: ' , rightFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   362
        , '+' , rightOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   363
        , ' b: ' , bottomFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   364
        , '+' , bottomOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   365
        , ')'
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   366
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   367
    "Modified: 20.9.1997 / 11:40:14 / cg"
83
claus
parents: 77
diff changeset
   368
! !
claus
parents: 77
diff changeset
   369
77
claus
parents:
diff changeset
   370
!LayoutFrame methodsFor:'queries'!
claus
parents:
diff changeset
   371
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   372
corner
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   373
    ^ rightFraction asFloat @ bottomFraction asFloat
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   374
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   375
416
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   376
isLayoutFrame
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   377
    "return true, if this is a layoutFrame"
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   378
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   379
    ^ true
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   380
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   381
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   382
!
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   383
949
0eb888b21192 prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   384
rectangleRelativeTo:superRectangle preferred:prefRectHolder
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   385
    "compute the rectangle represented by the receiver,
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   386
     given the superViews rectangle and the views preferredExtent."
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   387
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   388
    |x1 y1 x2 y2 superWidth superHeight|
77
claus
parents:
diff changeset
   389
claus
parents:
diff changeset
   390
    leftOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   391
        x1 := 0
77
claus
parents:
diff changeset
   392
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   393
        x1 := leftOffset value
77
claus
parents:
diff changeset
   394
    ].
claus
parents:
diff changeset
   395
    topOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   396
        y1 := 0
77
claus
parents:
diff changeset
   397
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   398
        y1 := topOffset value
77
claus
parents:
diff changeset
   399
    ].
claus
parents:
diff changeset
   400
    rightOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   401
        x2 := 0
77
claus
parents:
diff changeset
   402
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   403
        x2 := rightOffset value
77
claus
parents:
diff changeset
   404
    ].
claus
parents:
diff changeset
   405
    bottomOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   406
        y2 := 0
77
claus
parents:
diff changeset
   407
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   408
        y2 := bottomOffset value
77
claus
parents:
diff changeset
   409
    ].
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   410
77
claus
parents:
diff changeset
   411
    leftFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   412
        superWidth := superRectangle width.
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   413
        x1 := x1 + (superWidth * leftFraction value)
77
claus
parents:
diff changeset
   414
    ].
claus
parents:
diff changeset
   415
    topFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   416
        superHeight := superRectangle height.
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   417
        y1 := y1 + (superHeight * topFraction value)
77
claus
parents:
diff changeset
   418
    ].
claus
parents:
diff changeset
   419
    rightFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   420
        superWidth isNil ifTrue:[superWidth := superRectangle width].
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   421
        x2 := x2 + (superWidth * rightFraction value)
77
claus
parents:
diff changeset
   422
    ].
claus
parents:
diff changeset
   423
    bottomFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   424
        superHeight isNil ifTrue:[superHeight := superRectangle height].
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   425
        y2 := y2 + (superHeight * bottomFraction value)
77
claus
parents:
diff changeset
   426
    ].
242
5b7f59450c65 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   427
    ^ Rectangle left:x1 top:y1 right:x2 bottom:y2
83
claus
parents: 77
diff changeset
   428
claus
parents: 77
diff changeset
   429
    "
claus
parents: 77
diff changeset
   430
     |superRect lF|
claus
parents: 77
diff changeset
   431
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   432
     superRect := 0@0 corner:99@99.
83
claus
parents: 77
diff changeset
   433
     lF := (LayoutFrame new).
claus
parents: 77
diff changeset
   434
     lF leftFraction:0.25;
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   435
        topFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   436
        rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   437
        bottomFraction:0.75.
83
claus
parents: 77
diff changeset
   438
     lF rectangleRelativeTo:superRect preferred:(0@0 corner:30@30) 
claus
parents: 77
diff changeset
   439
    "
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   440
949
0eb888b21192 prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   441
    "Created: / 6.3.1997 / 21:07:51 / cg"
0eb888b21192 prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   442
    "Modified: / 27.5.1998 / 10:19:18 / cg"
77
claus
parents:
diff changeset
   443
! !
100
claus
parents: 96
diff changeset
   444
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   445
!LayoutFrame class methodsFor:'documentation'!
100
claus
parents: 96
diff changeset
   446
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   447
version
949
0eb888b21192 prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   448
    ^ '$Header: /cvs/stx/stx/libview2/LayoutFrame.st,v 1.24 1998-05-27 09:21:30 cg Exp $'
100
claus
parents: 96
diff changeset
   449
! !