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