MultiColumnPanelView.st
author sr
Tue, 11 Jun 2019 11:47:16 +0200
changeset 6604 89a0c07bbba9
parent 6487 debe1f7cce35
child 6827 71d47cbb79ed
permissions -rw-r--r--
#BUGFIX by Stefan Reise fixed recursion when calling #showSelectedFont #updateFamilyList class: FontPanel added: #updateFamilyListAndDoShowSelectedFont: changed: #showSelectedFont #updateFamilyList
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libwidg' }"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
6487
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
    14
"{ NameSpace: Smalltalk }"
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
    15
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
PanelView subclass:#MultiColumnPanelView
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'columnWidths'
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Views-Layout'
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!MultiColumnPanelView class methodsFor:'documentation'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    a View which arranges its child-views in a vertical column.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    All real work is done in PanelView - except the layout computation is
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    redefined here.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    The layout is controlled by the instance variables: 
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
	horizontalLayout and verticalLayout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    in addition to 
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	horizontalSpace and verticalSpace.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    The vertical layout can be any of:
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
	#top            arrange elements at the top
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
	#topSpace       arrange elements at the top, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
	#bottom         arrange elements at the bottom
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
	#bottomSpace    arrange elements at the bottom, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
	#center         arrange elements in the center; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
	#spread         spread elements evenly; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
	#fitSpace       like #fit, with spacing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
	#topFit         like #top, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
	#topSpaceFit    like #topSpace, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
	#bottomFit      like #bottom, but resize the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
	#bottomSpaceFit like #bottomSpace, but resize the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    the horizontal layout can be:
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
	#left           place element at the left
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
	#leftSpace      place element at the left, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
	#center         place elements horizontally centered; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
	#right          place it at the right
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
	#rightSpace     place it at the right, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
	#leftMax        like #left, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
	#leftSpaceMax   like #leftSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
	#centerMax      like #center, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
	#rightMax       like #right, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
	#rightSpaceMax  like #rightSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    The defaults is #center for both directions.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    The layout is changed by the messages #verticalLayout: and #horizontalLayout:.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    For backward compatibility (to times, where only vLayout existed), the simple
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    #layout: does the same as #verticalLayout:. Do not use this old method.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    The panel assumes, that the elements do not resize themselfes, after it
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    became visible. This is not true for all widgets (buttons or labels may
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    like to change). If you have changing elements, tell this to the panel
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    with 'aPanel elementsChangeSize:true'. In that case, the panel will react
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    to size changes, and reorganize things.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    If none of these layout/space combinations is exactly what you need in
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    your application, create a subclass, and redefine the setChildPositions method.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    CAVEAT: this class started with #top and no horizontal alignments;
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    as time went by, more layouts were added and the setup should be changed
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    to use different selectors for space, max-resize and alignment
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    (i.e. having more and more layout symbols makes things a bit confusing ...)
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    [see also:]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
	HorizontalPanelView
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
	VariableVerticalPanel VariableHorizontalPanel
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
	Label
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    [author:]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
	Claus Gittinger
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
examples
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    These examples demonstrate the effect of different layout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    settings.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    You should try more examples, combining spacing and different
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    verticalLayout:/horizontalLayout: combinations.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    example: default layout (centered)
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
                                                                        [exBegin]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
        |v p b1 b2 b3 l1 l2 l3|
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
        v := StandardSystemView new.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
        v label:'center (default)'.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
        p := MultiColumnPanelView in:v.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
        p columnWidths:#(0.3 0.7).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
        l1 := Label label:'label1' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
        b1 := Button label:'button1' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
        l2 := Label label:'l2' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
        b2 := Button label:'b2' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
        l3 := Label label:'lab3' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
        b3 := Button label:'butt3' in:p.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
        v extent:100 @ 300.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        v open
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
                                                                        [exEnd]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
! !
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
!MultiColumnPanelView methodsFor:'accessing'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
columnWidths:something
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    something ~= columnWidths ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
        columnWidths := something.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        self layoutChanged
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
horizontalLayout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    "return the horizontal layout as symbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
     the returned value is one of
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
	#left           place element at the left
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
	#leftSpace      place element at the left, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
	#center         place elements horizontally centered; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
	#right          place it at the right
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
	#rightSpace     place it at the right, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
	#leftMax        like #left, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
	#leftSpaceMax   like #leftSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
	#centerMax      like #center, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
	#rightMax       like #right, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
	#rightSpaceMax  like #rightSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
      the default is #centered
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    "
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ^ hLayout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
horizontalLayout:aSymbol
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    "change the horizontal layout as symbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
     The argument, aSymbol must be one of:
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
	#left           place element at the left
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
	#leftSpace      place element at the left, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
	#center         place elements horizontally centered; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
	#right          place it at the right
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
	#rightSpace     place it at the right, offset by horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
	#leftMax        like #left, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
	#leftSpaceMax   like #leftSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
	#centerMax      like #center, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
	#rightMax       like #right, but resize elements to max of them
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
	#rightSpaceMax  like #rightSpace, but resize elements
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
      the default (if never changed) is #centered
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    "
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    (hLayout ~~ aSymbol) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
	hLayout := aSymbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
	self layoutChanged
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    ]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
layout:something
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    "OBSOLETE compatibility interface. Will vanish.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
     leftover for historic reasons - do not use any more.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
     In the meantime, try to figure out what is meant ... a kludge"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    <resource:#obsolete>
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    something isLayout ifTrue:[^ super layout:something].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    self obsoleteMethodWarning:'use #verticalLayout:'.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    ^ self verticalLayout:something
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    "Modified: 31.8.1995 / 23:08:54 / claus"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
verticalLayout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    "return the vertical layout as a symbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
     the returned value is one of
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
	#top            arrange elements at the top
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
	#topSpace       arrange elements at the top, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
	#bottom         arrange elements at the bottom
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
	#bottomSpace    arrange elements at the bottom, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
	#center         arrange elements in the center; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
	#spread         spread elements evenly; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
	#fitSpace       like #fit, with spacing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
	#topFit         like #top, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
	#topSpaceFit    like #topSpace, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
	#bottomFit      like #bottom, but resize the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
	#bottomSpaceFit like #bottomSpace, but extend the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
      the default is #centered
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    "
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    ^ vLayout
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    "Modified: 17.8.1997 / 15:20:13 / cg"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
verticalLayout:aSymbol
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    "change the vertical layout as a symbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
     The argument, aSymbol must be one of:
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
	#top            arrange elements at the top
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
	#topSpace       arrange elements at the top, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
	#bottom         arrange elements at the bottom
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
	#bottomSpace    arrange elements at the bottom, start with spacing
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
	#center         arrange elements in the center; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
	#spread         spread elements evenly; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
	#fitSpace       like #fit, with spacing; ignore verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
	#topFit         like #top, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
	#topSpaceFit    like #topSpace, but resize the last element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
	#bottomFit      like #bottom, but resize the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
	#bottomSpaceFit like #bottomSpace, but extend the first element to fit
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
      the default (if never changed) is #centered
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
    "
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    (vLayout ~~ aSymbol) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
	vLayout := aSymbol.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
	self layoutChanged
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    ]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    "Modified: 17.8.1997 / 15:19:58 / cg"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
! !
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!MultiColumnPanelView methodsFor:'initialization'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
initialize
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    super initialize.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    hLayout := #fit.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    vLayout := #top.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    columnWidths := #(0.5 0.5).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
! !
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
!MultiColumnPanelView methodsFor:'layout'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
setChildPositions
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    "(re)compute position of every child"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
4564
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   278
    |xpos ypos space numChilds hInside hL vL maxHeight m2 subViews rowsPerCol maxWidthPerCol col numCols cX cY bw|
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    subViews := self subViewsToConsider.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    subViews size == 0 ifTrue:[^ self].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
"/    self extentChangedFlag ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
"/        ext := self computeExtent.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
"/        width := ext x.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
"/        height := ext y.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
"/    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    space := verticalSpace.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    numChilds := subViews size.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
    numCols := columnWidths size max:1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
4019
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   293
    bw := self borderWidth.
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    m2 := margin * 2.
4019
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   295
    hInside := height - m2 + (bw*2) - subViews last borderWidth.
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    hL := hLayout.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    vL := vLayout.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    rowsPerCol := Array new:numCols withAll:0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
    maxWidthPerCol := Array new:numCols withAll:0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    maxHeight := 0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
    col := 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    subViews do:[:child |
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
        |childsW childsH|
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
        childsW := child widthIncludingBorder.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
        childsH := child heightIncludingBorder.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
        maxHeight := maxHeight max:childsH.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
        maxWidthPerCol at:col put:((maxWidthPerCol at:col) max:childsW).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
        rowsPerCol at:col put:(rowsPerCol at:col)+1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
        col := col + 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
        col > numCols ifTrue:[ col := 1 ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
"/ new
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    xpos := 0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    ypos := 0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
    col := 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    subViews do:[:child |
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
        col == numCols ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
            cX := width.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
        ] ifFalse:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
            cX := xpos + (width // numCols).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
        ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
        cY := ypos + maxHeight.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
        child origin:(xpos@ypos)"corner:(cX @ cY)".
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
        hLayout == #fit ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
            child width:(cX - xpos + 1).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
        ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
        col := col + 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
        col > numCols ifTrue:[ 
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
            col := 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
            xpos := 0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
            ypos := cY + verticalSpace.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
        ] ifFalse:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
            xpos := cX + horizontalSpace.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
        ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    ^ self.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
"/ old
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
4564
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   345
"/    resizeToMaxV := false.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   346
"/    (vL endsWith:'Max') ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   347
"/        resizeToMaxV := true.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   348
"/        hEach := maxHeight := subViews inject:0 into:[:maxSoFar :child | maxSoFar max:child heightIncludingBorder].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   349
"/        vL := (vL copyButLast:3) asSymbol.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   350
"/    ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   351
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   352
"/    numChilds == 1 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   353
"/        (vL == #topFit or:[vL == #bottomFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   354
"/            vL := #fit
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   355
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   356
"/        (vL == #topSpaceFit or:[vL == #bottomSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   357
"/            vL := #fitSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   358
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   359
"/    ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   360
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   361
"/    vL == #fitSpace ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   362
"/        "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   363
"/         adjust childs extents and set origins.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   364
"/         Be careful to avoid accumulation of rounding errors
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   365
"/        "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   366
"/        hEach := (hInside - ((numChilds + 1) * space)) / numChilds.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   367
"/        ypos := space + margin - bw.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   368
"/    ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   369
"/        vL == #fit ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   370
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   371
"/             adjust childs extents and set origins.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   372
"/             Be careful to avoid accumulation of rounding errors
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   373
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   374
"/            hEach := (hInside - ((numChilds - 1) * space)) / numChilds.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   375
"/            ypos := margin - bw.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   376
"/        ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   377
"/            l := vL.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   378
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   379
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   380
"/             compute net height needed
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   381
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   382
"/            resizeToMaxV ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   383
"/                sumOfHeights := subViews inject:0 into:[:sumSoFar :child | sumSoFar + maxHeight + (child borderWidth*2)].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   384
"/            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   385
"/                sumOfHeights := subViews inject:0 into:[:sumSoFar :child | sumSoFar + child heightIncludingBorder].
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
"/
4564
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   387
"/                "/ adjust - do not include height of last(first) element if doing a fit
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   388
"/                (vL == #topFit or:[vL == #topSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   389
"/                    sumOfHeights := sumOfHeights - subViews last heightIncludingBorder.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   390
"/                ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   391
"/                    (vL == #bottomFit or:[vL == #bottomSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   392
"/                        sumOfHeights := sumOfHeights - subViews first heightIncludingBorder.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   393
"/                    ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   394
"/                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   395
"/            ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   396
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   397
"/            restHeight := height - sumOfHeights - ((numChilds-1)*space).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   398
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   399
"/            ((l == #center) and:[numChilds == 1]) ifTrue:[l := #spread].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   400
"/            (l == #spread and:[numChilds == 1]) ifTrue:[l := #spreadSpace].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   401
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   402
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   403
"/             compute position of topmost subview and space between them;
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   404
"/             if they do hardly fit, leave no space between them 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   405
"/            "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   406
"/            ((sumOfHeights >= (height - m2))
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   407
"/            and:[l ~~ #fixTopSpace and:[l ~~ #fixTop]]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   408
"/                "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   409
"/                 if we have not enough space for all the elements, 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   410
"/                 fill them tight, and show what can be shown (at least)
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   411
"/                "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   412
"/                ypos := margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   413
"/                space := 0
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   414
"/            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   415
"/                l == #fixTopSpace ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   416
"/                    l := #topSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   417
"/                ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   418
"/                    l == #fixTop ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   419
"/                        l := #top 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   420
"/                    ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   421
"/                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   422
"/                ((l == #bottom) or:[l == #bottomSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   423
"/                or:[l == #bottomFit or:[l == #bottomSpaceFit]]]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   424
"/                    ypos := restHeight - (space * (numChilds - 1)).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   425
"/"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   426
"/"/                    bw == 0 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   427
"/"/                        ypos := ypos + space 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   428
"/"/                    ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   429
"/"/           
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   430
"/                    (l == #bottomSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   431
"/                    or:[l == #bottomSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   432
"/                        ypos >= space ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   433
"/                            ypos := ypos - space
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   434
"/                        ]
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
"/                    ].
4564
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   436
"/                    ypos := ypos - margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   437
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   438
"/                    ypos < 0 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   439
"/                        space := space min:(restHeight // (numChilds + 1)).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   440
"/                        ypos := restHeight - (space * numChilds).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   441
"/                    ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   442
"/                ] ifFalse: [
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   443
"/                    (l == #spread) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   444
"/                        space := (restHeight - m2) // (numChilds - 1).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   445
"/                        ypos := margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   446
"/                        (space == 0) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   447
"/                            ypos := restHeight // 2
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   448
"/                        ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   449
"/                    ] ifFalse: [
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   450
"/                      (l == #spreadSpace) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   451
"/                        space := (restHeight - m2) // (numChilds + 1).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   452
"/                        ypos := space + margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   453
"/                        (space == 0) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   454
"/                            ypos := restHeight // 2
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   455
"/                        ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   456
"/                      ] ifFalse: [
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   457
"/                        ((l == #top) or:[l == #topSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   458
"/                        or:[l == #topFit or:[l == #topSpaceFit]]]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   459
"/                            space := space min:(restHeight - m2) // (numChilds + 1).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   460
"/                            (vL == #fixTop or:[vL == #fixTopSpace]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   461
"/                                space := space max:verticalSpace.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   462
"/                            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   463
"/                                space := space max:0.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   464
"/                            ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   465
"/                            (l == #topSpace or:[l == #topSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   466
"/                                ypos := space + margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   467
"/                            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   468
"/                                "/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   469
"/                                "/ if the very first view has a 0-level AND
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   470
"/                                "/ my level is non-zero, begin with margin
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   471
"/                                "/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   472
"/                                true "(margin ~~ 0 and:[subViews first level == 0])" ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   473
"/                                    ypos := margin
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   474
"/                                ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   475
"/                                    ypos := 0
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   476
"/                                ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   477
"/                            ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   478
"/                        ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   479
"/                            "center"
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   480
"/                            ypos := (restHeight - ((numChilds - 1) * space)) // 2.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   481
"/                            ypos < 0 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   482
"/                                space := restHeight // (numChilds + 1).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   483
"/                                ypos := (restHeight - ((numChilds - 1) * space)) // 2.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   484
"/                            ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   485
"/                        ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   486
"/                      ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   487
"/                    ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   488
"/                ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   489
"/            ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   490
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   491
"/    ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   492
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   493
"/    resizeToMaxH := false.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   494
"/    (hL endsWith:'Max') ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   495
"/        resizeToMaxH := true.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   496
"/        maxWidth := subViews inject:0 into:[:maxSoFar :child | maxSoFar max:child widthIncludingBorder].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   497
"/        hL := (hL copyWithoutLast:3) asSymbol.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   498
"/    ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   499
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   500
"/    "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   501
"/     now set positions
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   502
"/    "
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   503
"/    subViews keysAndValuesDo:[:index :child |
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   504
"/        |xpos advance bwChild wChild newWChild x2|
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   505
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   506
"/        wChild := child widthIncludingBorder.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   507
"/        bwChild := child borderWidth.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   508
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   509
"/        elementsChangeSize ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   510
"/            "to avoid a recursion when we change the elements size"
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   511
"/            child removeDependent:self.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   512
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   513
"/        resizeToMaxH ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   514
"/            child width:(wChild := maxWidth - (bwChild  * 2)).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   515
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   516
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   517
"/        hL == #left ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   518
"/            xpos := 0 - bw + margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   519
"/        ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   520
"/            hL == #leftSpace ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   521
"/                xpos := horizontalSpace + margin
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   522
"/            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   523
"/                hL == #right ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   524
"/                    xpos := width - wChild - margin
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   525
"/                ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   526
"/                    hL == #rightSpace ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   527
"/                        xpos := width - horizontalSpace - wChild - margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   528
"/                    ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   529
"/                        hL == #fitSpace ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   530
"/                            xpos := horizontalSpace + margin.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   531
"/                            newWChild := width - m2 - ((horizontalSpace + bwChild) * 2)
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   532
"/                        ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   533
"/                            hL == #fit ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   534
"/                                newWChild := width "- (bwChild * 2)".
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   535
"/                                bw == 0 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   536
"/                                    newWChild :=  newWChild - (bwChild * 2)
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   537
"/                                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   538
"/                                true "child level == 0" ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   539
"/                                    xpos := margin - bw.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   540
"/                                    newWChild := newWChild - m2
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   541
"/                                ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   542
"/                                    xpos := 0 - bw. 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   543
"/                                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   544
"/                            ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   545
"/                                "centered"
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   546
"/                                 xpos := margin + ((width - m2 - wChild) // 2).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   547
"/                            ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   548
"/                        ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   549
"/                    ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   550
"/                ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   551
"/            ]
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   552
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   553
"/        newWChild notNil ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   554
"/            child width:newWChild
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   555
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   556
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   557
"/"/        (xpos < 0) ifTrue:[ xpos := 0 ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   558
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   559
"/        x2 := xpos + child width - 1.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   560
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   561
"/        (vL == #fit 
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   562
"/        or:[vL == #fitSpace
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   563
"/        or:[resizeToMaxV]]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   564
"/            child origin:(xpos @ (ypos rounded))
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   565
"/                  corner:(x2 @ (ypos + hEach - bwChild - 1) rounded).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   566
"/            advance := hEach
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   567
"/        ] ifFalse:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   568
"/            child origin:(xpos@ypos).
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   569
"/            advance := child heightIncludingBorder
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   570
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   571
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   572
"/        index == numChilds ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   573
"/            |y|
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   574
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   575
"/            (vL == #topFit or:[vL == #topSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   576
"/                y := height - margin - 1.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   577
"/                vL == #topSpaceFit ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   578
"/                    y := y - space
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   579
"/                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   580
"/                child corner:x2 @ y
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   581
"/            ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   582
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   583
"/        index == 1 ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   584
"/            (vL == #bottomFit or:[vL == #bottomSpaceFit]) ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   585
"/                ypos := margin + 0 + (child borderWidth * 2) - bw.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   586
"/                vL == #bottomSpaceFit ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   587
"/                    ypos := ypos + space
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   588
"/                ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   589
"/                advance := restHeight.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   590
"/                child origin:((child origin x) @ ypos)
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   591
"/                      corner:((child corner x) @ (ypos+advance))
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   592
"/            ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   593
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   594
"/
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   595
"/        ypos := ypos + advance + space.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   596
"/        elementsChangeSize ifTrue:[
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   597
"/            "reinstall dependency that we removed above"
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   598
"/            child addDependent:self.
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   599
"/        ].
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   600
"/    ]
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
    "Modified: / 04-09-1995 / 18:43:29 / claus"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    "Modified: / 10-10-2007 / 13:47:56 / cg"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
! !
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
!MultiColumnPanelView methodsFor:'queries'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
6487
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   608
computePreferredExtent
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
    "return a good extent, one that makes subviews fit"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
    |maxHeight maxWidth maxWidthPerCol w m2 subViews col numCols rowsPerCol|
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
    subViews := self subViewsToConsider.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    (subViews size == 0) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
        ^ super preferredExtent.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
    "compute net height needed"
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
    numCols := columnWidths size.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
    rowsPerCol := Array new:numCols withAll:0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
    maxWidthPerCol := Array new:numCols withAll:0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
    maxHeight := 0.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    col := 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
    subViews do:[:child |
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
        |childsPreference|
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
        childsPreference := child preferredExtent.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
        maxHeight := maxHeight max:childsPreference y.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
        maxWidthPerCol at:col put:((maxWidthPerCol at:col) max:childsPreference y).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
        rowsPerCol at:col put:(rowsPerCol at:col)+1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
        col := col + 1.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
        col > numCols ifTrue:[ col := 1 ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
4019
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   636
    self borderWidth ~~ 0 ifTrue:[
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
        maxWidth := maxWidth + (horizontalSpace * 2).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
"/    sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
"/    ((vLayout == #topSpace) or:[vLayout == #bottomSpace]) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
"/        sumOfHeights := sumOfHeights + verticalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
"/    ] ifFalse:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
"/        ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
"/            sumOfHeights := sumOfHeights + (verticalSpace * 2)
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
"/        ]
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
"/    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
"/    ((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
"/        maxWidth := maxWidth + horizontalSpace
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
"/    ] ifFalse:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
"/        ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
"/            maxWidth := maxWidth + (horizontalSpace * 2)
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
"/        ]        
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
"/    ].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
    m2 := margin * 2.
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
"/    ^ (maxWidth + m2) @ (sumOfHeights + m2)
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
    w := maxWidthPerCol inject:0 into:[:sumSoFar :thisWidth | sumSoFar + thisWidth].
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
    ^ (w+m2) @ (rowsPerCol max * maxHeight) + m2
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
6487
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   663
    "Created: / 09-11-2018 / 19:57:46 / Claus Gittinger"
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
! !
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
!MultiColumnPanelView class methodsFor:'documentation'!
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
version
6487
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   669
    ^ '$Header$'
4019
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   670
!
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   671
bf57f58f13a8 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
   672
version_CVS
6487
debe1f7cce35 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4564
diff changeset
   673
    ^ '$Header$'
3518
61cde5384831 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
! !
4564
0a0d41148e11 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4019
diff changeset
   675