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