88
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
86
|
12 |
|
93
|
13 |
'From Smalltalk/X, Version:2.10.5 on 29-apr-1995 at 12:42:53 pm'!
|
90
|
14 |
|
86
|
15 |
ApplicationModel subclass:#NewLauncher
|
|
16 |
instanceVariableNames:'myMenu buttonPanel transcript infoView infoProcess helpIsOn'
|
|
17 |
classVariableNames:'CachedAboutIcon'
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Interface-Smalltalk'
|
|
20 |
!
|
|
21 |
|
88
|
22 |
!NewLauncher class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
|
38 |
version
|
|
39 |
"
|
128
|
40 |
$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.35 1995-08-30 18:36:12 claus Exp $
|
105
|
41 |
"
|
|
42 |
!
|
|
43 |
|
|
44 |
documentation
|
|
45 |
"
|
|
46 |
a new launcher, combining old Launchers menu and transcript into
|
|
47 |
one view. (you no longer have to move two views around all the time ...).
|
106
|
48 |
|
|
49 |
Also, this app makes first use of the new compatibility framework;
|
|
50 |
you will notice, that this is a subclass of ApplicationModel.
|
|
51 |
New applications will no longer be built as subclasses of standardSystemView.
|
105
|
52 |
"
|
|
53 |
!
|
|
54 |
|
|
55 |
customization
|
|
56 |
"
|
|
57 |
Of course, it is possible to change the NewLauncher class itself
|
|
58 |
as appropriate, however, we suggest you create a subclass (say MyLauncher),
|
|
59 |
define it as autoloaded in the patches file, and redefined some methods
|
|
60 |
there. That way, your changes are easier to reintroduce in case of
|
|
61 |
an ST/X upgrade.
|
|
62 |
|
|
63 |
|
|
64 |
adding more buttons to the button-panel:
|
|
65 |
|
|
66 |
see the method #buttonPanelSpec;
|
|
67 |
it defines a list of selectors and icons, which is used by
|
|
68 |
#setupButtonPanelIn:.
|
|
69 |
There, for each entry, a button with that icon is created,
|
|
70 |
which sends a selector-message to the launcher.
|
|
71 |
|
|
72 |
Add entries to that list, and define appropriate methods.
|
|
73 |
For example, to add a button which opens a drawTool,
|
|
74 |
change #buttonPanelSpec to:
|
|
75 |
|
|
76 |
buttonPanelSpec
|
|
77 |
^ #(
|
|
78 |
#(startSystemBrowser 'SBrowser32x32.xbm')
|
|
79 |
#(startFileBrowser 'FBrowser32x32.xbm')
|
|
80 |
#(nil nil)
|
|
81 |
#(startChangesBrowser 'CBrowser32x32.xbm')
|
|
82 |
#(nil nil)
|
|
83 |
#(nil nil)
|
|
84 |
#(startDrawTool 'DrawTool.xbm')
|
|
85 |
)
|
|
86 |
|
|
87 |
the panel adjusts its height as appropriate - you may want to
|
|
88 |
create new (small) icons for a good look.
|
|
89 |
|
|
90 |
adding an entry to a menu:
|
|
91 |
|
|
92 |
see the #setupMenu method; either add another top-menu, or
|
|
93 |
add entries to an existing menu.
|
88
|
94 |
"
|
|
95 |
! !
|
|
96 |
|
86
|
97 |
!NewLauncher class methodsFor:'defaults'!
|
|
98 |
|
93
|
99 |
smallAboutIcon
|
|
100 |
|image|
|
|
101 |
|
|
102 |
image := self aboutIcon.
|
|
103 |
image notNil ifTrue:[
|
|
104 |
image := image magnifiedBy:0.4.
|
|
105 |
].
|
|
106 |
^ image
|
|
107 |
|
|
108 |
"
|
|
109 |
CachedAboutIcon := nil.
|
|
110 |
NewLauncher aboutIcon.
|
|
111 |
NewLauncher smallAboutIcon.
|
|
112 |
"
|
|
113 |
!
|
|
114 |
|
86
|
115 |
aboutIcon
|
|
116 |
|image|
|
|
117 |
|
|
118 |
CachedAboutIcon notNil ifTrue:[^ CachedAboutIcon].
|
|
119 |
|
|
120 |
image := Image fromFile:'SmalltalkX.xbm'.
|
92
|
121 |
image notNil ifTrue:[
|
86
|
122 |
|green dark|
|
|
123 |
|
|
124 |
Display hasColors ifTrue:[
|
105
|
125 |
green := (Color red:0 green:80 blue:20) "darkened".
|
86
|
126 |
dark := Color grey:10.
|
102
|
127 |
image photometric:#palette.
|
86
|
128 |
] ifFalse:[
|
100
|
129 |
dark := Color black.
|
|
130 |
green := Color white.
|
102
|
131 |
image photometric:#blackIs0.
|
86
|
132 |
].
|
102
|
133 |
image colorMap:(Array with:dark with:green).
|
86
|
134 |
Display depth > 2 ifTrue:[
|
|
135 |
image := (Image implementorForDepth:Display depth) fromImage:image.
|
|
136 |
]
|
|
137 |
].
|
|
138 |
CachedAboutIcon := image.
|
|
139 |
^ image
|
|
140 |
|
|
141 |
"
|
92
|
142 |
CachedAboutIcon := nil.
|
|
143 |
NewLauncher aboutIcon
|
|
144 |
"
|
86
|
145 |
! !
|
|
146 |
|
99
|
147 |
!NewLauncher methodsFor:'queries'!
|
|
148 |
|
|
149 |
processName
|
|
150 |
"for monitors only - my name"
|
|
151 |
|
|
152 |
^ 'ST/X Launcher'
|
|
153 |
! !
|
|
154 |
|
93
|
155 |
!NewLauncher methodsFor:'initialize / release'!
|
86
|
156 |
|
98
|
157 |
restarted
|
|
158 |
"image restart - since WindowGroup recreates the process with
|
|
159 |
default prio, we have to raise the prio again.
|
|
160 |
Mhmh - this looks like a bug to me ..."
|
|
161 |
|
|
162 |
Processor activeProcess priority:(Processor userSchedulingPriority + 1).
|
|
163 |
super restarted
|
|
164 |
!
|
|
165 |
|
93
|
166 |
openInterface
|
98
|
167 |
"sent by my superclass to open up my interface"
|
93
|
168 |
|
|
169 |
|top icn w|
|
86
|
170 |
|
|
171 |
top := StandardSystemView new.
|
|
172 |
top label:'Smalltalk/X'.
|
|
173 |
top extent:(400@300 ).
|
|
174 |
|
92
|
175 |
"
|
|
176 |
temporary kludge for SGI;
|
|
177 |
this will be moved into StandardSystemView and be done
|
|
178 |
automatically soon ...
|
|
179 |
"
|
106
|
180 |
Screen current serverVendor = 'Silicon Graphics' ifTrue:[
|
93
|
181 |
icn := self class aboutIcon.
|
92
|
182 |
icn notNil ifTrue:[
|
93
|
183 |
icn := icn magnifiedTo:86@68.
|
92
|
184 |
w := View extent:86@68. "/ icn extent.
|
|
185 |
w viewBackground:icn.
|
|
186 |
top iconView:w
|
|
187 |
]
|
|
188 |
].
|
|
189 |
|
93
|
190 |
self setupViewsIn:top.
|
98
|
191 |
|
|
192 |
top application:self.
|
|
193 |
builder window:top.
|
86
|
194 |
|
|
195 |
"
|
92
|
196 |
open with higher prio to allow interaction even while things
|
|
197 |
are running ...
|
86
|
198 |
"
|
92
|
199 |
top openWithPriority:(Processor userSchedulingPriority + 1).
|
93
|
200 |
!
|
86
|
201 |
|
93
|
202 |
addTopViewsToCurrentProject
|
|
203 |
"ignored here - the launcher is always global (i.e. not project private)."
|
86
|
204 |
|
93
|
205 |
^ self
|
86
|
206 |
!
|
|
207 |
|
|
208 |
setupMenu
|
|
209 |
"setup the pulldown menu"
|
|
210 |
|
92
|
211 |
|l s icon|
|
86
|
212 |
|
|
213 |
myMenu labels:(resources array:#(
|
88
|
214 |
'about'
|
|
215 |
'file'
|
|
216 |
'classes'
|
|
217 |
'tools'
|
|
218 |
'projects'
|
|
219 |
'settings'
|
|
220 |
'demos'
|
|
221 |
'help')).
|
92
|
222 |
"
|
|
223 |
if there is a bitmap, change 'about' to the ST/X icon
|
|
224 |
"
|
|
225 |
icon := self class smallAboutIcon.
|
|
226 |
icon notNil ifTrue:[
|
|
227 |
myMenu labels at:1 put:icon.
|
94
|
228 |
myMenu height:(myMenu height max:(icon height + (View viewSpacing * 2)))
|
92
|
229 |
].
|
86
|
230 |
|
|
231 |
myMenu selectors:#(
|
88
|
232 |
#about
|
|
233 |
#file
|
|
234 |
#classes
|
|
235 |
#tools
|
|
236 |
#projects
|
|
237 |
#settings
|
|
238 |
#demos
|
|
239 |
#help).
|
86
|
240 |
|
|
241 |
myMenu at:#about
|
88
|
242 |
putLabels:(resources array:#(
|
|
243 |
'about Smalltalk/X ...'
|
|
244 |
))
|
|
245 |
selectors:#(
|
|
246 |
#about
|
|
247 |
)
|
|
248 |
receiver:self.
|
86
|
249 |
|
118
|
250 |
(ObjectFileLoader notNil and:[ObjectFileLoader isLoaded]) ifTrue:[
|
|
251 |
l := #(
|
|
252 |
'file browser'
|
|
253 |
'-'
|
|
254 |
'modules'
|
|
255 |
'-'
|
|
256 |
'snapshot'
|
|
257 |
'snapshot & exit'
|
|
258 |
'exit smalltalk'
|
|
259 |
).
|
|
260 |
s := #(
|
|
261 |
#startFileBrowser
|
|
262 |
nil
|
|
263 |
#objectModuleDialog
|
|
264 |
nil
|
|
265 |
#snapshot
|
|
266 |
#snapshotAndExit
|
|
267 |
#exit
|
|
268 |
)
|
|
269 |
] ifFalse:[
|
|
270 |
l := #(
|
|
271 |
'file browser'
|
|
272 |
'-'
|
|
273 |
'snapshot'
|
|
274 |
'snapshot & exit'
|
|
275 |
'exit smalltalk'
|
|
276 |
).
|
|
277 |
s := #(
|
|
278 |
#startFileBrowser
|
|
279 |
nil
|
|
280 |
#snapshot
|
|
281 |
#snapshotAndExit
|
|
282 |
#exit
|
|
283 |
)
|
|
284 |
].
|
|
285 |
|
86
|
286 |
myMenu at:#file
|
118
|
287 |
putLabels:(resources array:l)
|
|
288 |
selectors:s
|
88
|
289 |
receiver:self.
|
86
|
290 |
|
|
291 |
myMenu at:#classes
|
88
|
292 |
putLabels:(resources array:#(
|
|
293 |
'system browser'
|
|
294 |
'class browser'
|
|
295 |
'full class browser'
|
|
296 |
'class hierarchy browser'
|
|
297 |
'class tree'
|
|
298 |
'-'
|
|
299 |
'implementors'
|
|
300 |
'senders'
|
|
301 |
'-'
|
|
302 |
'change browser'
|
|
303 |
))
|
|
304 |
selectors:#(
|
|
305 |
#startSystemBrowser
|
|
306 |
#startClassBrowser
|
|
307 |
#startFullClassBrowser
|
|
308 |
#startClassHierarchyBrowser
|
|
309 |
#startClassTreeView
|
|
310 |
nil
|
|
311 |
#browseImplementors
|
|
312 |
#browseSenders
|
|
313 |
nil
|
|
314 |
#startChangesBrowser
|
|
315 |
)
|
|
316 |
receiver:self.
|
86
|
317 |
|
|
318 |
myMenu at:#projects
|
88
|
319 |
putLabels:(resources array:#(
|
|
320 |
'new project'
|
|
321 |
'-'
|
106
|
322 |
'select project ...'
|
88
|
323 |
))
|
|
324 |
selectors:#(
|
|
325 |
#newProject
|
|
326 |
nil
|
|
327 |
#selectProject
|
|
328 |
)
|
|
329 |
receiver:self.
|
86
|
330 |
|
|
331 |
myMenu at:#settings
|
88
|
332 |
putLabels:(resources array:#(
|
|
333 |
'language'
|
107
|
334 |
'show keyboard mappings'
|
88
|
335 |
'view style'
|
110
|
336 |
'messages'
|
93
|
337 |
'compilation'
|
94
|
338 |
'misc'
|
88
|
339 |
))
|
|
340 |
selectors:#(
|
|
341 |
#languageSetting
|
107
|
342 |
#keyboardSetting
|
88
|
343 |
#viewStyleSetting
|
110
|
344 |
#messageSettings
|
94
|
345 |
#compilerSettings
|
|
346 |
#miscSettings
|
88
|
347 |
)
|
|
348 |
receiver:self.
|
86
|
349 |
|
93
|
350 |
self setupToolsMenu.
|
90
|
351 |
self setupDemoMenu.
|
86
|
352 |
|
|
353 |
ActiveHelp notNil ifTrue:[
|
88
|
354 |
l := #(
|
|
355 |
'\c active help'
|
|
356 |
'ST/X documentation'
|
|
357 |
).
|
|
358 |
s := #(
|
93
|
359 |
#toggleActiveHelp:
|
88
|
360 |
#startDocumentationTool
|
|
361 |
)
|
86
|
362 |
] ifFalse:[
|
88
|
363 |
l := #(
|
|
364 |
'ST/X documentation'
|
|
365 |
).
|
|
366 |
s := #(
|
|
367 |
#startDocumentationTool
|
|
368 |
)
|
86
|
369 |
].
|
|
370 |
|
|
371 |
myMenu at:#help
|
88
|
372 |
putLabels:(resources array:l)
|
|
373 |
selectors:s
|
|
374 |
receiver:self.
|
121
|
375 |
|
|
376 |
(ActiveHelp notNil
|
|
377 |
and:[ActiveHelp isActive]) ifTrue:[
|
|
378 |
(myMenu menuAt:#help) checkToggleAt:#toggleActiveHelp: put:true
|
|
379 |
].
|
86
|
380 |
!
|
|
381 |
|
93
|
382 |
setupTranscriptIn:aView
|
|
383 |
|v|
|
|
384 |
|
|
385 |
(Transcript notNil and:[Transcript ~~ Stderr]) ifTrue:[
|
|
386 |
Transcript topView destroy.
|
|
387 |
].
|
|
388 |
|
|
389 |
v := HVScrollableView
|
|
390 |
for:TextCollector
|
|
391 |
miniScrollerH:true
|
|
392 |
miniScrollerV:false
|
|
393 |
in:aView.
|
|
394 |
|
|
395 |
v origin:(0.0 @ (buttonPanel corner y + View viewSpacing))
|
|
396 |
corner:(1.0 @ 1.0).
|
|
397 |
transcript := v scrolledView.
|
|
398 |
transcript beTranscript.
|
|
399 |
!
|
|
400 |
|
90
|
401 |
setupInfoViewIn:topView
|
93
|
402 |
|spc halfSpc|
|
86
|
403 |
|
90
|
404 |
spc := View viewSpacing.
|
|
405 |
infoView := Label label:'' in:topView.
|
|
406 |
infoView adjust:#left; borderWidth:0.
|
|
407 |
infoView level:-1.
|
|
408 |
transcript superView bottomInset:(infoView height + spc).
|
86
|
409 |
|
100
|
410 |
infoView is3D ifTrue:[
|
|
411 |
halfSpc := spc // 2.
|
|
412 |
] ifFalse:[
|
|
413 |
halfSpc := 0
|
|
414 |
].
|
|
415 |
infoView topInset:(infoView height negated - spc + transcript borderWidth);
|
93
|
416 |
bottomInset:halfSpc;
|
|
417 |
leftInset:halfSpc;
|
|
418 |
rightInset:halfSpc.
|
|
419 |
infoView origin:0.0 @ 1.0 corner:1.0 @ 1.0.
|
|
420 |
infoView model:self; aspect:#info; labelMessage:#info.
|
86
|
421 |
|
93
|
422 |
Project notNil ifTrue:[
|
|
423 |
Project addDependent:self.
|
|
424 |
]
|
90
|
425 |
|
|
426 |
"
|
|
427 |
NewLauncher open
|
|
428 |
"
|
86
|
429 |
!
|
|
430 |
|
93
|
431 |
focusSequence
|
100
|
432 |
^ (Array with:myMenu)
|
|
433 |
,
|
|
434 |
(buttonPanel subViews select:[:element | element isKindOf:Button])
|
108
|
435 |
"/ , (Array with:Transcript)
|
93
|
436 |
!
|
|
437 |
|
86
|
438 |
setupViewsIn:topView
|
|
439 |
"create the pulldown menu, buttonPanel and transcript view"
|
|
440 |
|
107
|
441 |
|tFont|
|
86
|
442 |
|
|
443 |
topView model:self.
|
|
444 |
|
|
445 |
myMenu := PullDownMenu in:topView.
|
106
|
446 |
myMenu origin:0.0 @ 0.0 corner:(1.0 @ myMenu height).
|
86
|
447 |
|
|
448 |
self setupMenu.
|
|
449 |
self setupButtonPanelIn:topView.
|
|
450 |
self setupTranscriptIn:topView.
|
|
451 |
self setupInfoViewIn:topView.
|
103
|
452 |
self setupOtherViewsIn:topView.
|
86
|
453 |
|
100
|
454 |
tFont := transcript font.
|
120
|
455 |
topView extent:(((tFont widthOf:'3')*60) max:myMenu preferredExtent x)
|
86
|
456 |
@
|
100
|
457 |
((tFont height) * 20).
|
86
|
458 |
|
|
459 |
"
|
|
460 |
NewLauncher open
|
|
461 |
"
|
|
462 |
!
|
|
463 |
|
103
|
464 |
setupOtherViewsIn:aTopView
|
|
465 |
"a hook - allows redefinition in your personal subclass.
|
|
466 |
For example, add a clock:"
|
|
467 |
|
|
468 |
"
|
|
469 |
|sz clock space halfSpace|
|
|
470 |
|
|
471 |
sz := buttonPanel innerHeight - (buttonPanel level abs*2).
|
|
472 |
space := View viewSpacing.
|
|
473 |
halfSpace := space // 2.
|
|
474 |
|
|
475 |
buttonPanel rightInset:sz+(space * 2).
|
|
476 |
|
104
|
477 |
clock := ClockView in:buttonPanel topView.
|
103
|
478 |
clock borderWidth:1.
|
|
479 |
clock showSeconds:false.
|
|
480 |
clock extent:(sz @ sz).
|
|
481 |
clock origin:(1.0 @ (buttonPanel origin y + halfSpace)).
|
|
482 |
clock leftInset:sz negated - 2 - halfSpace.
|
|
483 |
clock rightInset:halfSpace.
|
|
484 |
clock level:1.
|
|
485 |
"
|
|
486 |
!
|
|
487 |
|
86
|
488 |
setupButtonPanelIn:aTopView
|
|
489 |
"create the buttonPanel"
|
|
490 |
|
107
|
491 |
|spc mh|
|
86
|
492 |
|
|
493 |
spc := View viewSpacing // 2.
|
|
494 |
buttonPanel := HorizontalPanelView in:aTopView.
|
|
495 |
buttonPanel level:-1; borderWidth:0.
|
|
496 |
buttonPanel horizontalLayout:#leftSpace.
|
|
497 |
|
90
|
498 |
self buttonPanelSpec do:[:entry |
|
|
499 |
|sel b sep|
|
86
|
500 |
|
90
|
501 |
sel := entry at:1.
|
|
502 |
sel isNil ifTrue:[
|
|
503 |
sep := View in:buttonPanel.
|
|
504 |
sep extent:32@1; borderWidth:0.
|
|
505 |
] ifFalse:[
|
|
506 |
b := Button in:buttonPanel.
|
|
507 |
b form:(Image fromFile:(entry at:2)).
|
100
|
508 |
b model:self; changeMessage:sel
|
90
|
509 |
]
|
86
|
510 |
].
|
|
511 |
|
100
|
512 |
mh := myMenu height.
|
|
513 |
buttonPanel origin:0.0 @ (mh + spc)
|
105
|
514 |
corner:(1.0 @ (mh + spc + buttonPanel preferredExtent y)).
|
86
|
515 |
|
|
516 |
buttonPanel leftInset:spc; rightInset:spc.
|
|
517 |
!
|
|
518 |
|
90
|
519 |
setupDemoMenu
|
|
520 |
"setup the demo pulldown menu"
|
|
521 |
|
|
522 |
|m|
|
|
523 |
|
|
524 |
myMenu at:#demos
|
|
525 |
putLabels:(resources array:#(
|
91
|
526 |
'goodies'
|
90
|
527 |
'games'
|
|
528 |
'geometric designs'
|
|
529 |
'simple animations'
|
|
530 |
'3D graphics'
|
|
531 |
'graphic editors'
|
|
532 |
))
|
|
533 |
selectors:#(
|
91
|
534 |
goodies
|
90
|
535 |
games
|
|
536 |
geometricDesigns
|
|
537 |
simpleAnimations
|
|
538 |
#'3Dgraphics'
|
|
539 |
#graphicEditors
|
|
540 |
)
|
|
541 |
receiver:self.
|
|
542 |
|
|
543 |
"
|
|
544 |
only to show two different ways of defining a popUpMenu,
|
|
545 |
we use labels:selectors:receiver: here:
|
|
546 |
"
|
|
547 |
m := myMenu menuAt:#demos.
|
|
548 |
m subMenuAt:#games
|
|
549 |
put:(PopUpMenu
|
|
550 |
labels:(resources array:#(
|
|
551 |
'Tetris'
|
|
552 |
'Tic Tac Toe'
|
|
553 |
))
|
|
554 |
selectors:#(
|
|
555 |
startTetris
|
|
556 |
startTicTacToe
|
|
557 |
)
|
|
558 |
receiver:self).
|
|
559 |
|
|
560 |
"
|
|
561 |
and labels:selector:args:receiver: here:
|
|
562 |
"
|
|
563 |
m subMenuAt:#geometricDesigns
|
|
564 |
put:(PopUpMenu
|
|
565 |
labels:(resources array:#(
|
|
566 |
'Pen demo'
|
|
567 |
'Commander demo'
|
116
|
568 |
'-'
|
115
|
569 |
'Fractal plants demo'
|
116
|
570 |
'Fractal patterns demo'
|
90
|
571 |
))
|
|
572 |
selector:#openDemo:
|
|
573 |
args:#(
|
|
574 |
PenDemo
|
|
575 |
CommanderDemo
|
116
|
576 |
nil
|
115
|
577 |
FractalPlantsDemo
|
116
|
578 |
FractalPatternsDemo
|
91
|
579 |
)
|
90
|
580 |
receiver:self).
|
|
581 |
|
|
582 |
m subMenuAt:#simpleAnimations
|
|
583 |
put:(PopUpMenu
|
|
584 |
labels:(resources array:#(
|
|
585 |
'Animation'
|
|
586 |
'Globe demo'
|
|
587 |
))
|
|
588 |
selector:#openDemo:
|
|
589 |
args:#(
|
|
590 |
Animation
|
|
591 |
GlobeDemo
|
91
|
592 |
)
|
90
|
593 |
receiver:self).
|
|
594 |
|
|
595 |
m subMenuAt:#'3Dgraphics'
|
|
596 |
put:(PopUpMenu
|
|
597 |
labels:(resources
|
|
598 |
array:#(
|
|
599 |
'plane'
|
|
600 |
'tetra'
|
|
601 |
'cube (wireframe)'
|
|
602 |
'cube (solid)'
|
|
603 |
'cube (light)'
|
|
604 |
'cube (light & texture)'
|
|
605 |
'sphere (wireframe)'
|
|
606 |
'sphere (light)'
|
|
607 |
'planet'
|
|
608 |
'teapot'
|
|
609 |
'logo'
|
108
|
610 |
'x/y graph'
|
90
|
611 |
))
|
|
612 |
selector:#openDemo:
|
|
613 |
args:#(
|
|
614 |
GLPlaneDemoView2
|
|
615 |
GLTetraDemoView
|
|
616 |
GLWireCubeDemoView
|
|
617 |
GLCubeDemoView
|
|
618 |
GLCubeDemoView2
|
|
619 |
GLBrickCubeDemoView
|
|
620 |
GLWireSphereDemoView
|
|
621 |
GLSphereDemoView2
|
|
622 |
GLPlanetDemoView
|
|
623 |
GLTeapotDemo
|
|
624 |
Logo3DView1
|
108
|
625 |
GLXYGraph
|
91
|
626 |
)
|
90
|
627 |
receiver:self).
|
|
628 |
|
|
629 |
m subMenuAt:#graphicEditors
|
|
630 |
put:(PopUpMenu
|
|
631 |
labels:(resources array:#(
|
|
632 |
'DrawTool'
|
|
633 |
'LogicTool'
|
|
634 |
))
|
|
635 |
selector:#openDemo:
|
|
636 |
args:#(
|
|
637 |
DrawTool
|
|
638 |
LogicTool
|
91
|
639 |
)
|
90
|
640 |
receiver:self).
|
|
641 |
|
91
|
642 |
m subMenuAt:#goodies
|
|
643 |
put:(PopUpMenu
|
|
644 |
labels:(resources array:#(
|
|
645 |
'clock'
|
|
646 |
'calendar'
|
|
647 |
'-'
|
|
648 |
'mail tool'
|
|
649 |
'news tool'
|
|
650 |
))
|
|
651 |
selector:#openDemo:
|
|
652 |
args:#(
|
|
653 |
Clock
|
|
654 |
Calendar
|
|
655 |
nil
|
|
656 |
MailView
|
|
657 |
NewsView
|
|
658 |
)
|
|
659 |
receiver:self).
|
90
|
660 |
!
|
|
661 |
|
|
662 |
buttonPanelSpec
|
|
663 |
"return a spec for the buttons in the panel;
|
|
664 |
entries consists of selector and bitmap-filename.
|
|
665 |
nil selectors are taken as separators (see setupButtonPanel)"
|
|
666 |
|
|
667 |
^ #(
|
|
668 |
#(startSystemBrowser 'SBrowser32x32.xbm')
|
|
669 |
#(startFileBrowser 'FBrowser32x32.xbm')
|
|
670 |
#(nil nil)
|
|
671 |
#(startChangesBrowser 'CBrowser32x32.xbm')
|
107
|
672 |
"/ #(nil nil)
|
|
673 |
"/ #(nil nil)
|
|
674 |
"/ #(startDocumentationTool 'book11.ico')
|
90
|
675 |
)
|
93
|
676 |
!
|
|
677 |
|
|
678 |
release
|
|
679 |
infoProcess notNil ifTrue:[
|
|
680 |
infoProcess terminate.
|
|
681 |
infoProcess := nil.
|
|
682 |
].
|
|
683 |
super release
|
|
684 |
!
|
|
685 |
|
|
686 |
closeRequest
|
|
687 |
(self confirm:(resources string:'really close %1 ?' with:self class name)) ifTrue:[
|
|
688 |
super closeRequest
|
|
689 |
]
|
|
690 |
!
|
|
691 |
|
|
692 |
saveAndTerminate
|
|
693 |
"
|
|
694 |
some windowManagers can send this, to shutDown an application
|
|
695 |
but let it save its state before, for restart. We are already
|
|
696 |
prepared for this ;-)"
|
|
697 |
|
|
698 |
self snapshot.
|
|
699 |
super saveAndTerminate
|
|
700 |
!
|
|
701 |
|
|
702 |
setupToolsMenu
|
|
703 |
"setup the tools pulldown menu"
|
|
704 |
|
|
705 |
|m|
|
|
706 |
|
|
707 |
myMenu at:#tools
|
|
708 |
putLabels:(resources array:#(
|
|
709 |
'workspace'
|
|
710 |
'-'
|
|
711 |
'monitors'
|
|
712 |
'-'
|
|
713 |
'view tree (all views)'
|
|
714 |
'view tree'
|
|
715 |
'inspect view'
|
|
716 |
'destroy view'
|
|
717 |
'-'
|
|
718 |
'hardcopy'
|
120
|
719 |
'-'
|
|
720 |
'misc'
|
93
|
721 |
))
|
|
722 |
selectors:#(
|
|
723 |
#startWorkspace
|
|
724 |
nil
|
|
725 |
#monitors
|
|
726 |
nil
|
|
727 |
#startFullWindowTreeView
|
|
728 |
#startWindowTreeView
|
|
729 |
#viewInspect
|
|
730 |
#viewDestroy
|
|
731 |
nil
|
|
732 |
#hardcopy
|
120
|
733 |
nil
|
|
734 |
#misc
|
93
|
735 |
)
|
|
736 |
receiver:self.
|
|
737 |
|
|
738 |
|
|
739 |
m := myMenu menuAt:#tools.
|
|
740 |
m subMenuAt:#monitors
|
|
741 |
put:(PopUpMenu
|
|
742 |
labels:(resources array:#(
|
|
743 |
'process'
|
|
744 |
'memory'
|
|
745 |
'event'
|
|
746 |
'-'
|
|
747 |
'memory usage'
|
|
748 |
))
|
|
749 |
selectors:#(
|
|
750 |
#startProcessMonitor
|
|
751 |
#startMemoryMonitor
|
|
752 |
#startEventMonitor
|
|
753 |
nil
|
|
754 |
#startMemoryUsageView
|
|
755 |
)
|
|
756 |
receiver:self).
|
|
757 |
|
120
|
758 |
m subMenuAt:#misc
|
|
759 |
put:(PopUpMenu
|
|
760 |
labels:(resources array:#(
|
|
761 |
'remove all break/trace points'
|
|
762 |
))
|
|
763 |
selectors:#(
|
|
764 |
#removeAllBreakAndTracePoints
|
|
765 |
)
|
|
766 |
receiver:self).
|
|
767 |
|
93
|
768 |
m subMenuAt:#hardcopy
|
|
769 |
put:(PopUpMenu
|
|
770 |
labels:(resources array:#(
|
|
771 |
'screen'
|
|
772 |
'area'
|
|
773 |
'view'
|
|
774 |
))
|
|
775 |
selectors:#(
|
|
776 |
#fullScreenHardcopy
|
|
777 |
#screenHardcopy
|
|
778 |
#viewHardcopy
|
|
779 |
)
|
|
780 |
receiver:self).
|
|
781 |
|
86
|
782 |
! !
|
|
783 |
|
|
784 |
!NewLauncher methodsFor:'actions - classes'!
|
|
785 |
|
|
786 |
startFileBrowser
|
106
|
787 |
self withWaitCursorDo:[FileBrowser open]
|
86
|
788 |
!
|
|
789 |
|
90
|
790 |
startChangesBrowser
|
106
|
791 |
self withWaitCursorDo:[ChangesBrowser open]
|
90
|
792 |
!
|
|
793 |
|
86
|
794 |
startSystemBrowser
|
106
|
795 |
self withWaitCursorDo:[SystemBrowser open]
|
86
|
796 |
!
|
|
797 |
|
|
798 |
startWorkspace
|
|
799 |
Workspace open
|
|
800 |
!
|
|
801 |
|
|
802 |
startClassBrowser
|
90
|
803 |
SystemBrowser askThenBrowseClass
|
|
804 |
!
|
|
805 |
|
|
806 |
startFullClassBrowser
|
|
807 |
SystemBrowser askThenBrowseFullClassProtocol
|
86
|
808 |
!
|
|
809 |
|
|
810 |
startClassHierarchyBrowser
|
90
|
811 |
SystemBrowser askThenBrowseClassHierarchy
|
86
|
812 |
!
|
|
813 |
|
|
814 |
browseImplementors
|
|
815 |
|enterBox|
|
|
816 |
|
|
817 |
enterBox := EnterBox title:(resources at:'Browse implementors of:') withCRs.
|
|
818 |
enterBox okText:(resources at:'browse').
|
|
819 |
enterBox action:[:selectorName |
|
|
820 |
|cls|
|
|
821 |
|
106
|
822 |
self withWaitCursorDo:[SystemBrowser browseImplementorsOf:selectorName]
|
86
|
823 |
].
|
|
824 |
enterBox showAtPointer
|
|
825 |
!
|
|
826 |
|
|
827 |
browseSenders
|
|
828 |
|enterBox|
|
|
829 |
|
|
830 |
enterBox := EnterBox title:(resources at:'Browse senders of:') withCRs.
|
|
831 |
enterBox okText:(resources at:'browse').
|
|
832 |
enterBox action:[:selectorName |
|
|
833 |
|cls|
|
|
834 |
|
106
|
835 |
self withWaitCursorDo:[SystemBrowser browseAllCallsOn:selectorName]
|
86
|
836 |
].
|
|
837 |
enterBox showAtPointer
|
|
838 |
!
|
|
839 |
|
|
840 |
startClassTreeView
|
106
|
841 |
self withWaitCursorDo:[ClassTreeGraphView open]
|
86
|
842 |
! !
|
|
843 |
|
90
|
844 |
!NewLauncher methodsFor:'actions - settings'!
|
|
845 |
|
|
846 |
viewStyleSetting
|
100
|
847 |
|listOfStyles resourceDir dir box
|
107
|
848 |
list listView infoLabel infoForwarder newStyle|
|
90
|
849 |
|
|
850 |
"
|
|
851 |
search resources directory for a list of .style files ...
|
|
852 |
"
|
|
853 |
|
|
854 |
resourceDir := Smalltalk getSystemFileName:'resources'.
|
105
|
855 |
resourceDir isNil ifTrue:[
|
|
856 |
self warn:'no styles found (missing ''resources'' directory)'.
|
|
857 |
^ self
|
|
858 |
].
|
90
|
859 |
dir := FileDirectory directoryNamed:resourceDir.
|
|
860 |
|
|
861 |
listOfStyles := dir select:[:aFileName | aFileName endsWith:'.style'].
|
|
862 |
listOfStyles := listOfStyles collect:[:aFileName | aFileName copyWithoutLast:6].
|
100
|
863 |
listOfStyles sort.
|
90
|
864 |
|
100
|
865 |
"/ old code: used a standard ListSelectionBox
|
|
866 |
"/ changed to intercept selection and add info-output.
|
|
867 |
|
|
868 |
"/ box := ListSelectionBox title:(resources string:'STYLE_MSG') withCRs.
|
|
869 |
"/ box label:(resources string:'Style selection').
|
|
870 |
"/ box list:listOfStyles.
|
|
871 |
"/ box initialText:View defaultStyle.
|
|
872 |
"/ box selectAction:[:newStyle |
|
|
873 |
"/ ].
|
|
874 |
"/ box action:[:newStyle |
|
|
875 |
"/ transcript topView withCursor:Cursor wait do:[
|
|
876 |
"/ Transcript showCr:'change style to ' , newStyle , ' ...'.
|
|
877 |
"/ View defaultStyle:newStyle asSymbol.
|
|
878 |
"/ ]
|
|
879 |
"/ ].
|
|
880 |
"/ box showAtPointer
|
|
881 |
|
|
882 |
"/ new code: build box 'by 'hand'
|
|
883 |
"/
|
|
884 |
infoForwarder := Plug new.
|
|
885 |
infoForwarder respondTo:#showInfo
|
|
886 |
with:[
|
|
887 |
|nm sheet comment|
|
|
888 |
nm := list selection.
|
|
889 |
sheet := ViewStyle fromFile:(nm , '.style').
|
|
890 |
comment := sheet at:#comment ifAbsent:''.
|
|
891 |
infoLabel label:comment withCRs asStringCollection
|
|
892 |
].
|
|
893 |
|
|
894 |
list := SelectionInList with:listOfStyles.
|
|
895 |
list onChangeSend:#showInfo to:infoForwarder.
|
|
896 |
|
|
897 |
box := Dialog new.
|
90
|
898 |
box label:(resources string:'Style selection').
|
100
|
899 |
|
112
|
900 |
(box addTextLabel:(resources string:'STYLE_MSG') withCRs) borderWidth:0.
|
100
|
901 |
listView := SelectionInListView on:list.
|
|
902 |
listView doubleClickAction:[:sel | box accept value:true. box hide].
|
|
903 |
listView height:200.
|
108
|
904 |
box addComponent:(ScrollableView forView:listView) tabable:true.
|
100
|
905 |
box addVerticalSpace.
|
|
906 |
|
|
907 |
(infoLabel := box addTextLabel:'\\' withCRs) adjust:#centerLeft.
|
|
908 |
|
|
909 |
box addAbortButton; addOkButton.
|
|
910 |
list selection:(View defaultStyle).
|
105
|
911 |
box extent:(box preferredExtent).
|
100
|
912 |
box minExtent:box extent.
|
|
913 |
box maxExtent:box extent.
|
|
914 |
|
|
915 |
box showAtPointer.
|
|
916 |
|
|
917 |
box accepted ifTrue:[
|
|
918 |
newStyle := list selection.
|
|
919 |
newStyle notNil ifTrue:[
|
106
|
920 |
self withWaitCursorDo:[
|
100
|
921 |
Transcript showCr:'change style to ' , newStyle , ' ...'.
|
|
922 |
View defaultStyle:newStyle asSymbol.
|
106
|
923 |
].
|
|
924 |
self reopenLauncher.
|
90
|
925 |
]
|
100
|
926 |
]
|
90
|
927 |
!
|
|
928 |
|
|
929 |
languageSetting
|
|
930 |
|listOfLanguages box|
|
|
931 |
|
|
932 |
"
|
|
933 |
hardwiring here is stupid - need a resource file
|
|
934 |
which lists languagenames which have all texts available
|
|
935 |
in resource files ...
|
|
936 |
"
|
|
937 |
listOfLanguages := #('english'
|
|
938 |
'german'
|
|
939 |
'french'
|
|
940 |
'spanish'
|
|
941 |
'italian'
|
|
942 |
).
|
|
943 |
|
94
|
944 |
box := ListSelectionBox title:(resources string:'LANG_MSG') withCRs.
|
90
|
945 |
box label:(resources string:'Language selection').
|
|
946 |
box list:listOfLanguages.
|
|
947 |
box initialText:(Language).
|
|
948 |
box action:[:newLanguage |
|
106
|
949 |
self withWaitCursorDo:[
|
90
|
950 |
Transcript showCr:'change language to ' , newLanguage , ' ...'.
|
|
951 |
Smalltalk at:#Language put:newLanguage asSymbol.
|
|
952 |
Smalltalk changed:#Language.
|
|
953 |
ResourcePack flushCachedResourcePacks
|
106
|
954 |
].
|
|
955 |
self reopenLauncher.
|
90
|
956 |
].
|
|
957 |
box showAtPointer
|
|
958 |
!
|
|
959 |
|
107
|
960 |
keyboardSetting
|
|
961 |
|mappings listOfRawKeys listOfFunctions
|
|
962 |
box l
|
|
963 |
list1 list2 listView1 listView2
|
|
964 |
frame infoLabel selectionForwarder macroForwarder macroTextView y|
|
|
965 |
|
|
966 |
mappings := Screen current keyboardMap.
|
|
967 |
|
|
968 |
listOfRawKeys := (mappings keys asArray collect:[:key | key asString]) sort.
|
|
969 |
listOfFunctions := (mappings values asSet asArray collect:[:key | key asString]) sort.
|
|
970 |
|
|
971 |
selectionForwarder := Plug new.
|
|
972 |
selectionForwarder respondTo:#showFunction
|
|
973 |
with:[
|
|
974 |
|raw|
|
|
975 |
raw := list1 selection.
|
|
976 |
list2 retractInterrestFor:selectionForwarder.
|
|
977 |
list2 selection:(mappings at:raw asSymbol) asString.
|
|
978 |
list2 onChangeSend:#showRawKey to:selectionForwarder.
|
|
979 |
].
|
|
980 |
selectionForwarder respondTo:#showRawKey
|
|
981 |
with:[
|
|
982 |
|f raw|
|
|
983 |
|
|
984 |
f := list2 selection.
|
|
985 |
list1 retractInterrestFor:selectionForwarder.
|
|
986 |
raw := mappings keyAtValue:f asString.
|
|
987 |
raw isNil ifTrue:[
|
|
988 |
raw := mappings keyAtValue:f first.
|
|
989 |
raw isNil ifTrue:[
|
|
990 |
raw := mappings keyAtValue:f asSymbol.
|
|
991 |
]
|
|
992 |
].
|
|
993 |
list1 selection:raw.
|
|
994 |
list1 onChangeSend:#showFunction to:selectionForwarder.
|
|
995 |
].
|
|
996 |
|
|
997 |
macroForwarder := Plug new.
|
|
998 |
macroForwarder respondTo:#showMacro
|
|
999 |
with:[
|
|
1000 |
|f macro indent|
|
|
1001 |
f := list2 selection.
|
|
1002 |
(f startsWith:'Cmd') ifTrue:[
|
|
1003 |
f := f copyFrom:4
|
|
1004 |
].
|
|
1005 |
macro := FunctionKeySequences at:(f asSymbol) ifAbsent:nil.
|
|
1006 |
macro notNil ifTrue:[
|
|
1007 |
macro := macro asStringCollection.
|
|
1008 |
indent := macro
|
|
1009 |
inject:99999 into:[:min :element |
|
|
1010 |
|stripped|
|
|
1011 |
|
|
1012 |
stripped := element withoutLeadingSeparators.
|
|
1013 |
stripped size == 0 ifTrue:[
|
|
1014 |
min
|
|
1015 |
] ifFalse:[
|
|
1016 |
min min:(element size - stripped size)
|
|
1017 |
]
|
|
1018 |
].
|
|
1019 |
indent ~~ 0 ifTrue:[
|
|
1020 |
macro := macro collect:[:line |
|
|
1021 |
line size > indent ifTrue:[
|
|
1022 |
line copyFrom:indent+1
|
|
1023 |
] ifFalse:[
|
|
1024 |
line
|
|
1025 |
].
|
|
1026 |
]
|
|
1027 |
].
|
|
1028 |
].
|
|
1029 |
macroTextView contents:macro.
|
|
1030 |
].
|
|
1031 |
|
|
1032 |
list1 := SelectionInList with:listOfRawKeys.
|
|
1033 |
list1 onChangeSend:#showFunction to:selectionForwarder.
|
|
1034 |
list2 := SelectionInList with:listOfFunctions.
|
|
1035 |
list2 onChangeSend:#showRawKey to:selectionForwarder.
|
|
1036 |
list2 onChangeSend:#showMacro to:macroForwarder.
|
|
1037 |
|
|
1038 |
box := Dialog new.
|
|
1039 |
box label:(resources string:'Keyboard mappings').
|
|
1040 |
|
|
1041 |
l := box addTextLabel:(resources string:'KEY_MSG') withCRs.
|
112
|
1042 |
l adjust:#left; borderWidth:0.
|
107
|
1043 |
|
|
1044 |
frame := View new.
|
|
1045 |
frame extent:300 @ 300.
|
112
|
1046 |
frame borderWidth:0.
|
107
|
1047 |
|
|
1048 |
listView1 := ScrollableView for:SelectionInListView in:frame.
|
|
1049 |
listView1 model:list1.
|
108
|
1050 |
listView1 origin:0.0@0.0 corner:0.5@1.0; inset:2.
|
107
|
1051 |
|
|
1052 |
listView2 := ScrollableView for:SelectionInListView in:frame.
|
|
1053 |
listView2 model:list2.
|
108
|
1054 |
listView2 origin:0.5@0.0 corner:1.0@1.0; inset:2.
|
107
|
1055 |
|
|
1056 |
frame topInset:box yPosition.
|
|
1057 |
box addComponent:frame withExtent:350@200.
|
108
|
1058 |
box makeTabable:listView1.
|
|
1059 |
box makeTabable:listView2.
|
107
|
1060 |
frame origin:0.0@0.0 corner:1.0@0.6.
|
|
1061 |
|
|
1062 |
box addVerticalSpace.
|
|
1063 |
|
|
1064 |
l := box addTextLabel:(resources string:'Macro text (if any):') withCRs.
|
112
|
1065 |
l adjust:#left; borderWidth:0.
|
107
|
1066 |
l origin:0.0@0.6 corner:1.0@0.6.
|
|
1067 |
l topInset:(View viewSpacing).
|
|
1068 |
l bottomInset:(l preferredExtent y negated - View viewSpacing).
|
|
1069 |
|
|
1070 |
macroTextView := HVScrollableView for:TextView miniScroller:true.
|
108
|
1071 |
box addComponent:macroTextView tabable:true.
|
107
|
1072 |
macroTextView origin:0.0@0.6 corner:1.0@1.0.
|
|
1073 |
y := box yPosition.
|
|
1074 |
|
109
|
1075 |
box "addAbortButton;" addOkButton.
|
112
|
1076 |
macroTextView topInset:(l preferredExtent y + 5).
|
107
|
1077 |
macroTextView bottomInset:(box preferredExtent y - y).
|
|
1078 |
|
|
1079 |
box showAtPointer.
|
|
1080 |
|
|
1081 |
box accepted ifTrue:[
|
112
|
1082 |
"no action yet ..."
|
107
|
1083 |
]
|
|
1084 |
!
|
|
1085 |
|
94
|
1086 |
compilerSettings
|
100
|
1087 |
|box warnings warnSTX warnUnderscore warnOldStyle allowUnderscore immutableArrays
|
110
|
1088 |
warnSTXBox warnUnderscoreBox warnOldStyleBox
|
113
|
1089 |
loadBinaries compileLazy catchRedefs
|
110
|
1090 |
stcCompilation compilationList stcCompilationOptions
|
113
|
1091 |
warnEnabler compileEnabler check|
|
100
|
1092 |
|
|
1093 |
warnings := Compiler warnings asValue.
|
93
|
1094 |
|
|
1095 |
warnSTX := Compiler warnSTXSpecials asValue.
|
100
|
1096 |
warnUnderscore := Compiler warnUnderscoreInIdentifier asValue.
|
|
1097 |
warnOldStyle := Compiler warnOldStyleAssignment asValue.
|
93
|
1098 |
allowUnderscore := Compiler allowUnderscoreInIdentifier asValue.
|
|
1099 |
immutableArrays := Compiler arraysAreImmutable asValue.
|
110
|
1100 |
stcCompilationOptions := #( always default never).
|
|
1101 |
stcCompilation := SelectionInList new list:(resources array:#('always' 'primitive code only' 'never')).
|
|
1102 |
stcCompilation selectionIndex:2.
|
93
|
1103 |
|
113
|
1104 |
loadBinaries := Smalltalk loadBinaries asValue.
|
|
1105 |
compileLazy := Autoload compileLazy asValue.
|
|
1106 |
catchRedefs := Class catchMethodRedefinitions asValue.
|
|
1107 |
|
|
1108 |
warnEnabler := Plug new.
|
|
1109 |
warnEnabler
|
100
|
1110 |
respondTo:#check
|
|
1111 |
with:[warnings value ifTrue:[
|
|
1112 |
warnSTXBox enable.
|
|
1113 |
warnOldStyleBox enable.
|
|
1114 |
allowUnderscore value ifTrue:[
|
|
1115 |
warnUnderscoreBox enable.
|
|
1116 |
] ifFalse:[
|
|
1117 |
warnUnderscoreBox disable.
|
|
1118 |
].
|
|
1119 |
] ifFalse:[
|
|
1120 |
warnSTXBox disable.
|
|
1121 |
warnUnderscoreBox disable.
|
|
1122 |
warnOldStyleBox disable.
|
|
1123 |
]].
|
|
1124 |
|
113
|
1125 |
compileEnabler := Plug new.
|
|
1126 |
compileEnabler
|
|
1127 |
respondTo:#check
|
|
1128 |
with:[|off|
|
|
1129 |
ObjectFileLoader isNil ifTrue:[
|
|
1130 |
off := true
|
|
1131 |
] ifFalse:[
|
|
1132 |
Compiler canCreateMachineCode ifFalse:[
|
|
1133 |
off := true
|
|
1134 |
] ifTrue:[
|
|
1135 |
off := loadBinaries value not
|
|
1136 |
]
|
|
1137 |
].
|
|
1138 |
off ifTrue:[
|
|
1139 |
stcCompilation selectionIndex:3.
|
|
1140 |
compilationList disable.
|
|
1141 |
] ifFalse:[
|
|
1142 |
compilationList enable.
|
|
1143 |
]].
|
|
1144 |
|
|
1145 |
warnings onChangeSend:#check to:warnEnabler.
|
|
1146 |
allowUnderscore onChangeSend:#check to:warnEnabler.
|
100
|
1147 |
|
93
|
1148 |
box := DialogBox new.
|
106
|
1149 |
box label:(resources string:'Compiler settings').
|
93
|
1150 |
|
113
|
1151 |
box addCheckBox:(resources string:'lazy compilation when autoloading') on:compileLazy.
|
|
1152 |
box addCheckBox:(resources string:'catch method redefinitions') on:catchRedefs.
|
100
|
1153 |
box addHorizontalLine.
|
|
1154 |
|
116
|
1155 |
check := box addCheckBox:(resources string:'load binary objects, if present') on:loadBinaries.
|
110
|
1156 |
compilationList := box addPopUpList:(resources string:'compilation to machine code') on:stcCompilation.
|
|
1157 |
stcCompilation selectionIndex:( stcCompilationOptions indexOf:(Compiler stcCompilation) ifAbsent:2).
|
113
|
1158 |
|
110
|
1159 |
box addVerticalSpace.
|
|
1160 |
box addHorizontalLine.
|
113
|
1161 |
|
|
1162 |
ObjectFileLoader isNil ifTrue:[
|
|
1163 |
loadBinaries value:false.
|
|
1164 |
check disable
|
|
1165 |
].
|
|
1166 |
loadBinaries onChangeSend:#check to:compileEnabler.
|
110
|
1167 |
|
|
1168 |
"/ if there is no compiler around,
|
|
1169 |
"/ change to compile nothing, and disable the checkBoxes
|
|
1170 |
Compiler canCreateMachineCode ifFalse:[
|
117
|
1171 |
loadBinaries value:false.
|
110
|
1172 |
stcCompilation selectionIndex:3.
|
117
|
1173 |
check disable.
|
110
|
1174 |
compilationList disable.
|
|
1175 |
].
|
|
1176 |
|
113
|
1177 |
box addCheckBox:(resources string:'allow underscore in identifiers') on:allowUnderscore.
|
|
1178 |
box addVerticalSpace.
|
|
1179 |
box addCheckBox:(resources string:'literal arrays are immutable') on:immutableArrays.
|
|
1180 |
box addHorizontalLine.
|
|
1181 |
|
106
|
1182 |
box addCheckBox:(resources string:'warnings') on:warnings.
|
100
|
1183 |
box addVerticalSpace.
|
|
1184 |
box leftIndent:30.
|
106
|
1185 |
warnSTXBox := box addCheckBox:(resources string:'ST/X language extensions') on:warnSTX.
|
100
|
1186 |
box addVerticalSpace.
|
106
|
1187 |
warnUnderscoreBox := box addCheckBox:(resources string:'underscores in identifiers') on:warnUnderscore.
|
100
|
1188 |
box addVerticalSpace.
|
106
|
1189 |
warnOldStyleBox := box addCheckBox:(resources string:'oldStyle assignment') on:warnOldStyle.
|
100
|
1190 |
box addVerticalSpace.
|
|
1191 |
box leftIndent:0.
|
93
|
1192 |
|
96
|
1193 |
box addAbortButton; addOkButton.
|
100
|
1194 |
|
113
|
1195 |
warnEnabler check.
|
93
|
1196 |
box showAtPointer.
|
|
1197 |
|
96
|
1198 |
box accepted ifTrue:[
|
100
|
1199 |
Compiler warnings:warnings value.
|
93
|
1200 |
Compiler warnSTXSpecials:warnSTX value.
|
100
|
1201 |
Compiler warnOldStyleAssignment:warnOldStyle value.
|
|
1202 |
Compiler warnUnderscoreInIdentifier:warnUnderscore value.
|
93
|
1203 |
Compiler allowUnderscoreInIdentifier:allowUnderscore value.
|
|
1204 |
Compiler arraysAreImmutable:immutableArrays value.
|
113
|
1205 |
Compiler stcCompilation:(stcCompilationOptions at:stcCompilation selectionIndex).
|
|
1206 |
Smalltalk loadBinaries:loadBinaries value.
|
|
1207 |
Autoload compileLazy:compileLazy value.
|
|
1208 |
Class catchMethodRedefinitions:catchRedefs value.
|
110
|
1209 |
]
|
|
1210 |
!
|
|
1211 |
|
|
1212 |
messageSettings
|
|
1213 |
|box vmInfo vmErrors classInfos|
|
|
1214 |
|
|
1215 |
vmInfo := ObjectMemory infoPrinting asValue.
|
|
1216 |
vmErrors := ObjectMemory debugPrinting asValue.
|
|
1217 |
classInfos := Object infoPrinting asValue.
|
|
1218 |
|
|
1219 |
box := DialogBox new.
|
|
1220 |
box label:(resources string:'Messages').
|
|
1221 |
"/ box extent:200@300.
|
|
1222 |
|
|
1223 |
box addCheckBox:(resources string:'VM info messages') on:vmInfo.
|
|
1224 |
box addCheckBox:(resources string:'VM error messages') on:vmErrors.
|
|
1225 |
box addHorizontalLine.
|
|
1226 |
|
|
1227 |
box addCheckBox:(resources string:'Other info messages') on:classInfos.
|
|
1228 |
|
|
1229 |
box addAbortButton; addOkButton.
|
|
1230 |
box showAtPointer.
|
|
1231 |
|
|
1232 |
box accepted ifTrue:[
|
|
1233 |
ObjectMemory infoPrinting:vmInfo value.
|
|
1234 |
ObjectMemory debugPrinting:vmErrors value.
|
|
1235 |
Object infoPrinting:classInfos value.
|
93
|
1236 |
]
|
94
|
1237 |
!
|
|
1238 |
|
|
1239 |
miscSettings
|
120
|
1240 |
|box check logDoits historyLines shadows updChanges|
|
94
|
1241 |
|
|
1242 |
logDoits := Smalltalk logDoits asValue.
|
100
|
1243 |
shadows := PopUpView shadows asValue.
|
102
|
1244 |
updChanges := Class updatingChanges asValue.
|
122
|
1245 |
historyLines := (HistoryManager notNil and:[HistoryManager isActive]) asValue.
|
94
|
1246 |
|
|
1247 |
box := DialogBox new.
|
106
|
1248 |
box label:(resources string:'Other settings').
|
|
1249 |
"/ box extent:200@300.
|
94
|
1250 |
|
106
|
1251 |
box addCheckBox:(resources string:'log compiles in changes file') on:updChanges.
|
|
1252 |
box addCheckBox:(resources string:'log doIts in changes file') on:logDoits.
|
122
|
1253 |
check := box addCheckBox:(resources string:'keep history line in methods') on:historyLines.
|
|
1254 |
HistoryManager isNil ifTrue:[check disable].
|
|
1255 |
|
100
|
1256 |
box addHorizontalLine.
|
102
|
1257 |
|
106
|
1258 |
box addCheckBox:(resources string:'shadows under popup views') on:shadows.
|
94
|
1259 |
|
96
|
1260 |
box addAbortButton; addOkButton.
|
94
|
1261 |
box showAtPointer.
|
|
1262 |
|
96
|
1263 |
box accepted ifTrue:[
|
122
|
1264 |
HistoryManager notNil ifTrue:[
|
|
1265 |
historyLines value ifTrue:[
|
|
1266 |
HistoryManager activate
|
|
1267 |
] ifFalse:[
|
|
1268 |
HistoryManager deactivate
|
|
1269 |
].
|
120
|
1270 |
].
|
94
|
1271 |
Smalltalk logDoits:logDoits value.
|
100
|
1272 |
PopUpView shadows:shadows value.
|
102
|
1273 |
Class updateChanges:updChanges value.
|
94
|
1274 |
]
|
122
|
1275 |
|
|
1276 |
"Modified: 27.8.1995 / 02:07:26 / claus"
|
90
|
1277 |
! !
|
|
1278 |
|
86
|
1279 |
!NewLauncher methodsFor:'infoview update'!
|
|
1280 |
|
|
1281 |
info
|
100
|
1282 |
|project projectName projectDir packageName|
|
86
|
1283 |
|
93
|
1284 |
(Project isNil or:[(project := Project current) isNil]) ifTrue:[
|
88
|
1285 |
projectName := '* none *'.
|
|
1286 |
projectDir := '.'.
|
100
|
1287 |
packageName := '* none *'.
|
86
|
1288 |
] ifFalse:[
|
88
|
1289 |
projectName := project name.
|
|
1290 |
projectDir := project directory.
|
100
|
1291 |
packageName := project packageName.
|
86
|
1292 |
].
|
|
1293 |
|
|
1294 |
^ resources
|
105
|
1295 |
string:'project: ''%1'' fileOut to: ''%3'' package: ''%2'''
|
100
|
1296 |
withArgs:(Array
|
|
1297 |
with:projectName
|
|
1298 |
with:packageName
|
|
1299 |
with:(projectDir contractTo:30))
|
86
|
1300 |
! !
|
|
1301 |
|
|
1302 |
!NewLauncher methodsFor:'actions - about & help'!
|
|
1303 |
|
93
|
1304 |
toggleActiveHelp:aBoolean
|
|
1305 |
ActiveHelp notNil ifTrue:[
|
|
1306 |
helpIsOn := aBoolean.
|
|
1307 |
helpIsOn ifTrue:[
|
|
1308 |
ActiveHelp start
|
|
1309 |
] ifFalse:[
|
|
1310 |
ActiveHelp stop
|
|
1311 |
]
|
|
1312 |
].
|
|
1313 |
!
|
|
1314 |
|
86
|
1315 |
about
|
|
1316 |
|box|
|
|
1317 |
|
|
1318 |
box := AboutBox new.
|
|
1319 |
box autoHideAfter:10 with:[].
|
|
1320 |
box showAtCenter
|
|
1321 |
!
|
|
1322 |
|
89
|
1323 |
startDocumentationTool
|
105
|
1324 |
"
|
|
1325 |
although that one is not yet finished,
|
|
1326 |
its better than nothing ...
|
|
1327 |
"
|
|
1328 |
XtHTML notNil ifTrue:[
|
108
|
1329 |
"
|
|
1330 |
temporary kludge;
|
|
1331 |
not all machines can autoload binaries;
|
|
1332 |
however, on my SGI (which can) we want it
|
|
1333 |
to load automatically.
|
|
1334 |
"
|
|
1335 |
XtHTML isLoaded ifFalse:[
|
|
1336 |
(OperatingSystem getSystemType = 'iris') ifTrue:[
|
|
1337 |
XtHTML autoload
|
|
1338 |
]
|
|
1339 |
].
|
|
1340 |
XtHTML isLoaded ifTrue:[
|
|
1341 |
XtHTML openFull.
|
|
1342 |
^ self
|
|
1343 |
].
|
105
|
1344 |
].
|
89
|
1345 |
|
106
|
1346 |
self warn:'Sorry, the ST/X HTML reader is not (yet)
|
116
|
1347 |
included in this architectures release.
|
108
|
1348 |
|
106
|
1349 |
Please use Mosaic, netscape, chimera or any
|
116
|
1350 |
other HTML viewer to see the documentation.
|
|
1351 |
|
|
1352 |
The documentation is found in the ''doc/online'' directory.'.
|
86
|
1353 |
! !
|
|
1354 |
|
|
1355 |
!NewLauncher methodsFor:'actions - tools'!
|
|
1356 |
|
|
1357 |
startProcessMonitor
|
|
1358 |
ProcessMonitor open
|
|
1359 |
!
|
|
1360 |
|
|
1361 |
startMemoryMonitor
|
|
1362 |
MemoryMonitor open
|
|
1363 |
!
|
|
1364 |
|
93
|
1365 |
startEventMonitor
|
|
1366 |
EventMonitor open
|
|
1367 |
!
|
|
1368 |
|
86
|
1369 |
startMemoryUsageView
|
|
1370 |
MemoryUsageView open
|
|
1371 |
!
|
|
1372 |
|
|
1373 |
startWindowTreeView
|
|
1374 |
|v|
|
|
1375 |
|
|
1376 |
v := self pickAView.
|
|
1377 |
v notNil ifTrue:[
|
93
|
1378 |
WindowTreeView openOn:v topView
|
86
|
1379 |
]
|
|
1380 |
!
|
|
1381 |
|
120
|
1382 |
removeAllBreakAndTracePoints
|
|
1383 |
MessageTracer cleanup
|
|
1384 |
!
|
|
1385 |
|
93
|
1386 |
fullScreenHardcopy
|
|
1387 |
"after a second (to allow redraw of views under menu ...),
|
|
1388 |
save the contents of the whole screen."
|
|
1389 |
|
|
1390 |
Processor addTimedBlock:[
|
|
1391 |
self saveScreenImage:(Image fromScreen) defaultName:'screen'
|
|
1392 |
] afterSeconds:1
|
|
1393 |
!
|
|
1394 |
|
|
1395 |
startFullWindowTreeView
|
|
1396 |
WindowTreeView open
|
|
1397 |
!
|
|
1398 |
|
|
1399 |
viewInspect
|
86
|
1400 |
|v|
|
|
1401 |
|
|
1402 |
v := self pickAView.
|
|
1403 |
v notNil ifTrue:[
|
88
|
1404 |
v topView inspect
|
86
|
1405 |
]
|
|
1406 |
|
|
1407 |
!
|
|
1408 |
|
|
1409 |
viewDestroy
|
|
1410 |
|v|
|
|
1411 |
|
|
1412 |
v := self pickAView.
|
|
1413 |
v notNil ifTrue:[
|
88
|
1414 |
v topView destroy
|
86
|
1415 |
]
|
93
|
1416 |
!
|
86
|
1417 |
|
93
|
1418 |
screenHardcopy
|
|
1419 |
"after a second (to allow redraw of views under menu ...),
|
|
1420 |
let user specify a rectangular area on the screen
|
|
1421 |
and save its contents."
|
|
1422 |
|
|
1423 |
|area|
|
|
1424 |
|
|
1425 |
Processor addTimedBlock:[
|
|
1426 |
area := Rectangle fromUser.
|
|
1427 |
(area width > 0 and:[area height > 0]) ifTrue:[
|
|
1428 |
self saveScreenImage:(Image fromScreen:area) defaultName:'hardcopy'
|
|
1429 |
]
|
|
1430 |
] afterSeconds:1
|
|
1431 |
!
|
|
1432 |
|
|
1433 |
viewHardcopy
|
|
1434 |
"after a second (to allow redraw of views under menu ...),
|
|
1435 |
let user specify a view and save its contents."
|
|
1436 |
|
|
1437 |
Processor addTimedBlock:[
|
|
1438 |
|v|
|
|
1439 |
|
106
|
1440 |
v := Screen current viewFromUser.
|
93
|
1441 |
v notNil ifTrue:[
|
|
1442 |
self saveScreenImage:(Image fromView:(v topView)) defaultName:'hardcopy'
|
|
1443 |
]
|
|
1444 |
] afterSeconds:1
|
86
|
1445 |
! !
|
|
1446 |
|
|
1447 |
!NewLauncher methodsFor:'actions - goodies'!
|
|
1448 |
|
|
1449 |
startNewsTool
|
|
1450 |
NewsView open
|
|
1451 |
!
|
|
1452 |
|
|
1453 |
startMailTool
|
|
1454 |
MailView open
|
|
1455 |
!
|
|
1456 |
|
|
1457 |
startClock
|
|
1458 |
RoundClock open
|
|
1459 |
!
|
|
1460 |
|
|
1461 |
startCalendar
|
|
1462 |
Calendar open
|
|
1463 |
! !
|
|
1464 |
|
|
1465 |
!NewLauncher methodsFor:'change & update'!
|
|
1466 |
|
|
1467 |
update:something with:aParameter from:changedObject
|
|
1468 |
((something == #currentProject)
|
|
1469 |
or:[changedObject == Project]) ifTrue:[
|
|
1470 |
self changed:#info.
|
|
1471 |
^ self
|
|
1472 |
].
|
|
1473 |
! !
|
|
1474 |
|
|
1475 |
!NewLauncher methodsFor:'actions - file'!
|
|
1476 |
|
|
1477 |
snapshot
|
|
1478 |
|saveBox|
|
|
1479 |
|
|
1480 |
saveBox := EnterBox title:(resources at:'filename for image:') withCRs.
|
|
1481 |
saveBox okText:(resources at:'save').
|
|
1482 |
saveBox action:[:fileName |
|
|
1483 |
(ObjectMemory snapShotOn:fileName) ifFalse:[
|
|
1484 |
"
|
|
1485 |
snapshot failed for some reason (disk full, no permission etc.)
|
|
1486 |
"
|
|
1487 |
self warn:(resources string:'failed to save snapshot image (disk full or not writable)').
|
|
1488 |
]
|
|
1489 |
].
|
|
1490 |
|
|
1491 |
saveBox initialText:(ObjectMemory nameForSnapshot).
|
|
1492 |
saveBox label:'save image'.
|
|
1493 |
saveBox showAtPointer
|
|
1494 |
|
|
1495 |
!
|
|
1496 |
|
|
1497 |
exit
|
|
1498 |
(self confirm:(resources string:'Are you certain you want to exit without saving ?'))
|
|
1499 |
ifTrue:[
|
100
|
1500 |
self saveAllViews.
|
86
|
1501 |
Smalltalk exit
|
|
1502 |
]
|
|
1503 |
!
|
|
1504 |
|
|
1505 |
snapshotAndExit
|
|
1506 |
|saveBox|
|
|
1507 |
|
|
1508 |
saveBox := EnterBox title:(resources at:'filename for image:') withCRs.
|
|
1509 |
saveBox okText:(resources at:'save & exit').
|
|
1510 |
saveBox action:[:fileName |
|
|
1511 |
(ObjectMemory snapShotOn:fileName) ifFalse:[
|
|
1512 |
"
|
|
1513 |
snapshot failed for some reason (disk full, no permission etc.)
|
|
1514 |
Do NOT exit in this case.
|
|
1515 |
"
|
|
1516 |
self warn:(resources string:'failed to save snapshot image (disk full or not writable)').
|
|
1517 |
] ifTrue:[
|
|
1518 |
"
|
100
|
1519 |
saveAllViews tells all views to shutdown neatly
|
86
|
1520 |
(i.e. offer a chance to save the contents to a file).
|
|
1521 |
|
|
1522 |
This is NOT required - all data should be in the snapshot ...
|
|
1523 |
... however, if remote disks/mountable filesystems are involved,
|
|
1524 |
which may not be present the next time, it may make sense to
|
|
1525 |
uncomment it and query for saving - time will show which is better.
|
|
1526 |
"
|
|
1527 |
"
|
100
|
1528 |
self saveAllViews.
|
86
|
1529 |
"
|
|
1530 |
Smalltalk exit
|
|
1531 |
]
|
|
1532 |
].
|
|
1533 |
|
|
1534 |
saveBox initialText:(ObjectMemory nameForSnapshot).
|
|
1535 |
saveBox label:'save image & exit'.
|
|
1536 |
saveBox showAtPointer
|
|
1537 |
|
118
|
1538 |
!
|
|
1539 |
|
|
1540 |
objectModuleDialog
|
125
|
1541 |
|allModules moduleNames subModuleNames getModules
|
|
1542 |
box registered l unloadButton
|
128
|
1543 |
moduleList list1 list2 listView1 listView2 frame infoView
|
|
1544 |
y|
|
118
|
1545 |
|
128
|
1546 |
allModules := ObjectMemory binaryModuleInfo asOrderedCollection.
|
125
|
1547 |
"/ sorting by reverse id brings newest ones to the top (a side effect)
|
|
1548 |
allModules sort:[:a :b | (a at:#id) > (b at:#id)].
|
118
|
1549 |
|
128
|
1550 |
list1 := SelectionInList with:(allModules collect:[:entry | (entry at:#name)]).
|
125
|
1551 |
list2 := SelectionInList new.
|
118
|
1552 |
|
|
1553 |
box := Dialog new.
|
125
|
1554 |
box label:(resources string:'Package dialog').
|
|
1555 |
|
128
|
1556 |
l := box addTextLabel:(resources string:'Objects:').
|
125
|
1557 |
l adjust:#left; borderWidth:0.
|
118
|
1558 |
|
125
|
1559 |
listView1 := HVScrollableView for:SelectionInListView miniScrollerH:true.
|
|
1560 |
listView1 model:list1.
|
128
|
1561 |
listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2.
|
125
|
1562 |
listView1 action:[:sel |
|
128
|
1563 |
|info classNames tabs|
|
118
|
1564 |
|
125
|
1565 |
info := allModules at:sel.
|
128
|
1566 |
|
|
1567 |
tabs := TabulatorSpecification unit:#inch positions:#(0 3).
|
|
1568 |
|
|
1569 |
"/ fill bottom list with class-info
|
|
1570 |
|
|
1571 |
classNames := (info at:#classNames) asSortedCollection.
|
|
1572 |
classNames := classNames collect:[:cName |
|
|
1573 |
|cls entry rev listEntry|
|
|
1574 |
|
|
1575 |
listEntry := MultiColListEntry new:2 tabulatorSpecification:tabs.
|
|
1576 |
listEntry colAt:1 put:cName.
|
|
1577 |
|
|
1578 |
cls := Smalltalk classNamed:cName.
|
|
1579 |
cls isNil ifTrue:[
|
|
1580 |
listEntry colAt:2 put:'(class removed)'.
|
|
1581 |
] ifFalse:[
|
|
1582 |
rev := cls revision.
|
|
1583 |
rev notNil ifTrue:[
|
|
1584 |
listEntry colAt:2 put:'(rev' , rev , ')'
|
|
1585 |
].
|
|
1586 |
].
|
|
1587 |
listEntry
|
|
1588 |
].
|
|
1589 |
list2 list:classNames.
|
125
|
1590 |
(info at:#dynamic) ifTrue:[
|
|
1591 |
unloadButton enable.
|
|
1592 |
] ifFalse:[
|
|
1593 |
unloadButton disable.
|
|
1594 |
].
|
|
1595 |
].
|
|
1596 |
|
|
1597 |
box addComponent:listView1 tabable:true.
|
128
|
1598 |
listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2.
|
118
|
1599 |
|
125
|
1600 |
l := box addTextLabel:(resources string:'contained classes/subsets:').
|
|
1601 |
l adjust:#left; borderWidth:0.
|
128
|
1602 |
l origin:0.0@0.4 corner:1.0@0.4.
|
125
|
1603 |
l topInset:(View viewSpacing).
|
128
|
1604 |
l bottomInset:((l preferredExtent y) negated - View viewSpacing).
|
125
|
1605 |
|
|
1606 |
listView2 := HVScrollableView for:SelectionInListView miniScrollerH:true.
|
128
|
1607 |
listView2 model:list2; printItems:false.
|
125
|
1608 |
box addComponent:listView2 tabable:true.
|
128
|
1609 |
listView2 origin:0.0@0.4 corner:1.0@1.0. "/ ; inset:2.
|
125
|
1610 |
listView2 disable.
|
118
|
1611 |
|
|
1612 |
unloadButton := Button label:(resources string:'unload').
|
|
1613 |
unloadButton action:[
|
125
|
1614 |
|info|
|
|
1615 |
|
|
1616 |
info := allModules at:list1 selectionIndex.
|
|
1617 |
self withWaitCursorDo:[
|
|
1618 |
box withWaitCursorDo:[
|
|
1619 |
ObjectFileLoader unloadObjectFile:(info at:#pathName).
|
128
|
1620 |
allModules := ObjectMemory binaryModuleInfo asOrderedCollection.
|
125
|
1621 |
allModules sort:[:a :b | (a at:#id) > (b at:#id)].
|
|
1622 |
|
|
1623 |
list1 list:(allModules collect:[:entry | entry at:#name]).
|
|
1624 |
list2 list:nil.
|
|
1625 |
unloadButton disable.
|
119
|
1626 |
]
|
118
|
1627 |
]
|
|
1628 |
].
|
125
|
1629 |
unloadButton disable.
|
|
1630 |
|
118
|
1631 |
box addButton:unloadButton.
|
|
1632 |
box addAbortButtonLabelled:(resources string:'close').
|
|
1633 |
|
|
1634 |
y := box yPosition.
|
125
|
1635 |
listView2 topInset:(l preferredExtent y + 5).
|
|
1636 |
listView2 bottomInset:(box preferredExtent y - y).
|
118
|
1637 |
|
128
|
1638 |
box width:400; height:400; sizeFixed:true.
|
118
|
1639 |
box showAtPointer.
|
125
|
1640 |
|
128
|
1641 |
"Modified: 30.8.1995 / 18:04:10 / claus"
|
86
|
1642 |
! !
|
|
1643 |
|
|
1644 |
!NewLauncher methodsFor:'actions - projects'!
|
|
1645 |
|
|
1646 |
newProject
|
93
|
1647 |
Project notNil ifTrue:[
|
|
1648 |
(ProjectView for:(Project new)) open
|
|
1649 |
]
|
86
|
1650 |
!
|
|
1651 |
|
|
1652 |
selectProject
|
|
1653 |
|list box|
|
|
1654 |
|
93
|
1655 |
Project notNil ifTrue:[
|
|
1656 |
list := Project allInstances.
|
|
1657 |
box := ListSelectionBox new.
|
|
1658 |
box list:(list collect:[:p | p name]).
|
|
1659 |
box title:(resources string:'select a project').
|
|
1660 |
box action:[:selection |
|
|
1661 |
|project|
|
86
|
1662 |
|
93
|
1663 |
project := list detect:[:p | p name = selection] ifNone:[nil].
|
|
1664 |
project isNil ifTrue:[
|
106
|
1665 |
Transcript showCr:'no such project.'
|
93
|
1666 |
] ifFalse:[
|
|
1667 |
project showViews.
|
|
1668 |
Project current:project
|
|
1669 |
]
|
|
1670 |
].
|
|
1671 |
box showAtPointer
|
|
1672 |
]
|
86
|
1673 |
! !
|
|
1674 |
|
|
1675 |
!NewLauncher methodsFor:'private'!
|
|
1676 |
|
106
|
1677 |
reopenLauncher
|
|
1678 |
"for now (since style & language settings currently do
|
|
1679 |
not affect living views ...)"
|
|
1680 |
|
|
1681 |
|contents|
|
|
1682 |
|
|
1683 |
contents := Transcript endEntry; contents.
|
|
1684 |
self class open.
|
|
1685 |
Transcript contents:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor
|
|
1686 |
!
|
|
1687 |
|
100
|
1688 |
saveAllViews
|
86
|
1689 |
"tell each topview that we are going to terminate and give it chance
|
|
1690 |
to save its contents."
|
|
1691 |
|
|
1692 |
ObjectMemory changed:#aboutToExit
|
|
1693 |
!
|
|
1694 |
|
|
1695 |
pickAView
|
|
1696 |
|v|
|
|
1697 |
|
|
1698 |
(Delay forSeconds:1) wait.
|
106
|
1699 |
v := Screen current viewFromUser.
|
86
|
1700 |
v isNil ifTrue:[
|
88
|
1701 |
self warn:'sorry, this is not a smalltalk view'.
|
|
1702 |
^ nil
|
86
|
1703 |
].
|
|
1704 |
^ v
|
93
|
1705 |
!
|
|
1706 |
|
|
1707 |
saveScreenImage:anImage defaultName:defaultName
|
|
1708 |
"save an image into a file
|
|
1709 |
- ask user for filename using a fileSelectionBox."
|
|
1710 |
|
|
1711 |
|fileName|
|
|
1712 |
|
|
1713 |
fileName := Dialog
|
|
1714 |
requestFileName:'save image in:'
|
|
1715 |
default:(defaultName , '.tiff')
|
|
1716 |
ok:'save'
|
|
1717 |
abort:'abort'
|
|
1718 |
pattern:'*.tiff'.
|
|
1719 |
|
|
1720 |
fileName notNil ifTrue:[
|
|
1721 |
anImage saveOn:fileName
|
|
1722 |
].
|
86
|
1723 |
! !
|
|
1724 |
|
90
|
1725 |
!NewLauncher methodsFor:'actions - demos'!
|
|
1726 |
|
|
1727 |
openDemo:className
|
|
1728 |
(Smalltalk at:className) open
|
|
1729 |
|
|
1730 |
!
|
|
1731 |
|
|
1732 |
startTicTacToe
|
|
1733 |
TicTacToe open
|
|
1734 |
!
|
|
1735 |
|
|
1736 |
startTetris
|
|
1737 |
Tetris open
|
|
1738 |
! !
|
|
1739 |
|
86
|
1740 |
!NewLauncher methodsFor:'help'!
|
|
1741 |
|
|
1742 |
helpTextFor:aComponent
|
126
|
1743 |
|sel s|
|
86
|
1744 |
|
|
1745 |
aComponent == transcript ifTrue:[
|
126
|
1746 |
s := 'TRANSCRIPT_HELP'
|
88
|
1747 |
].
|
|
1748 |
|
|
1749 |
aComponent == infoView ifTrue:[
|
126
|
1750 |
s := 'INFOVIEW_HELP'
|
86
|
1751 |
].
|
|
1752 |
|
|
1753 |
(buttonPanel subViews includes:aComponent) ifTrue:[
|
88
|
1754 |
"kludge: look for its change selector"
|
94
|
1755 |
sel := aComponent changeMessage.
|
88
|
1756 |
sel == #startSystemBrowser ifTrue:[
|
126
|
1757 |
s := 'SBROWSER_BUTTON_HELP'
|
88
|
1758 |
].
|
|
1759 |
sel == #startFileBrowser ifTrue:[
|
126
|
1760 |
s := 'FBROWSER_BUTTON_HELP'
|
120
|
1761 |
].
|
|
1762 |
sel == #startChangesBrowser ifTrue:[
|
126
|
1763 |
s := 'CBROWSER_BUTTON_HELP'
|
88
|
1764 |
].
|
86
|
1765 |
].
|
126
|
1766 |
s notNil ifTrue:[
|
|
1767 |
^ resources string:s
|
|
1768 |
].
|
86
|
1769 |
^ nil
|
|
1770 |
! !
|