author | Claus Gittinger <cg@exept.de> |
Thu, 12 Feb 2004 22:39:34 +0100 | |
changeset 2873 | 8cc978d53a87 |
parent 2860 | 69d838dd825c |
child 2874 | 2b8f8b6a69fb |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
" |
|
12 |
||
77 | 13 |
|
14 |
||
2275 | 15 |
"{ Package: 'stx:libwidg' }" |
16 |
||
77 | 17 |
DialogBox subclass:#FontPanel |
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
18 |
instanceVariableNames:'previewField familyList faceList sizeList revertButton |
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
19 |
currentFamily currentFace currentStyle currentFaceAndStyle |
2843 | 20 |
currentSize currentEncoding selectedFont nameLabel encodingFilter |
21 |
encodingLabel filter encoding' |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
22 |
classVariableNames:'' |
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
23 |
poolDictionaries:'' |
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
24 |
category:'Views-DialogBoxes' |
0 | 25 |
! |
26 |
||
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
27 |
!FontPanel class methodsFor:'documentation'! |
77 | 28 |
|
197 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
||
42 |
||
77 | 43 |
! |
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
this class implements a font chooser. |
|
48 |
||
2826 | 49 |
Notice: |
50 |
this is a very old dialog; |
|
51 |
it was written before the UI-framework was available and is completely |
|
52 |
setup manually (initialize method). |
|
53 |
Therefore, it desperately asks to be rewritten using the UIPainter... |
|
54 |
||
595 | 55 |
[author:] |
56 |
Claus Gittinger |
|
57 |
||
58 |
[see also:] |
|
59 |
Font FontDescription |
|
60 |
View Dialog |
|
61 |
" |
|
62 |
! |
|
63 |
||
64 |
examples |
|
65 |
" |
|
66 |
very simple: |
|
67 |
[exBegin] |
|
68 |
|font| |
|
69 |
||
70 |
font := FontPanel fontFromUser. |
|
655 | 71 |
Transcript showCR:font |
595 | 72 |
[exEnd] |
73 |
||
74 |
||
75 |
with initial font: |
|
76 |
[exBegin] |
|
77 |
|font| |
|
78 |
||
79 |
font := FontPanel |
|
80 |
fontFromUserInitial:(Font |
|
81 |
family:'courier' |
|
82 |
size:12). |
|
655 | 83 |
Transcript showCR:font |
595 | 84 |
[exEnd] |
85 |
||
86 |
||
87 |
with initial font & title: |
|
88 |
[exBegin] |
|
89 |
|font| |
|
90 |
||
91 |
font := FontPanel |
|
92 |
fontFromUserInitial:(Font |
|
93 |
family:'courier' |
|
94 |
size:12) |
|
95 |
title:'select a fooBar font'. |
|
655 | 96 |
Transcript showCR:font |
595 | 97 |
[exEnd] |
98 |
||
99 |
||
100 |
full setup; setting a filter to only present iso fonts |
|
101 |
and callBack action: |
|
102 |
[exBegin] |
|
0 | 103 |
|
585 | 104 |
|panel| |
77 | 105 |
|
585 | 106 |
panel := FontPanel new. |
595 | 107 |
panel label:'hi there - which iso font ?'. |
108 |
panel filter:[:fd | fd encoding notNil |
|
109 |
and:[fd encoding startsWith:'iso']]. |
|
110 |
panel action:[:family :face :style :size | |
|
655 | 111 |
Transcript showCR:'family:' , family. |
112 |
Transcript showCR:'face:' , face. |
|
113 |
Transcript showCR:'style:' , style. |
|
114 |
Transcript showCR:'size:' , size printString. |
|
595 | 115 |
]. |
116 |
panel open |
|
117 |
[exEnd] |
|
77 | 118 |
" |
119 |
! ! |
|
0 | 120 |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
121 |
!FontPanel class methodsFor:'defaults'! |
0 | 122 |
|
197 | 123 |
defaultExtent |
571 | 124 |
"return the default extent of my instances. |
125 |
The value returned here is usually ignored, and |
|
126 |
the value from preferredExtent taken instead." |
|
127 |
||
2842 | 128 |
^ (Screen current pixelPerMillimeter * (150 @ 100)) rounded |
571 | 129 |
|
130 |
"Modified: 22.4.1996 / 23:36:19 / cg" |
|
197 | 131 |
! |
132 |
||
2860 | 133 |
defaultJIS0201SampleString |
134 |
"return the sample jis preview text" |
|
135 |
||
136 |
^ ('The quick brown fox |
|
137 |
jumps over the lazy dog |
|
138 |
||
139 |
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
140 |
abcdefghijklmnopqrstuvwxyz |
|
141 |
1234567890 |
|
142 |
!!@#$%^&*(){}[]:"~;,./<>? |
|
143 |
||
144 |
') |
|
145 |
! |
|
146 |
||
382 | 147 |
defaultJISSampleString |
595 | 148 |
"return the sample jis preview text" |
149 |
||
382 | 150 |
^ ('The quick brown fox |
151 |
jumps over the lazy dog |
|
2860 | 152 |
|
153 |
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
154 |
abcdefghijklmnopqrstuvwxyz |
|
382 | 155 |
1234567890 |
156 |
!!@#$%^&*(){}[]:"~;,./<>? |
|
390
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
157 |
|
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
158 |
\e$B$$$i$C$7$c$$$^$;\e(J \e$B@$4V\e(J |
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
159 |
' withEscapes decodeFrom:#jis7) |
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
160 |
|
595 | 161 |
"Modified: 29.4.1996 / 09:46:11 / cg" |
382 | 162 |
! |
163 |
||
2847 | 164 |
defaultLatin1SampleString |
165 |
"return the sample latin1 preview text" |
|
166 |
||
167 |
|t| |
|
168 |
||
169 |
Smalltalk language == #de ifTrue:[ |
|
170 |
t := 'Franz jagt im komplett verwahrlosten Taxi |
|
171 |
quer durch Bayern'. |
|
172 |
] ifFalse:[ |
|
173 |
t := 'The quick brown fox |
|
174 |
jumps over the lazy dog'. |
|
175 |
]. |
|
176 |
t := t , ' |
|
2860 | 177 |
|
178 |
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
179 |
abcdefghijklmnopqrstuvwxyz |
|
2847 | 180 |
1234567890 |
181 |
!!@#$%^&*(){}[]:"~;,./<>? |
|
182 |
' , |
|
183 |
(Character value:16rE4) asString , "/ umlaut a |
|
184 |
(Character value:16rF6) asString , "/ umlaut o |
|
185 |
(Character value:16rFC) asString , "/ umlaut u |
|
186 |
(Character value:16rC4) asString , "/ umlaut A |
|
187 |
(Character value:16rD6) asString , "/ umlaut O |
|
188 |
(Character value:16rDC) asString , "/ umlaut U |
|
189 |
(Character value:16rDF) asString , "/ sz |
|
190 |
(Character value:233) asString , "/ e-degu |
|
191 |
(Character value:232) asString , "/ e-grave |
|
192 |
(Character value:234) asString , "/ e-circonflex |
|
193 |
(Character value:197) asString , "/ A |
|
2851 | 194 |
(Character value:169) asString , "/ copyright |
195 |
(Character value:164) asString. "/ euro |
|
2847 | 196 |
^ t |
197 |
||
198 |
"Modified: 29.4.1996 / 09:46:19 / cg" |
|
199 |
! |
|
200 |
||
201 |
defaultUnicodeSampleString |
|
202 |
"return the sample unicode preview text" |
|
595 | 203 |
|
2275 | 204 |
|t| |
205 |
||
2286 | 206 |
Smalltalk language == #de ifTrue:[ |
2275 | 207 |
t := 'Franz jagt im komplett verwahrlosten Taxi |
208 |
quer durch Bayern'. |
|
209 |
] ifFalse:[ |
|
210 |
t := 'The quick brown fox |
|
211 |
jumps over the lazy dog'. |
|
212 |
]. |
|
213 |
t := t , ' |
|
2860 | 214 |
|
215 |
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
216 |
abcdefghijklmnopqrstuvwxyz |
|
110 | 217 |
1234567890 |
218 |
!!@#$%^&*(){}[]:"~;,./<>? |
|
219 |
' , |
|
398 | 220 |
(Character value:16rE4) asString , "/ umlaut a |
221 |
(Character value:16rF6) asString , "/ umlaut o |
|
222 |
(Character value:16rFC) asString , "/ umlaut u |
|
223 |
(Character value:16rC4) asString , "/ umlaut A |
|
224 |
(Character value:16rD6) asString , "/ umlaut O |
|
225 |
(Character value:16rDC) asString , "/ umlaut U |
|
226 |
(Character value:16rDF) asString , "/ sz |
|
227 |
(Character value:233) asString , "/ e-degu |
|
228 |
(Character value:232) asString , "/ e-grave |
|
229 |
(Character value:234) asString , "/ e-circonflex |
|
230 |
(Character value:197) asString , "/ A |
|
2276 | 231 |
(Character value:169) asString. "/ copyright |
232 |
^ t |
|
398 | 233 |
|
595 | 234 |
"Modified: 29.4.1996 / 09:46:19 / cg" |
0 | 235 |
! ! |
236 |
||
2852 | 237 |
!FontPanel class methodsFor:'menu specs'! |
238 |
||
239 |
previewMenu |
|
240 |
"This resource specification was automatically generated |
|
241 |
by the MenuEditor of ST/X." |
|
242 |
||
243 |
"Do not manually edit this!! If it is corrupted, |
|
244 |
the MenuEditor may not be able to read the specification." |
|
245 |
||
246 |
" |
|
247 |
MenuEditor new openOnClass:FontPanel andSelector:#previewMenu |
|
248 |
(Menu new fromLiteralArrayEncoding:(FontPanel previewMenu)) startUp |
|
249 |
" |
|
250 |
||
251 |
<resource: #menu> |
|
252 |
||
253 |
^ |
|
254 |
#(Menu |
|
255 |
( |
|
256 |
(MenuItem |
|
257 |
label: 'Copy' |
|
258 |
itemValue: previewCopySelection |
|
259 |
translateLabel: true |
|
260 |
) |
|
261 |
(MenuItem |
|
262 |
label: '-' |
|
263 |
) |
|
264 |
(MenuItem |
|
265 |
label: 'Show Character Set' |
|
266 |
itemValue: previewShowCharacterSet |
|
267 |
translateLabel: true |
|
268 |
) |
|
269 |
) |
|
270 |
nil |
|
271 |
nil |
|
272 |
) |
|
273 |
! ! |
|
274 |
||
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
275 |
!FontPanel class methodsFor:'startup'! |
0 | 276 |
|
277 |
fontFromUser |
|
77 | 278 |
"open a fontPanel and return the selected font, or nil |
279 |
if abort is pressed" |
|
280 |
||
410 | 281 |
^ self fontFromUserInitial:nil |
282 |
||
283 |
" |
|
284 |
FontPanel fontFromUser |
|
285 |
" |
|
286 |
||
287 |
"Modified: 27.2.1996 / 00:51:59 / cg" |
|
288 |
! |
|
289 |
||
290 |
fontFromUserInitial:aFont |
|
595 | 291 |
"open a fontPanel showing aFont initially, |
292 |
and return the selected font, or nil if abort is pressed" |
|
410 | 293 |
|
413 | 294 |
^ self fontFromUserInitial:aFont title:nil |
295 |
||
296 |
" |
|
297 |
FontPanel fontFromUserInitial:(Font family:'courier' size:12) |
|
298 |
" |
|
299 |
||
300 |
"Created: 27.2.1996 / 00:51:44 / cg" |
|
595 | 301 |
"Modified: 29.4.1996 / 09:45:52 / cg" |
413 | 302 |
! |
303 |
||
304 |
fontFromUserInitial:aFont title:someTitle |
|
595 | 305 |
"open a fontPanel with title and return the selected font, |
306 |
or nil if abort is pressed" |
|
413 | 307 |
|
415 | 308 |
^ self fontFromUserInitial:aFont title:someTitle filter:nil |
309 |
||
310 |
" |
|
311 |
FontPanel fontFromUserInitial:(Font family:'courier' size:12) title:'select some font' |
|
312 |
" |
|
313 |
||
314 |
"Created: 27.2.1996 / 00:59:46 / cg" |
|
595 | 315 |
"Modified: 29.4.1996 / 09:45:34 / cg" |
415 | 316 |
! |
317 |
||
2849 | 318 |
fontFromUserInitial:initialFont title:someTitle filter:aFilterBlock |
595 | 319 |
"open a fontPanel with title and font-filter |
320 |
and return the selected font, or nil if abort is pressed" |
|
415 | 321 |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
322 |
|fontPanel selectedFont| |
77 | 323 |
|
0 | 324 |
fontPanel := FontPanel new. |
415 | 325 |
fontPanel filter:aFilterBlock. |
413 | 326 |
someTitle notNil ifTrue:[ |
327 |
fontPanel label:someTitle |
|
328 |
]. |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
329 |
fontPanel action:[:aFontDescription | selectedFont := aFontDescription]. |
2849 | 330 |
initialFont notNil ifTrue:[ |
331 |
fontPanel initialFont:initialFont. |
|
410 | 332 |
]. |
333 |
||
0 | 334 |
fontPanel showAtPointer. |
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
335 |
fontPanel destroy. |
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
336 |
^ selectedFont |
0 | 337 |
|
77 | 338 |
" |
413 | 339 |
FontPanel fontFromUserInitial:(Font family:'courier' size:12) title:'select some font' |
77 | 340 |
" |
410 | 341 |
|
413 | 342 |
"Created: 27.2.1996 / 00:59:46 / cg" |
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
343 |
"Modified: 10.4.1997 / 09:53:03 / cg" |
0 | 344 |
! ! |
345 |
||
346 |
!FontPanel methodsFor:'accessing'! |
|
347 |
||
595 | 348 |
action:aFourArgBlock |
349 |
"set the action to be evaluated on ok. |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
350 |
The block will be evaluated with family, face, style, size and encoding." |
595 | 351 |
|
352 |
okAction := aFourArgBlock |
|
353 |
||
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
354 |
"Modified: 10.4.1997 / 09:49:58 / cg" |
197 | 355 |
! |
356 |
||
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
357 |
encoding:aPattern |
595 | 358 |
"set the encoding goal" |
359 |
||
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
360 |
encoding := aPattern. |
2843 | 361 |
encodingFilter contents:encoding. |
362 |
||
363 |
self encodingFilterSelected:encoding. |
|
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
364 |
shown ifTrue:[ |
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
365 |
self updateFamilyList |
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
366 |
]. |
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
367 |
|
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
368 |
"Created: 29.2.1996 / 04:05:31 / cg" |
595 | 369 |
"Modified: 29.4.1996 / 09:40:18 / cg" |
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
370 |
! |
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
371 |
|
415 | 372 |
filter:aOneArgBlock |
595 | 373 |
"set a filter; if non-nil, only fonts for which the filterBlock |
374 |
returns true will be offered" |
|
375 |
||
415 | 376 |
filter := aOneArgBlock. |
2826 | 377 |
familyList list:nil. |
415 | 378 |
shown ifTrue:[ |
379 |
self updateFamilyList |
|
380 |
]. |
|
381 |
||
382 |
"Created: 27.2.1996 / 01:40:08 / cg" |
|
595 | 383 |
"Modified: 29.4.1996 / 09:40:49 / cg" |
415 | 384 |
! |
385 |
||
0 | 386 |
initialFont:aFont |
128 | 387 |
"set the font to be selected initially" |
0 | 388 |
|
2849 | 389 |
|encoding| |
390 |
||
128 | 391 |
selectedFont := aFont. |
2849 | 392 |
encoding := aFont encoding. |
393 |
"/ self halt. |
|
394 |
encodingFilter contents:encoding. |
|
395 |
self encodingFilterSelected:encoding. |
|
382 | 396 |
self showSelectedFont. |
397 |
self showPreview |
|
398 |
||
399 |
"Modified: 23.2.1996 / 00:51:32 / cg" |
|
101 | 400 |
! ! |
401 |
||
77 | 402 |
!FontPanel methodsFor:'initialization'! |
403 |
||
404 |
initialize |
|
382 | 405 |
|familyLabel faceLabel sizeLabel panel fontBrowserView v1 v2 v3 |
2847 | 406 |
mm fH eH l box showFontNameLabel| |
77 | 407 |
|
408 |
super initialize. |
|
409 |
||
2847 | 410 |
showFontNameLabel := device platformName ~= 'WIN32'. |
411 |
||
382 | 412 |
mm := ViewSpacing. |
413 |
||
1763 | 414 |
self addAbortAndOkButtons. |
77 | 415 |
|
390
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
416 |
panel := View origin:0.0@0.0 corner:1.0@1.0 in:self. |
2847 | 417 |
panel bottomInset:(buttonPanel preferredExtent y |
418 |
+ (mm*3) |
|
419 |
+ (showFontNameLabel ifTrue:24 ifFalse:0) ). |
|
77 | 420 |
|
150 | 421 |
label := resources string:'Font dialog'. |
77 | 422 |
|
2842 | 423 |
box := HorizontalPanelView in:panel. |
424 |
box horizontalLayout:#leftFit. |
|
425 |
box origin:0.0@1.0 corner:0.6@1.0. |
|
426 |
||
427 |
l := Label label:(resources string:'Encoding:') in:box. |
|
428 |
l borderWidth:0. |
|
429 |
l adjust:#left. |
|
430 |
||
431 |
encodingFilter := ComboBoxView in:box. |
|
2826 | 432 |
encodingFilter level:-1. |
433 |
encodingFilter contents:'*'. |
|
2842 | 434 |
encodingFilter list:(self listOfEncodingsInFilterCombo). |
2826 | 435 |
encodingFilter action:[:pattern | self encodingFilterSelected:pattern]. |
436 |
encodingFilter immediateAccept:true. |
|
2842 | 437 |
encodingFilter font:l font. |
438 |
encodingFilter editor font:l font. |
|
439 |
||
440 |
eH := encodingFilter preferredExtent y. |
|
441 |
box topInset:(eH negated-1); horizontalInset:mm. |
|
442 |
||
2826 | 443 |
"/ encodingFilter acceptOnReturn:true. |
444 |
"/ encodingFilter acceptOnTab:true. |
|
445 |
"/ encodingFilter acceptOnLeave:true. |
|
446 |
"/ encodingFilter acceptOnLostFocus:true. |
|
447 |
"/ encodingFilter acceptOnPointerLeave:true. |
|
448 |
||
382 | 449 |
encodingLabel := Label label:' ' in:panel. |
2842 | 450 |
"/ eH := encodingLabel preferredExtent y. |
451 |
encodingLabel origin:0.6@1.0 corner:1.0@1.0. |
|
382 | 452 |
encodingLabel topInset:(eH negated); horizontalInset:mm. |
2842 | 453 |
encodingLabel level:0; adjust:#left. |
454 |
encodingLabel adjust:#right. |
|
382 | 455 |
|
2847 | 456 |
showFontNameLabel ifTrue:[ |
457 |
nameLabel := Label label:'' in:self. |
|
458 |
nameLabel origin:0.0@1.0 corner:1.0@1.0. |
|
459 |
nameLabel bottomInset:(buttonPanel preferredExtent y + (mm*2)). |
|
460 |
nameLabel topInset:(buttonPanel preferredExtent y + (mm*2) + 24) negated; horizontalInset:mm. |
|
461 |
nameLabel level:0; adjust:#left. |
|
462 |
nameLabel font:(FontDescription family:'helvetica' face:'medium' style:'roman' size:9). |
|
463 |
]. |
|
382 | 464 |
|
2842 | 465 |
previewField := HVScrollableView for:TextView in:panel. |
466 |
previewField origin:0.0@0.0 corner:1.0@0.4. |
|
467 |
previewField autoHideScrollBars:true. |
|
468 |
previewField := previewField scrolledView. |
|
382 | 469 |
previewField inset:mm. |
77 | 470 |
|
471 |
self is3D ifTrue:[ |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
472 |
previewField level:-1. |
77 | 473 |
] ifFalse:[ |
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
474 |
previewField borderWidth:1. |
77 | 475 |
]. |
476 |
||
390
1d54a9b41463
say Hello world in JIS font ;-)
Claus Gittinger <cg@exept.de>
parents:
382
diff
changeset
|
477 |
fontBrowserView := View origin:0.0@0.4 corner:1.0@1.0 in:panel. |
382 | 478 |
fontBrowserView bottomInset:(eH + mm). |
77 | 479 |
|
480 |
v1 := View origin:0.0@0.0 corner:0.4@1.0 in:fontBrowserView. |
|
481 |
||
2842 | 482 |
familyLabel := Label label:(resources string:'Family') in:v1. |
77 | 483 |
familyLabel borderWidth:0. |
484 |
familyLabel origin:(0.0 @ 0.0) extent:(1.0 @ nil). |
|
382 | 485 |
fH := familyLabel preferredExtent y. |
77 | 486 |
|
487 |
familyList := ScrollableView for:SelectionInListView in:v1. |
|
382 | 488 |
familyList origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
489 |
familyList inset:mm. |
|
490 |
familyList topInset:fH. |
|
491 |
||
128 | 492 |
familyList := familyList scrolledView. |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
493 |
self makeTabable:familyList. |
77 | 494 |
|
495 |
v2 := View origin:0.4@0.0 corner:0.8@1.0 |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
496 |
in:fontBrowserView. |
77 | 497 |
|
2842 | 498 |
faceLabel := Label label:(resources string:'Typeface') in:v2. |
77 | 499 |
faceLabel borderWidth:0. |
500 |
faceLabel origin:(0.0 @ 0.0) extent:(1.0 @ nil). |
|
501 |
||
502 |
faceList := ScrollableView for:SelectionInListView in:v2. |
|
382 | 503 |
faceList origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
504 |
faceList inset:mm. |
|
505 |
faceList topInset:fH. |
|
128 | 506 |
faceList := faceList scrolledView. |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
507 |
self makeTabable:faceList. |
77 | 508 |
|
2842 | 509 |
v3 := View origin:0.8@0.0 corner:1.0@1.0 in:fontBrowserView. |
77 | 510 |
|
2842 | 511 |
sizeLabel := Label label:(resources string:'Size') in:v3. |
77 | 512 |
sizeLabel borderWidth:0. |
513 |
sizeLabel origin:(0.0 @ 0.0)extent:(1.0 @ nil). |
|
514 |
||
515 |
sizeList := ScrollableView for:SelectionInListView in:v3. |
|
382 | 516 |
sizeList origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
517 |
sizeList inset:mm. |
|
518 |
sizeList topInset:fH. |
|
128 | 519 |
sizeList := sizeList scrolledView. |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
520 |
self makeTabable:sizeList. |
77 | 521 |
|
522 |
familyList action:[:lineNr | self familySelected:(familyList selectionValue)]. |
|
523 |
faceList action:[:lineNr | self faceSelected:(faceList selectionValue)]. |
|
524 |
sizeList action:[:lineNr | self sizeSelected:(sizeList selectionValue)]. |
|
525 |
||
2852 | 526 |
previewField menuHolder:self previewMenu. |
527 |
||
77 | 528 |
" |
529 |
FontPanel new showAtPointer |
|
530 |
" |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
531 |
|
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
532 |
"Modified: 31.5.1996 / 22:01:45 / cg" |
77 | 533 |
! |
534 |
||
2842 | 535 |
listOfEncodingsInFilterCombo |
536 |
|list availableEncodings| |
|
537 |
||
538 |
list := OrderedCollection new. |
|
2849 | 539 |
device platformName = 'WIN32' ifTrue:[ |
540 |
list |
|
541 |
addAll: |
|
542 |
#( |
|
543 |
'*' |
|
544 |
'ANSI' |
|
545 |
'RUSSIAN' |
|
546 |
nil |
|
547 |
). |
|
548 |
] ifFalse:[ |
|
549 |
list |
|
550 |
addAll: |
|
551 |
#( |
|
552 |
'*' |
|
553 |
'iso8859*' |
|
554 |
"/ 'iso8859-1' |
|
555 |
'iso10646-1' |
|
556 |
'koi8-r' |
|
557 |
'jis*' |
|
558 |
nil |
|
559 |
). |
|
560 |
]. |
|
2842 | 561 |
|
562 |
availableEncodings := Set new. |
|
2845 | 563 |
device listOfAvailableFonts do:[:f | availableEncodings add:(f encoding ? '?')]. |
2842 | 564 |
availableEncodings := availableEncodings asSortedCollection. |
565 |
list addAll:availableEncodings. |
|
566 |
^ list. |
|
567 |
! |
|
568 |
||
1277 | 569 |
postRealize |
197 | 570 |
"kludge for sco - xlsfont fails sometimes - try again here" |
571 |
||
415 | 572 |
self updateFamilyList. |
1277 | 573 |
super postRealize |
415 | 574 |
|
575 |
"Modified: 27.2.1996 / 01:40:47 / cg" |
|
1277 | 576 |
"Created: 24.7.1997 / 18:12:42 / cg" |
2852 | 577 |
! |
578 |
||
579 |
previewMenu |
|
580 |
<resource: #programMenu > |
|
581 |
||
582 |
|menu| |
|
583 |
||
584 |
menu := Menu new fromLiteralArrayEncoding:self class previewMenu. |
|
585 |
menu findGuiResourcesIn:self. |
|
586 |
menu receiver:self. |
|
587 |
^ menu |
|
77 | 588 |
! ! |
589 |
||
0 | 590 |
!FontPanel methodsFor:'private'! |
591 |
||
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
592 |
clearPreview |
595 | 593 |
"clear the preview subview" |
594 |
||
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
595 |
shown ifTrue:[ |
1297
f5ea02391a59
use #contents: instead of #clear
Claus Gittinger <cg@exept.de>
parents:
1284
diff
changeset
|
596 |
previewField contents:nil. |
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
597 |
encodingLabel label:''. |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
598 |
]. |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
599 |
|
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
600 |
"Created: 17.4.1996 / 15:19:16 / cg" |
1297
f5ea02391a59
use #contents: instead of #clear
Claus Gittinger <cg@exept.de>
parents:
1284
diff
changeset
|
601 |
"Modified: 11.8.1997 / 03:01:42 / cg" |
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
602 |
! |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
603 |
|
197 | 604 |
extractFaceAndStyleFrom:aString |
595 | 605 |
"given a string, extract currentFace and currentStyle" |
606 |
||
197 | 607 |
|index| |
608 |
||
609 |
index := aString indexOf:$-. |
|
610 |
(index ~~ 0) ifTrue:[ |
|
595 | 611 |
currentFaceAndStyle := aString. |
612 |
currentFace := aString copyTo:(index - 1). |
|
613 |
currentStyle := aString copyFrom:(index + 1) |
|
197 | 614 |
] |
615 |
||
595 | 616 |
"Modified: 29.4.1996 / 09:41:47 / cg" |
197 | 617 |
! |
618 |
||
619 |
showPreview |
|
595 | 620 |
"show the preview text" |
621 |
||
2843 | 622 |
|font deviceFont enc s allFonts fonts fontName| |
382 | 623 |
|
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
624 |
self clearPreview. |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
625 |
|
197 | 626 |
" |
627 |
show a wait cursor: for some fonts (kanji etc) the |
|
628 |
X-server needs quites some time to load the font |
|
629 |
" |
|
255 | 630 |
self withWaitCursorDo:[ |
2842 | 631 |
allFonts := device |
1257 | 632 |
fontsInFamily:(currentFamily ? '*') |
633 |
face:(currentFace ? '*') |
|
634 |
style:(currentStyle ? '*') |
|
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
635 |
filtering:filter. |
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
636 |
|
2848 | 637 |
fonts := allFonts select:[:f | f size = currentSize]. |
450 | 638 |
fonts notEmpty ifTrue:[ |
2843 | 639 |
font := fonts anElement. |
450 | 640 |
] ifFalse:[ |
2848 | 641 |
"/ mhmh: |
642 |
"/ size=0 is returned for scalable fonts. |
|
643 |
"/ Any size is possible. |
|
450 | 644 |
"/ |
2848 | 645 |
fonts := allFonts select:[:f | f size = 0]. |
450 | 646 |
fonts notEmpty ifTrue:[ |
2843 | 647 |
font := Font family:currentFamily |
450 | 648 |
face:currentFace |
649 |
style:currentStyle |
|
650 |
size:currentSize |
|
651 |
encoding:(fonts anElement encoding). |
|
652 |
] |
|
653 |
]. |
|
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
654 |
|
2843 | 655 |
font notNil ifTrue:[ |
656 |
deviceFont := font onDevice:device. |
|
657 |
previewField font:deviceFont. |
|
434
22586d8221e1
dont get confused by same-name but different encoding
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
658 |
|
2843 | 659 |
enc := font encoding. |
2287
b33ad40d7538
preview fixed when font is bad
Claus Gittinger <cg@exept.de>
parents:
2286
diff
changeset
|
660 |
enc isNil ifTrue:[enc := 'ascii ?']. |
b33ad40d7538
preview fixed when font is bad
Claus Gittinger <cg@exept.de>
parents:
2286
diff
changeset
|
661 |
encodingLabel label:enc. |
2843 | 662 |
currentEncoding := enc. |
663 |
fontName := deviceFont fullName. |
|
382 | 664 |
|
2842 | 665 |
(enc notNil and:[enc startsWith:'jis']) ifTrue:[ |
2860 | 666 |
(enc includesString:'0201') ifTrue:[ |
667 |
s := self class defaultJIS0201SampleString |
|
668 |
] ifFalse:[ |
|
669 |
s := self class defaultJISSampleString |
|
670 |
] |
|
2842 | 671 |
] ifFalse:[ |
2847 | 672 |
s := self class defaultLatin1SampleString. |
2842 | 673 |
]. |
674 |
previewField contents:s. |
|
382 | 675 |
] ifFalse:[ |
2842 | 676 |
previewField contents:nil. |
677 |
encodingLabel label:nil. |
|
2843 | 678 |
currentEncoding := nil. |
2842 | 679 |
fontName := nil. |
382 | 680 |
]. |
2842 | 681 |
nameLabel notNil ifTrue:[nameLabel label:fontName]. |
197 | 682 |
] |
255 | 683 |
|
1257 | 684 |
"Modified: 30.6.1997 / 17:26:22 / cg" |
197 | 685 |
! |
686 |
||
128 | 687 |
showSelectedFont |
2843 | 688 |
|fam face faceAndStyle style sz| |
128 | 689 |
|
690 |
fam := selectedFont family. |
|
2843 | 691 |
currentEncoding := selectedFont encoding. |
692 |
||
2842 | 693 |
self familySelected:fam. |
128 | 694 |
fam notNil ifTrue:[ |
2842 | 695 |
face := selectedFont face. |
696 |
(face notNil and:[(style := selectedFont style) notNil]) ifTrue:[ |
|
697 |
faceAndStyle := face , '-' , style. |
|
698 |
]. |
|
699 |
self faceSelected:faceAndStyle. |
|
700 |
faceAndStyle notNil ifTrue:[ |
|
701 |
sz := selectedFont size. |
|
702 |
self sizeSelected:sz. |
|
2843 | 703 |
|
2842 | 704 |
"/ sz notNil ifTrue:[ |
705 |
"/ enc := selectedFont encoding. |
|
706 |
"/ self encodingSelected:enc |
|
707 |
"/ ] |
|
708 |
] |
|
709 |
]. |
|
2826 | 710 |
! |
711 |
||
712 |
updateFamilyList |
|
713 |
"update the list of font families" |
|
714 |
||
715 |
|families| |
|
716 |
||
717 |
familyList list isNil ifTrue:[ |
|
718 |
families := device fontFamiliesFiltering:filter. |
|
719 |
families notNil ifTrue:[ |
|
720 |
families := families asOrderedCollection sort |
|
721 |
]. |
|
722 |
familyList list:families |
|
723 |
]. |
|
724 |
selectedFont notNil ifTrue:[ |
|
725 |
self showSelectedFont |
|
726 |
]. |
|
727 |
||
728 |
"Modified: 27.2.1996 / 01:39:42 / cg" |
|
729 |
"Created: 27.2.1996 / 01:40:37 / cg" |
|
197 | 730 |
! ! |
128 | 731 |
|
197 | 732 |
!FontPanel methodsFor:'queries'! |
0 | 733 |
|
197 | 734 |
preferredExtent |
595 | 735 |
"return the boxes preferredExtent" |
572 | 736 |
|
797 | 737 |
"/ If I have an explicit preferredExtent .. |
738 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
739 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
740 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
741 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
742 |
|
2842 | 743 |
^ 450@350 |
572 | 744 |
|
797 | 745 |
"Modified: 19.7.1996 / 20:44:08 / cg" |
0 | 746 |
! ! |
77 | 747 |
|
748 |
!FontPanel methodsFor:'user interaction'! |
|
749 |
||
2826 | 750 |
encodingFilterSelected:anEncodingPattern |
751 |
"another encoding was selected; find available fonts and update lists" |
|
752 |
||
753 |
|pattern| |
|
754 |
||
2845 | 755 |
anEncodingPattern = '?' ifTrue:[ |
756 |
pattern := '' |
|
757 |
] ifFalse:[ |
|
758 |
pattern := (anEncodingPattern isEmptyOrNil ifTrue:'*' ifFalse:anEncodingPattern). |
|
759 |
]. |
|
2826 | 760 |
self |
761 |
filter: |
|
762 |
[:f | |
|
763 |
|encoding| |
|
764 |
||
765 |
encoding := f encoding ? ''. |
|
766 |
pattern match:encoding |
|
767 |
]. |
|
768 |
! |
|
769 |
||
197 | 770 |
faceSelected:aFaceAndStyleName |
2826 | 771 |
"a fonts face was selected; find available sizes and update lists" |
595 | 772 |
|
2842 | 773 |
self faceSelected:aFaceAndStyleName showPreview:true |
774 |
! |
|
775 |
||
776 |
faceSelected:aFaceAndStyleName showPreview:showPreview |
|
777 |
"a fonts face was selected; find available sizes and update lists" |
|
778 |
||
197 | 779 |
|sizes| |
780 |
||
781 |
aFaceAndStyleName notNil ifTrue:[ |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
782 |
self extractFaceAndStyleFrom:aFaceAndStyleName. |
197 | 783 |
]. |
784 |
sizes := device |
|
1257 | 785 |
sizesInFamily:(currentFamily ? '*') |
786 |
face:(currentFace ? '*') |
|
787 |
style:(currentStyle ? '*') |
|
415 | 788 |
filtering:filter. |
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
789 |
|
197 | 790 |
(sizes isNil or:[sizes isEmpty]) ifTrue:[ |
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
791 |
sizeList list:nil. |
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
792 |
currentSize := nil. |
2842 | 793 |
showPreview ifTrue:[ |
794 |
self showPreview. |
|
795 |
]. |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
796 |
^ self |
197 | 797 |
]. |
798 |
||
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
799 |
self clearPreview. |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
800 |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
801 |
sizes := (sizes asOrderedCollection sort) collect:[:entry | entry printString]. |
197 | 802 |
sizeList list:sizes. |
803 |
currentSize notNil ifTrue:[ |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
804 |
(sizes includes:(currentSize printString)) ifTrue:[ |
2170 | 805 |
sizeList setSelectElement:currentSize printString. |
2842 | 806 |
showPreview ifTrue:[ |
807 |
self showPreview |
|
808 |
] |
|
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
809 |
] |
197 | 810 |
] |
251
25f76efaa547
oops - dont pass a collection of numbers to the size-view
Claus Gittinger <cg@exept.de>
parents:
243
diff
changeset
|
811 |
|
1257 | 812 |
"Modified: 30.6.1997 / 17:25:46 / cg" |
197 | 813 |
! |
814 |
||
77 | 815 |
familySelected:aFamilyName |
2826 | 816 |
"a fonts family was selected; find available faces and update lists" |
595 | 817 |
|
2842 | 818 |
self familySelected:aFamilyName showPreview:true |
819 |
! |
|
820 |
||
821 |
familySelected:aFamilyName showPreview:showPreview |
|
822 |
"a fonts family was selected; find available faces and update lists" |
|
823 |
||
77 | 824 |
|faces styles list| |
825 |
||
690 | 826 |
familyList setSelectElement:aFamilyName. |
77 | 827 |
|
828 |
currentFamily := aFamilyName. |
|
415 | 829 |
faces := device facesInFamily:aFamilyName filtering:filter. |
2353 | 830 |
(faces size = 0) ifTrue:[ |
415 | 831 |
currentFace := currentStyle := currentFaceAndStyle := nil. |
832 |
faceList list:nil. |
|
2842 | 833 |
self faceSelected:nil showPreview:showPreview. |
415 | 834 |
^ self. |
77 | 835 |
]. |
836 |
||
2353 | 837 |
list := SortedCollection new. |
77 | 838 |
faces do:[:aFace | |
415 | 839 |
styles := device stylesInFamily:aFamilyName face:aFace filtering:filter. |
840 |
styles do:[:aStyle | |
|
841 |
list add:(aFace , '-' , aStyle) |
|
842 |
] |
|
77 | 843 |
]. |
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
844 |
|
77 | 845 |
faceList list:list. |
846 |
currentFaceAndStyle notNil ifTrue:[ |
|
415 | 847 |
(list includes:currentFaceAndStyle) ifTrue:[ |
690 | 848 |
faceList setSelectElement:currentFaceAndStyle. |
2842 | 849 |
self faceSelected:currentFaceAndStyle showPreview:showPreview. |
415 | 850 |
^ self |
851 |
] |
|
77 | 852 |
]. |
2842 | 853 |
|
541
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
854 |
sizeList list:nil. |
76018ea821ca
clear preview & encoding when no font is shown
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
855 |
self clearPreview. |
415 | 856 |
|
690 | 857 |
"Modified: 26.5.1996 / 15:04:29 / cg" |
77 | 858 |
! |
859 |
||
860 |
okPressed |
|
595 | 861 |
"ok was pressed; hide myself and evaluate the okAction, passing |
862 |
family, face, style and size as arguments" |
|
863 |
||
77 | 864 |
self hide. |
865 |
okAction notNil ifTrue:[ |
|
410 | 866 |
currentFamily notNil ifTrue:[ |
2842 | 867 |
okAction |
868 |
value:(FontDescription |
|
869 |
family:currentFamily |
|
870 |
face:currentFace |
|
871 |
style:currentStyle |
|
872 |
size:currentSize |
|
2843 | 873 |
encoding:(currentEncoding ? encoding)). |
410 | 874 |
] |
77 | 875 |
] |
410 | 876 |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
877 |
"Modified: 10.4.1997 / 09:51:31 / cg" |
77 | 878 |
! |
879 |
||
2852 | 880 |
previewCopySelection |
881 |
previewField copySelection. |
|
882 |
! |
|
883 |
||
884 |
previewShowCharacterSet |
|
885 |
CharacterSetView openOn:(previewField font) |
|
886 |
! |
|
887 |
||
77 | 888 |
sizeSelected:aNumberOrString |
2826 | 889 |
"a size was selected; update preview" |
595 | 890 |
|
2842 | 891 |
self sizeSelected:aNumberOrString showPreview:true. |
892 |
! |
|
893 |
||
894 |
sizeSelected:aNumberOrString showPreview:showPreview |
|
895 |
"a size was selected; update preview" |
|
896 |
||
77 | 897 |
aNumberOrString isNumber ifTrue:[ |
595 | 898 |
currentSize := aNumberOrString |
77 | 899 |
] ifFalse:[ |
2826 | 900 |
currentSize := Number readFromString:aNumberOrString onError:nil |
77 | 901 |
]. |
2842 | 902 |
showPreview ifTrue:[self showPreview] |
595 | 903 |
|
904 |
"Modified: 29.4.1996 / 09:43:23 / cg" |
|
77 | 905 |
! ! |
197 | 906 |
|
1185
3b8bd5ea8d62
action block is evaluated with a fontDescription
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
907 |
!FontPanel class methodsFor:'documentation'! |
243 | 908 |
|
909 |
version |
|
2873 | 910 |
^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.62 2004-02-12 21:39:34 cg Exp $' |
243 | 911 |
! ! |