-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathSpBoxLayoutAlignmentExample.class.st
71 lines (61 loc) · 1.71 KB
/
SpBoxLayoutAlignmentExample.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Class {
#name : 'SpBoxLayoutAlignmentExample',
#superclass : 'SpPresenter',
#category : 'Spec2-Examples-Demo-Layouts',
#package : 'Spec2-Examples',
#tag : 'Demo-Layouts'
}
{ #category : 'initialization' }
SpBoxLayoutAlignmentExample >> initializePresenters [
<script: 'self new openWithSpec'>
| pages |
layout := SpBoxLayout newTopToBottom
add: (pages := self newNotebook);
yourself.
pages
addPageTitle: 'Horizontal'
provider: [
SpPresenter new
layout: self newHorizontalAlignmentLayout;
yourself ].
pages
addPageTitle: 'Vertical'
provider: [
SpPresenter new
layout: self newVerticalAlignmentLayout;
yourself ]
]
{ #category : 'initialization' }
SpBoxLayoutAlignmentExample >> newHorizontalAlignmentLayout [
^ SpBoxLayout newTopToBottom
add: (SpBoxLayout newLeftToRight
hAlignStart;
add: (SpLabelPresenter new label: 'hAlignStart') expand: false;
yourself);
add: (SpBoxLayout newLeftToRight
hAlignCenter;
add: (SpLabelPresenter new label: 'hAlignCenter') expand: false;
yourself);
add: (SpBoxLayout newLeftToRight
hAlignEnd;
add: (SpLabelPresenter new label: 'hAlignEnd') expand: false;
yourself);
yourself
]
{ #category : 'initialization' }
SpBoxLayoutAlignmentExample >> newVerticalAlignmentLayout [
^ SpBoxLayout newLeftToRight
add: (SpBoxLayout newTopToBottom
vAlignStart;
add: (SpLabelPresenter new label: 'vAlignStart') expand: false;
yourself);
add: (SpBoxLayout newTopToBottom
vAlignCenter;
add: (SpLabelPresenter new label: 'vAlignCenter') expand: false;
yourself);
add: (SpBoxLayout newTopToBottom
vAlignEnd;
add: (SpLabelPresenter new label: 'vAlignEnd') expand: false;
yourself);
yourself
]