VerticalPanelView.st
author Claus Gittinger <cg@exept.de>
Wed, 10 Oct 2007 13:48:48 +0200
changeset 3504 2395db2daa9e
parent 3502 5dd1d5b01e4d
child 3529 bcf8c2053ac4
permissions -rw-r--r--
setChildPositions fix with bottomFit (ignored inner spacing when computing rest-height)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
2305
f2850e54b0ab only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
    12
"{ Package: 'stx:libwidg' }"
f2850e54b0ab only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
    13
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    14
PanelView subclass:#VerticalPanelView
321
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    15
	instanceVariableNames:''
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    16
	classVariableNames:''
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    17
	poolDictionaries:''
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    18
	category:'Views-Layout'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    19
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    20
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
    21
!VerticalPanelView class methodsFor:'documentation'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    22
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    23
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    24
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    25
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    26
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    27
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    28
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    29
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    31
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    32
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    33
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    34
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    35
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    36
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    37
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    38
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    39
    a View which arranges its child-views in a vertical column.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    40
    All real work is done in PanelView - except the layout computation is
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    41
    redefined here.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
    42
127
claus
parents: 125
diff changeset
    43
    The layout is controlled by the instance variables: 
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    44
	horizontalLayout and verticalLayout
127
claus
parents: 125
diff changeset
    45
    in addition to 
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    46
	horizontalSpace and verticalSpace.
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
    47
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    48
    The vertical layout can be any of:
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    49
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    50
	#top            arrange elements at the top
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    51
	#topSpace       arrange elements at the top, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    52
	#bottom         arrange elements at the bottom
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    53
	#bottomSpace    arrange elements at the bottom, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    54
	#center         arrange elements in the center; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    55
	#spread         spread elements evenly; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    56
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    57
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    58
	#fitSpace       like #fit, with spacing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    59
	#topFit         like #top, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    60
	#topSpaceFit    like #topSpace, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    61
	#bottomFit      like #bottom, but resize the first element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    62
	#bottomSpaceFit like #bottomSpace, but resize the first element to fit
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    64
    the horizontal layout can be:
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    65
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    66
	#left           place element at the left
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    67
	#leftSpace      place element at the left, offset by horizontalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    68
	#center         place elements horizontally centered; ignore horizontalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    69
	#right          place it at the right
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    70
	#rightSpace     place it at the right, offset by horizontalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    71
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    72
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
127
claus
parents: 125
diff changeset
    73
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    74
	#leftMax        like #left, but resize elements to max of them
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    75
	#leftSpaceMax   like #leftSpace, but resize elements
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    76
	#centerMax      like #center, but resize elements
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    77
	#rightMax       like #right, but resize elements to max of them
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
    78
	#rightSpaceMax  like #rightSpace, but resize elements
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    79
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
    80
    The defaults is #center for both directions.
127
claus
parents: 125
diff changeset
    81
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    82
    The layout is changed by the messages #verticalLayout: and #horizontalLayout:.
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    83
    For backward compatibility (to times, where only vLayout existed), the simple
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
    84
    #layout: does the same as #verticalLayout:. Do not use this old method.
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
    85
127
claus
parents: 125
diff changeset
    86
    The panel assumes, that the elements do not resize themselfes, after it
claus
parents: 125
diff changeset
    87
    became visible. This is not true for all widgets (buttons or labels may
claus
parents: 125
diff changeset
    88
    like to change). If you have changing elements, tell this to the panel
claus
parents: 125
diff changeset
    89
    with 'aPanel elementsChangeSize:true'. In that case, the panel will react
claus
parents: 125
diff changeset
    90
    to size changes, and reorganize things.
claus
parents: 125
diff changeset
    91
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
    92
    If none of these layout/space combinations is exactly what you need in
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
    93
    your application, create a subclass, and redefine the setChildPositions method.
127
claus
parents: 125
diff changeset
    94
claus
parents: 125
diff changeset
    95
    CAVEAT: this class started with #top and no horizontal alignments;
claus
parents: 125
diff changeset
    96
    as time went by, more layouts were added and the setup should be changed
claus
parents: 125
diff changeset
    97
    to use different selectors for space, max-resize and alignment
claus
parents: 125
diff changeset
    98
    (i.e. having more and more layout symbols makes things a bit confusing ...)
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
    99
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   100
    [see also:]
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   101
	HorizontalPanelView
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   102
	VariableVerticalPanel VariableHorizontalPanel
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   103
	Label
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   104
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   105
    [author:]
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   106
	Claus Gittinger
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   107
"
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   108
!
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   109
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   110
examples
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   111
"
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   112
    These examples demonstrate the effect of different layout
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   113
    settings.
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   114
    You should try more examples, combining spacing and different
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   115
    verticalLayout:/horizontalLayout: combinations.
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   116
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   117
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   118
    example: default layout (centered)
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   119
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   120
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   121
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   122
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   123
	v label:'center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   124
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   125
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   126
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   127
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   128
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   129
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   130
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   131
									[exEnd]
127
claus
parents: 125
diff changeset
   132
claus
parents: 125
diff changeset
   133
claus
parents: 125
diff changeset
   134
    example: horizontal centerMax
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   135
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   136
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   137
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   138
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   139
	v label:'hL=centerMax'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   140
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   141
	p horizontalLayout:#centerMax.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   142
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   143
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   144
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   145
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   146
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   147
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   148
									[exEnd]
127
claus
parents: 125
diff changeset
   149
claus
parents: 125
diff changeset
   150
claus
parents: 125
diff changeset
   151
    example: horizontal leftMax
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   152
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   153
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   154
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   155
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   156
	v label:'hL=leftMax'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   157
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   158
	p horizontalLayout:#leftMax.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   159
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   160
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   161
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   162
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   163
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   164
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   165
									[exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   166
127
claus
parents: 125
diff changeset
   167
    example: horizontal leftSpaceMax
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   168
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   169
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   170
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   171
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   172
	v label:'hL=leftMax'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   173
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   174
	p horizontalLayout:#leftSpaceMax.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   175
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   176
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   177
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   178
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   179
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   180
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   181
									[exEnd]
127
claus
parents: 125
diff changeset
   182
claus
parents: 125
diff changeset
   183
    example: horizontal rightMax
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   184
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   185
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   186
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   187
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   188
	v label:'hL=rightMax'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   189
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   190
	p horizontalLayout:#rightMax.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   191
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   192
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   193
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   194
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   195
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   196
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   197
									[exEnd]
127
claus
parents: 125
diff changeset
   198
claus
parents: 125
diff changeset
   199
    example: horizontal rightSpaceMax
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   200
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   201
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   202
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   203
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   204
	v label:'hL=rightMaxSpace'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   205
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   206
	p horizontalLayout:#rightSpaceMax.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   207
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   208
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   209
	b2 := Button label:'b2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   210
	b3 := Button label:'butt3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   211
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   212
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   213
									[exEnd]
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   214
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   215
    example: top-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   216
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   217
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   218
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   219
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   220
	v label:'vL=top; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   221
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   222
	p verticalLayout:#top.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   223
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   224
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   225
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   226
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   227
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   228
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   229
									[exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   230
127
claus
parents: 125
diff changeset
   231
    example: topSpace-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   232
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   233
	|v p b1 b2 b3|
127
claus
parents: 125
diff changeset
   234
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   235
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   236
	v label:'vL=topSpace; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   237
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   238
	p verticalLayout:#topSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   239
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   240
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   241
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   242
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   243
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   244
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   245
									[exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   246
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   247
    example: top-layout; horizontal fit
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   248
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   249
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   250
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   251
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   252
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   253
	v label:'vL=top; hL=fit'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   254
	p verticalLayout:#top.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   255
	p horizontalLayout:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   256
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   257
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   258
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   259
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   260
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   261
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   262
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   263
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   264
    example: top-layout; horizontal fit with space
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   265
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   266
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   267
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   268
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   269
	v label:'vL=top; hL=fitSpace'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   270
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   271
	p verticalLayout:#top.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   272
	p horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   273
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   274
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   275
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   276
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   277
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   278
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   279
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   280
127
claus
parents: 125
diff changeset
   281
    example: topSpace-layout; horizontal fit with space
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   282
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   283
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   284
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   285
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   286
	v label:'vL=topSpace; hL=fitSpace'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   287
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   288
	p verticalLayout:#topSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   289
	p horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   290
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   291
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   292
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   293
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   294
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   295
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   296
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   297
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   298
    example: bottom-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   299
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   300
	|v p b1 b2 b3|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   301
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   302
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   303
	v label:'vL=bottom; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   304
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   305
	p verticalLayout:#bottom.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   306
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   307
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   308
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   309
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   310
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   311
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   312
									[exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   313
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   314
    example: bottomSpace-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   315
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   316
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   317
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   318
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   319
	v label:'vL=bottomSpace; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   320
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   321
	p verticalLayout:#bottomSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   322
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   323
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   324
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   325
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   326
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   327
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   328
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   329
133
claus
parents: 131
diff changeset
   330
    example: topFit-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   331
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   332
	|v p b1 b2 b3|
133
claus
parents: 131
diff changeset
   333
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   334
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   335
	v label:'vL=topFit; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   336
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   337
	p verticalLayout:#topFit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   338
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   339
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   340
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   341
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   342
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   343
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   344
									[exEnd]
133
claus
parents: 131
diff changeset
   345
claus
parents: 131
diff changeset
   346
    example: topSpaceFit-layout; combined with horizontal #fitSpace
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   347
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   348
	|v p b1 b2 b3|
133
claus
parents: 131
diff changeset
   349
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   350
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   351
	v label:'vL=topFit; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   352
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   353
	p verticalLayout:#topSpaceFit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   354
	p horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   355
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   356
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   357
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   358
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   359
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   360
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   361
									[exEnd]
133
claus
parents: 131
diff changeset
   362
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   363
    example: bottomFit-layout (arrange at bottom; resize first to fit)
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   364
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   365
	|v p b1 b2 b3|
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   366
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   367
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   368
	v label:'vL=bottomFit; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   369
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   370
	p verticalLayout:#bottomFit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   371
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   372
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   373
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   374
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   375
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   376
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   377
									[exEnd]
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   378
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   379
    example: bottomSpaceFit-layout (arrange at bottom; resize first to fit; with spacing
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   380
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   381
	|v p b1 b2 b3|
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   382
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   383
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   384
	v label:'vL=bottomSpaceFit; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   385
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   386
	p verticalLayout:#bottomSpaceFit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   387
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   388
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   389
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   390
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   391
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   392
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   393
									[exEnd]
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   394
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   395
    example: spread-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   396
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   397
	|v p b1 b2 b3|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 5
diff changeset
   398
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   399
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   400
	v label:'vL=spread; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   401
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   402
	p verticalLayout:#spread.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   403
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   404
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   405
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   406
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   407
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   408
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   409
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   410
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   411
    example: spreadSpace-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   412
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   413
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   414
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   415
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   416
	v label:'vL=spreadSpace; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   417
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   418
	p verticalLayout:#spreadSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   419
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   420
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   421
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   422
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   423
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   424
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   425
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   426
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   427
    example: fit-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   428
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   429
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   430
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   431
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   432
	v label:'vL=fit; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   433
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   434
	p verticalLayout:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   435
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   436
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   437
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   438
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   439
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   440
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   441
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   442
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   443
    example: fitSpace-layout
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   444
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   445
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   446
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   447
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   448
	v label:'vL=fitSpace; hL=center (default)'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   449
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   450
	p verticalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   451
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   452
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   453
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   454
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   455
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   456
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   457
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   458
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   459
    example: fully fitSpace
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   460
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   461
	|v p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   462
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   463
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   464
	v label:'vL=fitSpace; hL=fitSpace'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   465
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   466
	p verticalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   467
	p horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   468
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   469
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   470
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   471
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   472
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   473
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   474
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   475
131
claus
parents: 130
diff changeset
   476
    example: combine fully fitSpace with scaling button labels
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   477
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   478
	|v p b1 b2 b3|
131
claus
parents: 130
diff changeset
   479
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   480
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   481
	v label:'vL=fitSpace; hL=fitSpace'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   482
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   483
	p verticalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   484
	p horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   485
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   486
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   487
	b1 adjust:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   488
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   489
	b2 adjust:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   490
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   491
	b3 adjust:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   492
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   493
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   494
									[exEnd]
131
claus
parents: 130
diff changeset
   495
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   496
    example: from top, each at left:
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   497
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   498
	|v p b1 b2 b3|
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   499
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   500
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   501
	v label:'vL=top; hL=left'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   502
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   503
	p verticalLayout:#top.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   504
	p horizontalLayout:#left.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   505
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   506
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   507
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   508
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   509
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   510
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   511
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   512
127
claus
parents: 125
diff changeset
   513
    example: center, right:
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   514
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   515
	|v p b1 b2 b3|
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   516
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   517
	v := StandardSystemView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   518
	v label:'vL=center; hL=right'.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   519
	p := VerticalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   520
	p verticalLayout:#center.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   521
	p horizontalLayout:#right.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   522
	p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   523
	b1 := Button label:'button1' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   524
	b2 := Button label:'butt2' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   525
	b3 := Button label:'button3' in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   526
	v extent:100 @ 300.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   527
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   528
									[exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   529
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   530
    example: a panel in a panel
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   531
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   532
	|v hp p b1 b2 b3|
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   533
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   534
	v := StandardSystemView new.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   535
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   536
	hp := HorizontalPanelView in:v.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   537
	hp verticalLayout:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   538
	hp horizontalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   539
	hp origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   540
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   541
	1 to:3 do:[:i |
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   542
	    p := VerticalPanelView in:hp.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   543
	    p borderWidth:0.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   544
	    p verticalLayout:#fitSpace.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   545
	    p horizontalLayout:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   546
	    b1 := Button label:('button1-' , i printString) in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   547
	    b2 := Button label:('butt2-' , i printString) in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   548
	    b3 := Button label:('button3-' , i printString) in:p.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   549
	].
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   550
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   551
	v extent:300 @ 100.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   552
	v open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   553
									[exEnd]
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   554
125
claus
parents: 77
diff changeset
   555
    example: checkToggles in a panel
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   556
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   557
	|panel|
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   558
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   559
	panel := VerticalPanelView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   560
	panel horizontalLayout:#left.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   561
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   562
	panel add:((CheckBox on:true asValue) label:'this is toggle number 1'; resize).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   563
	panel add:((CheckBox on:false asValue) label:'nr 2 '; resize).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   564
	panel add:((CheckBox on:true asValue) label:'number 3 '; resize).
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   565
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   566
	panel extent:(panel preferredExtent).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   567
	panel open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   568
									[exEnd]
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   569
    example: the topFit & bottomFit layouts are great to combine
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   570
	     labels or enterFields with a selectionInList or textView:
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   571
									[exBegin]
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   572
	|panel|
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   573
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   574
	panel := VerticalPanelView new.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   575
	panel horizontalLayout:#fit.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   576
	panel verticalLayout:#topFit.
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   577
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   578
	panel add:(Label new label:'this is label number 1'; font:(Font family:'courier' size:16)).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   579
	panel add:(EditField new).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   580
	panel add:(Label new label:'this is label number 1').
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   581
	panel add:(ScrollableView for:SelectionInListView).
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   582
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   583
	panel extent:(panel preferredExtent).
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   584
	panel open
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   585
									[exEnd]
125
claus
parents: 77
diff changeset
   586
"
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   587
! !
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   588
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   589
!VerticalPanelView methodsFor:'accessing'!
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   590
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   591
horizontalLayout
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   592
    "return the horizontal layout as symbol.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   593
     the returned value is one of
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   594
	#left           place element at the left
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   595
	#leftSpace      place element at the left, offset by horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   596
	#center         place elements horizontally centered; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   597
	#right          place it at the right
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   598
	#rightSpace     place it at the right, offset by horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   599
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   600
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   601
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   602
	#leftMax        like #left, but resize elements to max of them
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   603
	#leftSpaceMax   like #leftSpace, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   604
	#centerMax      like #center, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   605
	#rightMax       like #right, but resize elements to max of them
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   606
	#rightSpaceMax  like #rightSpace, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   607
      the default is #centered
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   608
    "
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   609
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   610
    ^ hLayout
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   611
!
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   612
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   613
horizontalLayout:aSymbol
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   614
    "change the horizontal layout as symbol.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   615
     The argument, aSymbol must be one of:
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   616
	#left           place element at the left
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   617
	#leftSpace      place element at the left, offset by horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   618
	#center         place elements horizontally centered; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   619
	#right          place it at the right
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   620
	#rightSpace     place it at the right, offset by horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   621
	#fit            resize elements horizontally to fit this panel; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   622
	#fitSpace       like #fit, but add spacing; ignore horizontalSpace
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   623
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   624
	#leftMax        like #left, but resize elements to max of them
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   625
	#leftSpaceMax   like #leftSpace, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   626
	#centerMax      like #center, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   627
	#rightMax       like #right, but resize elements to max of them
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   628
	#rightSpaceMax  like #rightSpace, but resize elements
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   629
      the default (if never changed) is #centered
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   630
    "
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   631
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   632
    (hLayout ~~ aSymbol) ifTrue:[
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   633
	hLayout := aSymbol.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   634
	self layoutChanged
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   635
    ]
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   636
!
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   637
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   638
layout:something
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   639
    "OBSOLETE compatibility interface. Will vanish.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   640
     leftover for historic reasons - do not use any more.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   641
     In the meantime, try to figure out what is meant ... a kludge"
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   642
2370
d118a160afbe Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 2305
diff changeset
   643
    <resource:#obsolete>
d118a160afbe Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 2305
diff changeset
   644
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   645
    something isLayout ifTrue:[^ super layout:something].
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   646
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   647
    self obsoleteMethodWarning:'use #verticalLayout:'.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   648
    ^ self verticalLayout:something
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   649
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   650
    "Modified: 31.8.1995 / 23:08:54 / claus"
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   651
!
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   652
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   653
verticalLayout
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   654
    "return the vertical layout as a symbol.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   655
     the returned value is one of
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   656
	#top            arrange elements at the top
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   657
	#topSpace       arrange elements at the top, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   658
	#bottom         arrange elements at the bottom
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   659
	#bottomSpace    arrange elements at the bottom, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   660
	#center         arrange elements in the center; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   661
	#spread         spread elements evenly; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   662
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   663
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   664
	#fitSpace       like #fit, with spacing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   665
	#topFit         like #top, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   666
	#topSpaceFit    like #topSpace, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   667
	#bottomFit      like #bottom, but resize the first element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   668
	#bottomSpaceFit like #bottomSpace, but extend the first element to fit
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   669
      the default is #centered
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   670
    "
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   671
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   672
    ^ vLayout
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   673
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   674
    "Modified: 17.8.1997 / 15:20:13 / cg"
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   675
!
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   676
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   677
verticalLayout:aSymbol
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   678
    "change the vertical layout as a symbol.
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   679
     The argument, aSymbol must be one of:
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   680
	#top            arrange elements at the top
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   681
	#topSpace       arrange elements at the top, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   682
	#bottom         arrange elements at the bottom
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   683
	#bottomSpace    arrange elements at the bottom, start with spacing
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   684
	#center         arrange elements in the center; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   685
	#spread         spread elements evenly; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   686
	#spreadSpace    spread elements evenly with spacing at ends; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   687
	#fit            like #spread, but resize elements for tight packing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   688
	#fitSpace       like #fit, with spacing; ignore verticalSpace
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   689
	#topFit         like #top, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   690
	#topSpaceFit    like #topSpace, but resize the last element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   691
	#bottomFit      like #bottom, but resize the first element to fit
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   692
	#bottomSpaceFit like #bottomSpace, but extend the first element to fit
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   693
      the default (if never changed) is #centered
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   694
    "
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   695
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   696
    (vLayout ~~ aSymbol) ifTrue:[
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   697
	vLayout := aSymbol.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   698
	self layoutChanged
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   699
    ]
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   700
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   701
    "Modified: 17.8.1997 / 15:19:58 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   702
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   703
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   704
!VerticalPanelView methodsFor:'layout'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   705
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   706
setChildPositions
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   707
    "(re)compute position of every child"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   708
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   709
    |ypos space sumOfHeights numChilds l hEach hInside hL vL
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   710
     maxWidth maxHeight resizeToMaxV resizeToMaxH m2 subViews ext restHeight|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   711
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   712
    subViews := self subViewsToConsider.
1042
5914ecc423e1 care for sizing with no subviews;
ca
parents: 1038
diff changeset
   713
    subViews size == 0 ifTrue:[^ self].
5914ecc423e1 care for sizing with no subviews;
ca
parents: 1038
diff changeset
   714
3502
5dd1d5b01e4d changed #setChildPositions
ca
parents: 3118
diff changeset
   715
"/    self extentChangedFlag ifTrue:[
5dd1d5b01e4d changed #setChildPositions
ca
parents: 3118
diff changeset
   716
"/        ext := self computeExtent.
5dd1d5b01e4d changed #setChildPositions
ca
parents: 3118
diff changeset
   717
"/        width := ext x.
5dd1d5b01e4d changed #setChildPositions
ca
parents: 3118
diff changeset
   718
"/        height := ext y.
5dd1d5b01e4d changed #setChildPositions
ca
parents: 3118
diff changeset
   719
"/    ].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   720
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   721
    space := verticalSpace.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   722
    numChilds := subViews size.
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   723
380
6eb402d01ae0 looks better if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
   724
    m2 := margin * 2.
6eb402d01ae0 looks better if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
   725
    hInside := height - m2 + (borderWidth*2) - subViews last borderWidth.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   726
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   727
    hL := hLayout.
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   728
    vL := vLayout.
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   729
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   730
    resizeToMaxV := false.
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   731
    (vL endsWith:'Max') ifTrue:[
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   732
        resizeToMaxV := true.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   733
        hEach := maxHeight := subViews inject:0 into:[:maxSoFar :child | maxSoFar max:child heightIncludingBorder].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   734
        vL := (vL copyWithoutLast:3) asSymbol.
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   735
    ].
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   736
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   737
    numChilds == 1 ifTrue:[
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   738
        (vL == #topFit or:[vL == #bottomFit]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   739
            vL := #fit
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   740
        ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   741
        (vL == #topSpaceFit or:[vL == #bottomSpaceFit]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   742
            vL := #fitSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   743
        ].
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   744
    ].
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   745
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   746
    vL == #fitSpace ifTrue:[
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   747
        "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   748
         adjust childs extents and set origins.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   749
         Be careful to avoid accumulation of rounding errors
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   750
        "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   751
        hEach := (hInside - (numChilds + 1 * space)) / numChilds.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   752
        ypos := space + margin - borderWidth.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   753
    ] ifFalse:[
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   754
        vL == #fit ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   755
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   756
             adjust childs extents and set origins.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   757
             Be careful to avoid accumulation of rounding errors
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   758
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   759
            hEach := (hInside - (numChilds - 1 * space)) / numChilds.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   760
            ypos := margin - borderWidth.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   761
        ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   762
            l := vL.
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   763
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   764
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   765
             compute net height needed
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   766
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   767
            resizeToMaxV ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   768
                sumOfHeights := subViews inject:0 into:[:sumSoFar :child | sumSoFar + maxHeight + (child borderWidth*2)].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   769
            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   770
                sumOfHeights := subViews inject:0 into:[:sumSoFar :child | sumSoFar + child heightIncludingBorder].
2031
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   771
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   772
                "/ adjust - do not include height of last(first) element if doing a fit
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   773
                (vL == #topFit or:[vL == #topSpaceFit]) ifTrue:[
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   774
                    sumOfHeights := sumOfHeights - subViews last heightIncludingBorder.
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   775
                ] ifFalse:[
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   776
                    (vL == #bottomFit or:[vL == #bottomSpaceFit]) ifTrue:[
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   777
                        sumOfHeights := sumOfHeights - subViews first heightIncludingBorder.
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   778
                    ]
6f28b9951713 oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   779
                ].
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   780
            ].
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   781
3504
2395db2daa9e setChildPositions fix with bottomFit
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
   782
            restHeight := height - sumOfHeights - (numChilds-1*space).
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   783
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   784
            ((l == #center) and:[numChilds == 1]) ifTrue:[l := #spread].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   785
            (l == #spread and:[numChilds == 1]) ifTrue:[l := #spreadSpace].
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   786
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   787
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   788
             compute position of topmost subview and space between them;
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   789
             if they do hardly fit, leave no space between them 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   790
            "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   791
            ((sumOfHeights >= (height - m2))
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   792
            and:[l ~~ #fixTopSpace and:[l ~~ #fixTop]]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   793
                "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   794
                 if we have not enough space for all the elements, 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   795
                 fill them tight, and show what can be shown (at least)
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   796
                "
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   797
                ypos := margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   798
                space := 0
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   799
            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   800
                l == #fixTopSpace ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   801
                    l := #topSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   802
                ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   803
                    l == #fixTop ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   804
                        l := #top 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   805
                    ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   806
                ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   807
                ((l == #bottom) or:[l == #bottomSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   808
                or:[l == #bottomFit or:[l == #bottomSpaceFit]]]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   809
                    ypos := restHeight - (space * (numChilds - 1)).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   810
"/
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   811
"/                    borderWidth == 0 ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   812
"/                        ypos := ypos + space 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   813
"/                    ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   814
"/           
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   815
                    (l == #bottomSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   816
                    or:[l == #bottomSpaceFit]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   817
                        ypos >= space ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   818
                            ypos := ypos - space
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   819
                        ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   820
                    ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   821
                    ypos := ypos - margin.
77
565b052f5277 *** empty log message ***
claus
parents: 65
diff changeset
   822
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   823
                    ypos < 0 ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   824
                        space := space min:(restHeight // (numChilds + 1)).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   825
                        ypos := restHeight - (space * numChilds).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   826
                    ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   827
                ] ifFalse: [
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   828
                    (l == #spread) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   829
                        space := (restHeight - m2) // (numChilds - 1).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   830
                        ypos := margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   831
                        (space == 0) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   832
                            ypos := restHeight // 2
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   833
                        ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   834
                    ] ifFalse: [
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   835
                      (l == #spreadSpace) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   836
                        space := (restHeight - m2) // (numChilds + 1).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   837
                        ypos := space + margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   838
                        (space == 0) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   839
                            ypos := restHeight // 2
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   840
                        ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   841
                      ] ifFalse: [
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   842
                        ((l == #top) or:[l == #topSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   843
                        or:[l == #topFit or:[l == #topSpaceFit]]]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   844
                            space := space min:(restHeight - m2) // (numChilds + 1).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   845
                            (vL == #fixTop or:[vL == #fixTopSpace]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   846
                                space := space max:verticalSpace.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   847
                            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   848
                                space := space max:0.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   849
                            ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   850
                            (l == #topSpace or:[l == #topSpaceFit]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   851
                                ypos := space + margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   852
                            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   853
                                "/
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   854
                                "/ if the very first view has a 0-level AND
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   855
                                "/ my level is non-zero, begin with margin
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   856
                                "/
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   857
                                true "(margin ~~ 0 and:[subViews first level == 0])" ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   858
                                    ypos := margin
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   859
                                ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   860
                                    ypos := 0
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   861
                                ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   862
                            ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   863
                        ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   864
                            "center"
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   865
                            ypos := (restHeight - ((numChilds - 1) * space)) // 2.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   866
                            ypos < 0 ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   867
                                space := restHeight // (numChilds + 1).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   868
                                ypos := (restHeight - ((numChilds - 1) * space)) // 2.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   869
                            ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   870
                        ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   871
                      ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   872
                    ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   873
                ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   874
            ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   875
        ].
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   876
    ].
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   877
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   878
    resizeToMaxH := false.
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   879
    (hL endsWith:'Max') ifTrue:[
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   880
        resizeToMaxH := true.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   881
        maxWidth := subViews inject:0 into:[:maxSoFar :child | maxSoFar max:child widthIncludingBorder].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   882
        hL := (hL copyWithoutLast:3) asSymbol.
127
claus
parents: 125
diff changeset
   883
    ].
claus
parents: 125
diff changeset
   884
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   885
    "
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   886
     now set positions
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   887
    "
133
claus
parents: 131
diff changeset
   888
    subViews keysAndValuesDo:[:index :child |
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   889
        |xpos advance bwChild wChild newWChild x2|
125
claus
parents: 77
diff changeset
   890
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   891
        wChild := child widthIncludingBorder.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   892
        bwChild := child borderWidth.
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   893
3118
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   894
        elementsChangeSize ifTrue:[
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   895
            "to avoid a recursion when we change the elements size"
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   896
            child removeDependent:self.
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   897
        ].
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   898
        resizeToMaxH ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   899
            child width:(wChild := maxWidth - (bwChild  * 2)).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   900
        ].
127
claus
parents: 125
diff changeset
   901
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   902
        hL == #left ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   903
            xpos := 0 - borderWidth + margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   904
        ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   905
            hL == #leftSpace ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   906
                xpos := horizontalSpace + margin
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   907
            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   908
                hL == #right ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   909
                    xpos := width - wChild - margin
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   910
                ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   911
                    hL == #rightSpace ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   912
                        xpos := width - horizontalSpace - wChild - margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   913
                    ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   914
                        hL == #fitSpace ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   915
                            xpos := horizontalSpace + margin.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   916
                            newWChild := width - m2 - (horizontalSpace + bwChild * 2)
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   917
                        ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   918
                            hL == #fit ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   919
                                newWChild := width "- (bwChild * 2)".
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   920
                                borderWidth == 0 ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   921
                                    newWChild :=  newWChild - (bwChild * 2)
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   922
                                ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   923
                                true "child level == 0" ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   924
                                    xpos := margin - borderWidth.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   925
                                    newWChild := newWChild - m2
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   926
                                ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   927
                                    xpos := 0 - borderWidth. 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   928
                                ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   929
                            ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   930
                                "centered"
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   931
                                 xpos := margin + ((width - m2 - wChild) // 2).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   932
                            ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   933
                        ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   934
                    ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   935
                ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   936
            ]
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   937
        ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   938
        newWChild notNil ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   939
            child width:newWChild
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   940
        ].
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 59
diff changeset
   941
793
12396da0e36e care for borderWidths
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   942
"/        (xpos < 0) ifTrue:[ xpos := 0 ].
12396da0e36e care for borderWidths
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   943
2033
fc16e79f649b size computation with bordered components
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   944
        x2 := xpos + child width - 1.
380
6eb402d01ae0 looks better if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
   945
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   946
        (vL == #fit 
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   947
        or:[vL == #fitSpace
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   948
        or:[resizeToMaxV]]) ifTrue:[
2033
fc16e79f649b size computation with bordered components
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   949
            child origin:(xpos @ (ypos rounded))
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   950
                  corner:(x2 @ (ypos + hEach - bwChild - 1) rounded).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   951
            advance := hEach
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   952
        ] ifFalse:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   953
            child origin:(xpos@ypos).
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   954
            advance := child heightIncludingBorder
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   955
        ].
133
claus
parents: 131
diff changeset
   956
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   957
        index == numChilds ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   958
            |y|
133
claus
parents: 131
diff changeset
   959
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   960
            (vL == #topFit or:[vL == #topSpaceFit]) ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   961
                y := height - margin - 1.
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   962
                vL == #topSpaceFit ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   963
                    y := y - space
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   964
                ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   965
                child corner:x2 @ y
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   966
            ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   967
        ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   968
        index == 1 ifTrue:[
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   969
            (vL == #bottomFit or:[vL == #bottomSpaceFit]) ifTrue:[
3118
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   970
                ypos := margin + 0 + (child borderWidth * 2) - borderWidth.
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   971
                vL == #bottomSpaceFit ifTrue:[
3118
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   972
                    ypos := ypos + space
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   973
                ].
3118
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   974
                advance := restHeight.
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   975
                child origin:((child origin x) @ ypos)
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   976
                      corner:((child corner x) @ (ypos+advance))
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   977
            ].
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   978
        ].
1307
f2ce08878d5e added #bottomFit & #bottomSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents: 1291
diff changeset
   979
1431
fd1e74d673ae really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   980
        ypos := ypos + advance + space.
3118
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   981
        elementsChangeSize ifTrue:[
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   982
            "reinstall dependency that we removed above"
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   983
            child addDependent:self.
996b7fc6dee7 1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents: 2387
diff changeset
   984
        ].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   985
    ]
155
claus
parents: 133
diff changeset
   986
3504
2395db2daa9e setChildPositions fix with bottomFit
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
   987
    "Modified: / 04-09-1995 / 18:43:29 / claus"
2395db2daa9e setChildPositions fix with bottomFit
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
   988
    "Modified: / 10-10-2007 / 13:47:56 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   989
! !
125
claus
parents: 77
diff changeset
   990
claus
parents: 77
diff changeset
   991
!VerticalPanelView methodsFor:'queries'!
claus
parents: 77
diff changeset
   992
130
claus
parents: 127
diff changeset
   993
preferredExtent
125
claus
parents: 77
diff changeset
   994
    "return a good extent, one that makes subviews fit"
claus
parents: 77
diff changeset
   995
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   996
    |sumOfHeights maxWidth maxHeight m2 subViews|
125
claus
parents: 77
diff changeset
   997
797
2f9cd56f48ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 793
diff changeset
   998
    "/ If I have an explicit preferredExtent ..
2f9cd56f48ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 793
diff changeset
   999
713
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1000
    preferredExtent notNil ifTrue:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1001
        ^ preferredExtent
713
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1002
    ].
0c38ad51016d care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1003
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1004
    subViews := self subViewsToConsider.
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1005
    (subViews size == 0) ifTrue:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1006
        ^ super preferredExtent.
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1007
        "/ ^ horizontalSpace @ verticalSpace].
1038
c6d8eb89d260 useful preferredExtent if no subviews.
ca
parents: 1000
diff changeset
  1008
    ].
c6d8eb89d260 useful preferredExtent if no subviews.
ca
parents: 1000
diff changeset
  1009
125
claus
parents: 77
diff changeset
  1010
claus
parents: 77
diff changeset
  1011
    "compute net height needed"
claus
parents: 77
diff changeset
  1012
claus
parents: 77
diff changeset
  1013
    sumOfHeights := 0.
claus
parents: 77
diff changeset
  1014
    maxWidth := 0.
claus
parents: 77
diff changeset
  1015
    maxHeight := 0.
claus
parents: 77
diff changeset
  1016
claus
parents: 77
diff changeset
  1017
    subViews do:[:child |
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1018
        |childsPreference|
125
claus
parents: 77
diff changeset
  1019
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1020
        childsPreference := child preferredExtent.
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1021
        sumOfHeights := sumOfHeights + childsPreference y.
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1022
        maxHeight := maxHeight max:childsPreference y.
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1023
        maxWidth := maxWidth max:childsPreference x.
125
claus
parents: 77
diff changeset
  1024
claus
parents: 77
diff changeset
  1025
"/        sumOfHeights := sumOfHeights + child heightIncludingBorder.
claus
parents: 77
diff changeset
  1026
"/        maxWidth := maxWidth max:(child widthIncludingBorder).
claus
parents: 77
diff changeset
  1027
"/        maxHeight := maxHeight max:(child heightIncludingBorder).
claus
parents: 77
diff changeset
  1028
    ].
321
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1029
125
claus
parents: 77
diff changeset
  1030
    borderWidth ~~ 0 ifTrue:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1031
        sumOfHeights := sumOfHeights + (verticalSpace * 2).
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1032
        maxWidth := maxWidth + (horizontalSpace * 2).
125
claus
parents: 77
diff changeset
  1033
    ].
321
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1034
125
claus
parents: 77
diff changeset
  1035
    (vLayout == #fit or:[vLayout == #fitSpace]) ifTrue:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1036
        sumOfHeights := maxHeight * subViews size.
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1037
        borderWidth ~~ 0 ifTrue:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1038
            sumOfHeights := sumOfHeights + (verticalSpace * 2).
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1039
        ].
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1040
        vLayout == #fitSpace ifTrue:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1041
            "/ care for spacing ...
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1042
            sumOfHeights := sumOfHeights + (verticalSpace * (subViews size + 1)).
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1043
        ].
125
claus
parents: 77
diff changeset
  1044
    ] ifFalse:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1045
        sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1046
        ((vLayout == #topSpace) or:[vLayout == #bottomSpace]) ifTrue:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1047
            sumOfHeights := sumOfHeights + verticalSpace
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1048
        ] ifFalse:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1049
            ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1050
                sumOfHeights := sumOfHeights + (verticalSpace * 2)
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1051
            ]
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1052
        ].
125
claus
parents: 77
diff changeset
  1053
    ].
claus
parents: 77
diff changeset
  1054
claus
parents: 77
diff changeset
  1055
    ((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1056
        maxWidth := maxWidth + horizontalSpace
125
claus
parents: 77
diff changeset
  1057
    ] ifFalse:[
2387
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1058
        ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1059
            maxWidth := maxWidth + (horizontalSpace * 2)
c589e85a4f43 prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  1060
        ]        
125
claus
parents: 77
diff changeset
  1061
    ].
380
6eb402d01ae0 looks better if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
  1062
    m2 := margin * 2.
6eb402d01ae0 looks better if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents: 341
diff changeset
  1063
    ^ (maxWidth + m2) @ (sumOfHeights + m2)
321
00c17944cb00 preferredExtent computation used hSpace instead of vSpace
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
  1064
1417
e9dffd6767a6 added ignoreInvisibleComponents support
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1065
    "Modified: / 17.1.1998 / 00:18:16 / cg"
125
claus
parents: 77
diff changeset
  1066
! !
claus
parents: 77
diff changeset
  1067
980
6079922a5519 eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
  1068
!VerticalPanelView class methodsFor:'documentation'!
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
  1069
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
  1070
version
3504
2395db2daa9e setChildPositions fix with bottomFit
Claus Gittinger <cg@exept.de>
parents: 3502
diff changeset
  1071
    ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.42 2007-10-10 11:48:48 cg Exp $'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
  1072
! !