LayoutFrm.st
author tz
Sat, 07 Feb 1998 16:57:39 +0100
changeset 834 ac1655bd31bb
parent 700 67f1dccb8333
child 949 0eb888b21192
permissions -rw-r--r--
class category changed
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
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
    13
'From Smalltalk/X, Version:3.1.10 on 20-sep-1997 at 12:00:17 am'                !
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
    14
77
claus
parents:
diff changeset
    15
LayoutOrigin subclass:#LayoutFrame
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    16
	instanceVariableNames:'rightFraction bottomFraction rightOffset bottomOffset'
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    17
	classVariableNames:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    18
	poolDictionaries:''
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    19
	category:'Graphics-Geometry'
77
claus
parents:
diff changeset
    20
!
claus
parents:
diff changeset
    21
88
claus
parents: 83
diff changeset
    22
!LayoutFrame class methodsFor:'documentation'!
claus
parents: 83
diff changeset
    23
claus
parents: 83
diff changeset
    24
copyright
claus
parents: 83
diff changeset
    25
"
claus
parents: 83
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    27
	      All Rights Reserved
88
claus
parents: 83
diff changeset
    28
claus
parents: 83
diff changeset
    29
 This software is furnished under a license and may be used
claus
parents: 83
diff changeset
    30
 only in accordance with the terms of that license and with the
claus
parents: 83
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
claus
parents: 83
diff changeset
    32
 be provided or otherwise made available to, or used by, any
claus
parents: 83
diff changeset
    33
 other person.  No title to or ownership of the software is
claus
parents: 83
diff changeset
    34
 hereby transferred.
claus
parents: 83
diff changeset
    35
"
claus
parents: 83
diff changeset
    36
!
claus
parents: 83
diff changeset
    37
93
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    38
documentation
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    39
"
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    40
    This class is provided to make porting of existing ST-80 applications
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    41
    easier. Instances can be used to control the geometry of a subview, within
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    42
    its superview. Like a layoutOrigin, it controls the origin of a component
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    43
    by given fraction and offset dimensions; in addition, the bottom-right
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    44
    corner is also controlled by corresponding values. Therefore, the components
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    45
    preferredExtent is ignored.
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    46
f2389560b8eb *** empty log message ***
claus
parents: 88
diff changeset
    47
    See also:
219
106b86ca81da documentation
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
    48
        LayoutOrigin AlignmentOrigin Layout
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
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   134
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
   135
    "create a new layoutFrame"
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   136
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   137
    ^ self new
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   138
        leftFraction:lF offset:lO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   139
        rightFraction:rF offset:rO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   140
        topFraction:tF offset:tO 
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   141
        bottomFraction:bF offset:bO
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   142
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   143
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   144
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   145
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   146
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   147
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   148
    "create a new layoutFrame"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   149
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   150
    ^ self new
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   151
        leftOffset:lO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   152
        rightOffset:rO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   153
        topOffset:tO 
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   154
        bottomOffset:bO
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
    "Created: 18.4.1997 / 20:14:44 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   157
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   158
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   159
leftOffset:lO topOffset:tO rightOffset:rO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   160
    "create a new layoutFrame"
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
    ^ self leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   163
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   164
    "Modified: 18.4.1997 / 20:15:23 / cg"
426
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   165
! !
45859f8a2044 checkin from browser
ca
parents: 425
diff changeset
   166
77
claus
parents:
diff changeset
   167
!LayoutFrame methodsFor:'accessing'!
claus
parents:
diff changeset
   168
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   169
bottomFraction
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   170
    "return 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
    ^ bottomFraction
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   173
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   174
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
bottomFraction:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
    "set bottomFraction"
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
    bottomFraction := something.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   181
bottomFraction:something offset:o
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
    "set bottomFraction and offset"
77
claus
parents:
diff changeset
   183
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
    bottomFraction := something.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
    bottomOffset := o
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   186
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   187
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   188
bottomInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   189
    "set bottomOffset for an inset at the bottom"
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
    bottomOffset := pixels negated.
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
    "Created: 26.5.1996 / 17:38:30 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   194
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   195
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   196
bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   197
    "return 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
    ^ bottomOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   200
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   201
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   202
bottomOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   203
    "set bottomOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   204
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   205
    bottomOffset := something.
77
claus
parents:
diff changeset
   206
!
claus
parents:
diff changeset
   207
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   208
horizontalInset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   209
    "setup the offsets for insetting horizontally the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   210
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   211
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   212
    leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   213
    rightOffset := aNumber negated.
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
    "Created: 26.5.1996 / 17:39:35 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   216
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   217
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   218
inset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   219
    "setup the offsets for insetting the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   220
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   221
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   222
    topOffset := leftOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   223
    rightOffset := bottomOffset := aNumber negated.
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
    "Created: 26.5.1996 / 17:36:49 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   226
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   227
425
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   228
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
   229
    "set all fields"
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   230
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   231
    leftFraction := lF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   232
    rightFraction := rF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   233
    topFraction := tF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   234
    bottomFraction := bF.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   235
    leftOffset := lO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   236
    rightOffset := rO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   237
    topOffset := tO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   238
    bottomOffset := bO.
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   239
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   240
!
54077a8586f0 checkin from browser
ca
parents: 416
diff changeset
   241
545
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   242
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   243
    "set all offset fields"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   244
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   245
    leftOffset := lO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   246
    rightOffset := rO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   247
    topOffset := tO.
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   248
    bottomOffset := bO.
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
    "Created: 18.4.1997 / 20:16:08 / cg"
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   251
!
0b9d704baeae more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
   252
77
claus
parents:
diff changeset
   253
rightFraction
claus
parents:
diff changeset
   254
    "return rightFraction"
claus
parents:
diff changeset
   255
claus
parents:
diff changeset
   256
    ^ rightFraction
claus
parents:
diff changeset
   257
!
claus
parents:
diff changeset
   258
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   259
rightFraction:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   260
    "set rightFraction"
77
claus
parents:
diff changeset
   261
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   262
    rightFraction := something.
77
claus
parents:
diff changeset
   263
!
claus
parents:
diff changeset
   264
claus
parents:
diff changeset
   265
rightFraction:something offset:o
claus
parents:
diff changeset
   266
    "set rightFraction and offset"
claus
parents:
diff changeset
   267
claus
parents:
diff changeset
   268
    rightFraction := something.
claus
parents:
diff changeset
   269
    rightOffset := o
claus
parents:
diff changeset
   270
!
claus
parents:
diff changeset
   271
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   272
rightInset:pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   273
    "set rightOffset for an inset at the right"
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
    rightOffset := pixels negated.
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
    "Created: 26.5.1996 / 17:38:38 / cg"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   278
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   279
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   280
rightOffset
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   281
    "return rightOffset"
77
claus
parents:
diff changeset
   282
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   283
    ^ rightOffset
77
claus
parents:
diff changeset
   284
!
claus
parents:
diff changeset
   285
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   286
rightOffset:something
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   287
    "set rightOffset"
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   288
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   289
    rightOffset := something.
275
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   290
!
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   291
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   292
verticalInset:aNumber
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   293
    "setup the offsets for insetting vertically the frame aNumber pixels
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   294
     at all sides"
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   295
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   296
    topOffset := aNumber.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   297
    bottomOffset := aNumber negated.
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   298
d500c08871ab added inset methods
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   299
    "Created: 26.5.1996 / 17:39:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   300
! !
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
!LayoutFrame methodsFor:'converting'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   303
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   304
fromLiteralArrayEncoding:encoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   305
    "read my values from an encoding.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   306
     The encoding is supposed to be of the form: 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   307
	(LayoutFrame orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   308
     This is the reverse to literalArrayEncoding."
77
claus
parents:
diff changeset
   309
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   310
    leftOffset := encoding at:2.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   311
    leftFraction := encoding at:3.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   312
    topOffset := encoding at:4.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   313
    topFraction := encoding at:5.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   314
    rightOffset := encoding at:6.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   315
    rightFraction := encoding at:7.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   316
    bottomOffset := encoding at:8.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   317
    bottomFraction := encoding at:9.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   318
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   319
    "
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   320
      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
   321
      #(#LayoutFrame 70 0 2 0 0 1 25 0 ) decodeAsLiteralArray 
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   322
    "
77
claus
parents:
diff changeset
   323
!
claus
parents:
diff changeset
   324
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   325
literalArrayEncoding
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   326
    "encode myself as an array, from which a copy of the receiver
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   327
     can be reconstructed with #decodeAsLiteralArray.
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   328
     The encoding is: 
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   329
        (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)"
77
claus
parents:
diff changeset
   330
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   331
    ^ super literalArrayEncoding
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   332
      , (Array
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   333
            with:rightOffset
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   334
            with:rightFraction
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   335
            with:bottomOffset
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   336
            with:bottomFraction)
77
claus
parents:
diff changeset
   337
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   338
    "Modified: 1.9.1995 / 02:43:35 / claus"
191
cb2815b77100 commentary
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   339
    "Modified: 22.4.1996 / 13:00:17 / cg"
77
claus
parents:
diff changeset
   340
! !
claus
parents:
diff changeset
   341
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   342
!LayoutFrame methodsFor:'initialization'!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   343
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   344
initialize
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   345
    leftOffset := rightOffset := bottomOffset := topOffset := 0.
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   346
    leftFraction := topFraction := 0.
468
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   347
    "/ bottomFraction := rightFraction := 1.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   348
    bottomFraction := rightFraction := 0.
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   349
bb4100d09a18 default frame is 0/0 -> 0/0
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   350
    "Modified: 1.3.1997 / 16:12:50 / cg"
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   351
! !
77
claus
parents:
diff changeset
   352
83
claus
parents: 77
diff changeset
   353
!LayoutFrame methodsFor:'printing & storing'!
claus
parents: 77
diff changeset
   354
claus
parents: 77
diff changeset
   355
displayString
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   356
    "return a printed representation of the receiver for displaying"
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   357
83
claus
parents: 77
diff changeset
   358
    ^ (self class name) , '(' 
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   359
        , 'l: ' , leftFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   360
        , '+' , leftOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   361
        , ' t: ' , topFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   362
        , '+' , topOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   363
        , ' r: ' , rightFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   364
        , '+' , rightOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   365
        , ' b: ' , bottomFraction displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   366
        , '+' , bottomOffset displayString
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   367
        , ')'
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   368
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   369
    "Modified: 20.9.1997 / 11:40:14 / cg"
83
claus
parents: 77
diff changeset
   370
! !
claus
parents: 77
diff changeset
   371
77
claus
parents:
diff changeset
   372
!LayoutFrame methodsFor:'queries'!
claus
parents:
diff changeset
   373
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   374
corner
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   375
    ^ rightFraction asFloat @ bottomFraction asFloat
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   376
!
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   377
416
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   378
isLayoutFrame
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   379
    "return true, if this is a layoutFrame"
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   380
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   381
    ^ true
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   382
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   383
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   384
!
83ab2c5c7ec4 checkin from browser
ca
parents: 275
diff changeset
   385
77
claus
parents:
diff changeset
   386
rectangleRelativeTo:superRectangle preferred:prefRect
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   387
    "compute the rectangle represented by the receiver,
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   388
     given the superViews rectangle and the views preferredExtent."
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   389
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   390
    |x1 y1 x2 y2 superWidth superHeight|
77
claus
parents:
diff changeset
   391
claus
parents:
diff changeset
   392
    leftOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   393
        x1 := 0
77
claus
parents:
diff changeset
   394
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   395
        x1 := leftOffset value
77
claus
parents:
diff changeset
   396
    ].
claus
parents:
diff changeset
   397
    topOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   398
        y1 := 0
77
claus
parents:
diff changeset
   399
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   400
        y1 := topOffset value
77
claus
parents:
diff changeset
   401
    ].
claus
parents:
diff changeset
   402
    rightOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   403
        x2 := 0
77
claus
parents:
diff changeset
   404
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   405
        x2 := rightOffset value
77
claus
parents:
diff changeset
   406
    ].
claus
parents:
diff changeset
   407
    bottomOffset isNil ifTrue:[
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   408
        y2 := 0
77
claus
parents:
diff changeset
   409
    ] ifFalse:[
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   410
        y2 := bottomOffset value
77
claus
parents:
diff changeset
   411
    ].
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   412
77
claus
parents:
diff changeset
   413
    leftFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   414
        superWidth := superRectangle width.
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   415
        x1 := x1 + (superWidth * leftFraction value)
77
claus
parents:
diff changeset
   416
    ].
claus
parents:
diff changeset
   417
    topFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   418
        superHeight := superRectangle height.
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   419
        y1 := y1 + (superHeight * topFraction value)
77
claus
parents:
diff changeset
   420
    ].
claus
parents:
diff changeset
   421
    rightFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   422
        superWidth isNil ifTrue:[superWidth := superRectangle width].
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   423
        x2 := x2 + (superWidth * rightFraction value)
77
claus
parents:
diff changeset
   424
    ].
claus
parents:
diff changeset
   425
    bottomFraction notNil ifTrue:[
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   426
        superHeight isNil ifTrue:[superHeight := superRectangle height].
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   427
        y2 := y2 + (superHeight * bottomFraction value)
77
claus
parents:
diff changeset
   428
    ].
242
5b7f59450c65 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   429
    ^ Rectangle left:x1 top:y1 right:x2 bottom:y2
83
claus
parents: 77
diff changeset
   430
claus
parents: 77
diff changeset
   431
    "
claus
parents: 77
diff changeset
   432
     |superRect lF|
claus
parents: 77
diff changeset
   433
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   434
     superRect := 0@0 corner:99@99.
83
claus
parents: 77
diff changeset
   435
     lF := (LayoutFrame new).
claus
parents: 77
diff changeset
   436
     lF leftFraction:0.25;
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   437
        topFraction:0.25;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   438
        rightFraction:0.75;
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   439
        bottomFraction:0.75.
83
claus
parents: 77
diff changeset
   440
     lF rectangleRelativeTo:superRect preferred:(0@0 corner:30@30) 
claus
parents: 77
diff changeset
   441
    "
229
612861ef768a examples
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   442
498
a9f922ab2050 avoid 2 sends if possible
Claus Gittinger <cg@exept.de>
parents: 468
diff changeset
   443
    "Created: 6.3.1997 / 21:07:51 / cg"
695
b27d39658fd2 allow valueHolders for the layout components.
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
   444
    "Modified: 13.9.1997 / 10:40:24 / cg"
77
claus
parents:
diff changeset
   445
! !
100
claus
parents: 96
diff changeset
   446
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   447
!LayoutFrame class methodsFor:'documentation'!
100
claus
parents: 96
diff changeset
   448
126
25df58661f32 version at the end
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   449
version
700
67f1dccb8333 comments
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   450
    ^ '$Header: /cvs/stx/stx/libview2/Attic/LayoutFrm.st,v 1.23 1997-09-20 22:19:44 cg Exp $'
100
claus
parents: 96
diff changeset
   451
! !