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