2
A DrGMacroMorph is an abstractact dialog to build and play macro.
4
- the user changes the page with the next and previous buttons
5
- the user press apply and cancel
8
pages: dictionary of pages Morph
16
#superclass : #DialogWindow,
22
#category : #'DrGeoII-Core-UI'
25
{ #category : #'as yet unclassified' }
26
DrGWizard class >> example [
27
"DrGWizard example openInWorld"
31
addPage: ((DrGWizardPage firstPage: 'Step 1/3') model: wizard);
32
addPage: ((DrGWizardPage standardPage: 'Step 2/3') model: wizard;
33
content: 'We can change content :
36
3. Three' asTextMorph);
37
addPage: ((DrGWizardPage applyPage: 'Step 3/3') model: wizard).
41
{ #category : #accessing }
42
DrGWizard >> addPage: aPage [
45
[self panel addMorph: aPage.
46
self title: aPage title.
50
{ #category : #callback }
52
self triggerEvent: #apply
55
{ #category : #callback }
57
self triggerEvent: #cancel
60
{ #category : #'meta-actions' }
63
pages do: [:page | page delete].
66
{ #category : #accessing }
67
DrGWizard >> goPage: integer [
68
" (contentMorph findA: DrGWizardPage) ifNotNilDo:
69
[:page | self removeMorph: page]."
70
self panel removeAllMorphs.
71
self panel addMorph: (self pageAt: integer).
72
self title: (self pageAt: integer) title.
73
self triggerEvent: #page with: integer.
76
{ #category : #initialization }
77
DrGWizard >> initialExtent [
78
^DrGDefault wizardExtent
81
{ #category : #initialization }
82
DrGWizard >> initialize [
84
pages := OrderedCollection new.
87
{ #category : #testing }
88
DrGWizard >> isResizeable [
92
{ #category : #actions }
93
DrGWizard >> newMainPanel [
97
{ #category : #callback }
99
currentPage < pages size ifFalse: [^ self].
100
self goPage: (currentPage := currentPage + 1)
103
{ #category : #accessing }
104
DrGWizard >> pageAt: integer [
108
{ #category : #initialization }
109
DrGWizard >> pageModel [
111
page := Morph new color: Color transparent .
113
layoutPolicy: TableLayout new;
114
listDirection: #bottomToTop;
115
cellPositioning: #topLeft;
121
{ #category : #actions }
123
^ panel ifNil: [ panel := self newDialogPanel]
126
{ #category : #callback }
127
DrGWizard >> previous [
128
currentPage > 1 ifFalse: [^self].
129
self goPage: (currentPage := currentPage - 1)