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