-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathOPDynamicFormExamples.class.st
More file actions
60 lines (57 loc) · 1.91 KB
/
OPDynamicFormExamples.class.st
File metadata and controls
60 lines (57 loc) · 1.91 KB
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
"
A bunch of examples demonstrating Form options.
"
Class {
#name : 'OPDynamicFormExamples',
#superclass : 'Object',
#category : 'OpenPonk-Spec-Form',
#package : 'OpenPonk-Spec',
#tag : 'Form'
}
{ #category : 'examples' }
OPDynamicFormExamples class >> exampleAllWidgets [
<gtexample>
| form window anOPDynamicFormExamples |
anOPDynamicFormExamples := self new.
form := OPDynamicForm new.
(form addButton: 'Click Me') action: [
anOPDynamicFormExamples inform: 'Yay!' ].
(form addCheckbox: 'Check Mate')
state: true;
whenChangedDo: [ :newValue |
anOPDynamicFormExamples inform: 'check mate: ' , newValue asString ].
(form addCheckbox: 'Not Even Check')
state: false;
whenChangedDo: [ :newValue |
anOPDynamicFormExamples inform: 'check: ' , newValue asString ].
(form addDroplist: 'With Icons')
items: #( announcement catalog class );
display: [ :each | each asString ];
displayIcon: [ :each :item |
anOPDynamicFormExamples iconNamed: each ];
selectItem: #catalog;
whenSelectionChangedDo: [ :newValue |
anOPDynamicFormExamples inform: 'icon: ' , newValue asString ].
(form addEditableDroplist: 'Editable')
items: #( abstract collection comments );
display: [ :each | each asString ];
selectItem: #collection;
whenSelectionChangedDo: [ :newValue |
anOPDynamicFormExamples inform:
'editable icon: ' , newValue asString ].
form addSeparator.
form addLabel: 'There''s a separator above me and below me'.
form addSeparator.
(form addText: 'Enter Some Text') text: 'poem required'.
(form addTextInput: 'Single Line With Ghost Text') placeholder:
'wooo!'.
(form addTextInput: 'Line Without Ghosts') text: 'no ghosts allowed'.
window := form open.
window extent: 400 @ 600.
form rebuildWidget.
^ anOPDynamicFormExamples
]
{ #category : 'examples' }
OPDynamicFormExamples >> exampleAllWidgets [
^ self class exampleAllWidgets
]