ConstrainedLayoutFrame.st
author Claus Gittinger <cg@exept.de>
Thu, 18 Jul 2019 21:57:46 +0200
changeset 4307 1b0e3ba1d905
parent 4297 68b0abe77b63
child 4354 be083087160e
permissions -rw-r--r--
#FEATURE by cg class: FlyByHelp changed: #keyPress:x:y:view: shift+shift+control
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4297
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2019 by Claus Gittinger
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview2' }"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ NameSpace: Smalltalk }"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
LayoutFrame subclass:#ConstrainedLayoutFrame
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'minLeft maxLeft minRight maxRight minTop maxTop minBottom
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
		maxBottom'
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Graphics-Geometry'
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!ConstrainedLayoutFrame class methodsFor:'documentation'!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
copyright
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 COPYRIGHT (c) 2019 by Claus Gittinger
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
              All Rights Reserved
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 This software is furnished under a license and may be used
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 only in accordance with the terms of that license and with the
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 be provided or otherwise made available to, or used by, any
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 other person.  No title to or ownership of the software is
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 hereby transferred.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    Instances of me are like layoutFrames,
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    with additional (optional) limits on the bounds.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Useful to arrange for labels in a dialog to never become too large.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [author:]
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        Claus Gittinger
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [see also:]
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        View
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
        LayoutFrame LayoutOrigin AlignmentOrigin Layout 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        Rectangle Point
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!ConstrainedLayoutFrame methodsFor:'accessing'!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
maxBottom
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    ^ maxBottom
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
maxBottom:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    maxBottom := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
maxLeft
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    ^ maxLeft
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
maxLeft:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    maxLeft := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
maxRight
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    ^ maxRight
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
maxRight:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    maxRight := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
maxTop
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ^ maxTop
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
maxTop:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    maxTop := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
minBottom
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    ^ minBottom
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
minBottom:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    minBottom := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
minLeft
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    ^ minLeft
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
minLeft:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    minLeft := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
minRight
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    ^ minRight
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
minRight:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    minRight := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
minTop
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    ^ minTop
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
minTop:something
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    minTop := something.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
! !
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
!ConstrainedLayoutFrame methodsFor:'computing'!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
rectangleRelativeTo:superRectangle preferred:prefRectHolder
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    "compute the rectangle represented by the receiver,
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
     given the superView's rectangle and the view's preferredExtent."
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    |x1 y1 x2 y2 superWidth superHeight|
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    x1 := x2 := superRectangle left.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    y1 := y2 := superRectangle top.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    leftOffset notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
        x1 := x1 + leftOffset value
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    topOffset notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
        y1 := y1 + topOffset value
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    rightOffset notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        x2 := x2 + rightOffset value
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    bottomOffset notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
        y2 := y2 + bottomOffset value
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    leftFraction notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        superWidth := superRectangle width.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        x1 := x1 + (superWidth * leftFraction value) 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    topFraction notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
        superHeight := superRectangle height.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
        y1 := y1 + (superHeight * topFraction value) 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    rightFraction notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
        superWidth isNil ifTrue:[superWidth := superRectangle width].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
        x2 := x2 + (superWidth * rightFraction value) 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    bottomFraction notNil ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
        superHeight isNil ifTrue:[superHeight := superRectangle height].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
        y2 := y2 + (superHeight * bottomFraction value) 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    ].
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    (minLeft notNil and:[x1 < minLeft]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
        x1 := minLeft.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    (maxLeft notNil and:[x1 > maxLeft]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
        x1 := maxLeft.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    (minTop notNil and:[y1 < minTop]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
        y1 := minTop.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    (maxTop notNil and:[x1 > maxTop]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
        y1 := maxTop.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
    (minRight notNil and:[x1 < minRight]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
        x2 := minRight.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    (maxRight notNil and:[x1 > maxRight]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
        x2 := maxRight.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    (minBottom notNil and:[y1 < minBottom]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
        y2 := minBottom.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    (maxBottom notNil and:[x1 > maxBottom]) ifTrue:[
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
        y2 := maxBottom.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    ].    
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
    ^ Rectangle left:x1 top:y1 right:x2 bottom:y2
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    "
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
     |superRect1 superRect2 lF|
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
     superRect1 := 0@0 corner:100@100.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
     superRect2 := 0@0 corner:400@100.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
     lF := (ConstrainedLayoutFrame new).
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
     lF leftFraction:0.25 rightFraction:0.75
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
        topFraction:0.25 bottomFraction:0.75.
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
     lF rectangleRelativeTo:superRect1 preferred:(0@0 corner:30@30). 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
     lF rectangleRelativeTo:superRect2 preferred:(0@0 corner:30@30). 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
     lF maxLeft:70.   
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
     lF rectangleRelativeTo:superRect2 preferred:(0@0 corner:30@30). 
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "Created: / 17-07-2019 / 10:02:08 / Claus Gittinger"
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
! !
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
!ConstrainedLayoutFrame class methodsFor:'documentation'!
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
version_CVS
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    ^ '$Header$'
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
! !
68b0abe77b63 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211