2
A DrGeoWindow is xxxxxxxxx.
10
numericToolbar: <Object>
11
pointToolbar: <Object>
14
transformationToolbar: <Object>
15
sideContainer: a row alignement morph
19
- holds in a row the drawing area and the toolbox to edit object attributes
54
#superclass : #StandardWindow,
64
#category : #'DrGeoII-Polymorph'
67
{ #category : #'initialize-release' }
68
DrGeoWindow class >> for: aDrGeo [
69
"A new model with an existing domain. For multiple MVP on a same
71
^ super basicNew app: aDrGeo;
75
{ #category : #accessing }
80
{ #category : #accessing }
81
DrGeoWindow >> app: aDrgeo [
85
{ #category : #accessing }
90
{ #category : #accessing }
91
DrGeoWindow >> controls [
92
^ self presenter controlsManager
95
{ #category : #'open/close' }
96
DrGeoWindow >> delete [
97
(app notNil and: [app isSaved not]) ifTrue: [
99
questionWithoutCancel: 'Are you sure to close this sketch?' translated
100
title: 'Closing sketch' translated) ifFalse: [ ^ self ]].
102
app ifNotNil: [app release]
105
{ #category : #'open/close' }
106
DrGeoWindow >> deleteWithoutConfirmation [
111
{ #category : #accessing }
112
DrGeoWindow >> domain [
116
{ #category : #services }
117
DrGeoWindow >> fileOpen: title extensions: exts path: path preview: preview [
118
"Answer the result of a file open dialog with the given title, extensions to show, path and preview type."
120
fd := DrGFileDialog basicNew
121
previewType: preview;
125
exts ifNotNil: [fd validExtensions: exts].
126
path ifNotNil: [fd selectPathName: path].
127
^ [(self openModal: fd) answer]
133
{ #category : #initialization }
134
DrGeoWindow >> initialize [
136
self model: self domain.
137
self setLabel: 'Dr. Geo -- ' , Date today yyyymmdd.
138
area := DrGDrawable newOn: app.
139
self setProperty: #morphicLayerNumber toValue: 110.
142
{ #category : #testing }
143
DrGeoWindow >> isApplication [
147
{ #category : #testing }
148
DrGeoWindow >> isService [
152
{ #category : #accessing }
153
DrGeoWindow >> macroMenu [
157
{ #category : #accessing }
158
DrGeoWindow >> macroMenu: aMenu [
162
{ #category : #'*DrGeoII-Polymorph-Widgets' }
163
DrGeoWindow >> newTabGroupTool: labelsAndPages [
164
"Answer tab grouped tools with a the given tab labels associated with pages of tools"
165
^(TabGroupToolMorph new
166
font: self theme labelFont;
167
cornerStyle: (self theme tabGroupCornerStyleIn: self);
168
hResizing: #spaceFill;
169
vResizing: #spaceFill;
170
labelsAndPages: labelsAndPages)
171
selectedPageIndex: (labelsAndPages isEmpty ifTrue: [0] ifFalse: [1])
174
{ #category : #'*DrGeoII-Polymorph-Widgets' }
175
DrGeoWindow >> newTable: controls [
176
"Answer a morph laid out with a table of controls, in row and wrapped in column."
178
answer := PanelMorph new
181
listDirection: #leftToRight;
182
wrapDirection: #topToBottom;
183
hResizing: #spaceFill;
184
vResizing: #shrinkWrap;
185
fillStyle: Color transparent; "non pane color tracking"
186
cellPositioning: #topLeft.
187
controls do: [:m | answer addMorphBack: m].
192
{ #category : #'*DrGeoII-Polymorph-Widgets' }
193
DrGeoWindow >> openModal: aSystemWindow [
194
DrGDefault ifTablet: [
196
extent: aSystemWindow initialExtent;
199
^ super openModal: aSystemWindow.
202
{ #category : #menus }
203
DrGeoWindow >> popupMenu [
204
"we don't want the popup menu when using the rich UI"
207
{ #category : #accessing }
208
DrGeoWindow >> presenter [
212
{ #category : #'as yet unclassified' }
213
DrGeoWindow >> relabel [
215
newLabel := UIManager default
216
request: 'New title for this window' translated
217
initialAnswer: app title.
218
newLabel isEmptyOrNil ifTrue: [^self].
219
app isSaved ifFalse: [ newLabel := '* ' , newLabel].
220
self setLabel: newLabel.
223
{ #category : #initialization }
224
DrGeoWindow >> release [
226
self presenter ifNotNil: [self presenter removeActionsWithReceiver: self].
233
{ #category : #accessing }
234
DrGeoWindow >> scriptMenu [
238
{ #category : #accessing }
239
DrGeoWindow >> scriptMenu: aMenu [
243
{ #category : #accessing }
244
DrGeoWindow >> setStyler: morph [
245
"set a morph to edit the style of an object, it can replace an existing one or add one such morph"
246
sideContainer submorphsDo: [:aMorph|
247
aMorph class ~= AthensWrapMorph ifTrue: [sideContainer removeMorph: aMorph]].
250
morph hResizing: #shrinkWrap; vResizing: #spaceFill.
251
sideContainer submorphs size = 1 ifTrue: [sideContainer addMorph: self newVerticalSeparator].
252
sideContainer addMorph: morph.
253
self updatePaneColors]
256
{ #category : #accessing }
257
DrGeoWindow >> sideContainer [
261
{ #category : #accessing }
262
DrGeoWindow >> sideContainer: aMorph [
263
sideContainer := aMorph
266
{ #category : #toolbars }
267
DrGeoWindow >> statusMessage: aString [
268
self statusbar submorphs first
269
contentsWrapped: aString
272
{ #category : #toolbars }
273
DrGeoWindow >> statusbar [
275
ifNil: [| statuslabel |
276
statusbar := self newPanel
277
cellPositioning: #topRight;
280
statuslabel := self newText: ''.
281
statuslabel autoFit: false;
283
vResizing: #spaceFill;
284
hResizing: #spaceFill.
285
" statuslabel hasDropShadow: true;
286
shadowColor: Color gray;
287
shadowOffset: 1 @ 1."
288
statusbar addMorphBack: statuslabel;
289
vResizing: #shrinkWrap.
293
{ #category : #stepping }
294
DrGeoWindow >> step [
295
DrGDefault ifTablet: [
296
"track device rotation"
300
{ #category : #stepping }
301
DrGeoWindow >> stepTime [
306
{ #category : #services }
307
DrGeoWindow >> textEditor: aStringOrText title: aString entryText: defaultEntryText [
309
"Answer the result of a text editor (multiline) dialog ( a string or nil if cancelled)
310
with the given label and title."
311
editor := TextEditorDialogWindow new
312
textFont: self theme textFont;
315
entryText: defaultEntryText;
317
DrGDefault ifTablet: [editor topCentered].
318
^(self openModal: editor) entryText
321
{ #category : #services }
322
DrGeoWindow >> textEntry: aStringOrText title: aString xEntryText: xEntryText yEntryText: yEntryText [
324
dialog := CoordinatesEditorDialog new textFont: self theme textFont;
325
title: aString; text: aStringOrText;
326
xEntryText: xEntryText; yEntryText: yEntryText.
327
DrGDefault ifTablet: [dialog topCentered].
328
"Open a text entry dialog."
329
dialog := self openModal: dialog.
330
^ {dialog xEntryText . dialog yEntryText}
333
{ #category : #accessing }
334
DrGeoWindow >> tree [
338
{ #category : #accessing }
339
DrGeoWindow >> tree: aTree [
343
{ #category : #stepping }
344
DrGeoWindow >> wantsSteps [
345
^ DrGDefault isTablet
348
{ #category : #accessing }
349
DrGeoWindow >> wantsToBeTopmost [