equal
deleted
inserted
replaced
11 " |
11 " |
12 |
12 |
13 "{ Package: 'stx:goodies' }" |
13 "{ Package: 'stx:goodies' }" |
14 |
14 |
15 View subclass:#CharacterSetView |
15 View subclass:#CharacterSetView |
16 instanceVariableNames:'codePageHolder selectedCodePointHolder' |
16 instanceVariableNames:'codePageHolder selectedCodePointHolder masterViewOrNil' |
17 classVariableNames:'' |
17 classVariableNames:'' |
18 poolDictionaries:'' |
18 poolDictionaries:'' |
19 category:'Collections-Text-Encodings' |
19 category:'Collections-Text-Encodings' |
20 ! |
20 ! |
21 |
21 |
41 (opened via the fontPanels - text-preview popUpMenu) |
41 (opened via the fontPanels - text-preview popUpMenu) |
42 or to insert characters into a textView (opened by a textEditors misc-specialCharacters menu). |
42 or to insert characters into a textView (opened by a textEditors misc-specialCharacters menu). |
43 " |
43 " |
44 ! ! |
44 ! ! |
45 |
45 |
|
46 !CharacterSetView class methodsFor:'instance creation'! |
|
47 |
|
48 new |
|
49 ^ self basicNew initialize. |
|
50 ! ! |
|
51 |
46 !CharacterSetView class methodsFor:'startup'! |
52 !CharacterSetView class methodsFor:'startup'! |
47 |
53 |
48 open |
54 open |
49 self openOn:View defaultFont |
55 self openOn:View defaultFont |
50 |
56 |
51 " |
57 " |
52 self open |
58 self open |
53 " |
59 " |
|
60 ! |
|
61 |
|
62 openAsInputFor:aView label:viewLabel clickLabel:clickLabel |
|
63 ^ self |
|
64 openOn:aView font |
|
65 label:viewLabel |
|
66 clickLabel:clickLabel |
|
67 asInputFor:aView |
54 ! |
68 ! |
55 |
69 |
56 openOn:aFont |
70 openOn:aFont |
57 ^ self |
71 ^ self |
58 openOn:aFont |
72 openOn:aFont |
63 self openOn:(View defaultFont). |
77 self openOn:(View defaultFont). |
64 " |
78 " |
65 ! |
79 ! |
66 |
80 |
67 openOn:aFont label:viewLabel clickLabel:clickLabel |
81 openOn:aFont label:viewLabel clickLabel:clickLabel |
|
82 ^ self |
|
83 openOn:aFont |
|
84 label:viewLabel |
|
85 clickLabel:clickLabel |
|
86 asInputFor:nil |
|
87 ! |
|
88 |
|
89 openOn:aFont label:viewLabel clickLabel:clickLabel asInputFor:aView |
68 |top panel v bNext bPrev bFirst bLast rangeLabel codePointLabel |
90 |top panel v bNext bPrev bFirst bLast rangeLabel codePointLabel |
69 first last next prev enable update updateCodePoint w h |
91 first last next prev enable update updateCodePoint w h |
70 minPage maxPage| |
92 minPage maxPage| |
71 |
93 |
72 minPage := 0. |
94 minPage := 0. |
81 |
103 |
82 panel := HorizontalPanelView in:top. |
104 panel := HorizontalPanelView in:top. |
83 panel origin:(0.0 @ 0.0) corner:(1.0 @ 0.0). |
105 panel origin:(0.0 @ 0.0) corner:(1.0 @ 0.0). |
84 panel bottomInset:-25. |
106 panel bottomInset:-25. |
85 panel horizontalLayout:#left. |
107 panel horizontalLayout:#left. |
|
108 |
|
109 aView notNil ifTrue:[ |
|
110 v useSameFontAs:aView. |
|
111 ]. |
86 |
112 |
87 "/ actions |
113 "/ actions |
88 updateCodePoint := [ |
114 updateCodePoint := [ |
89 |selectedCodePoint selectedChar |
115 |selectedCodePoint selectedChar |
90 isLetter isDigit isUppercase isLowercase| |
116 isLetter isDigit isUppercase isLowercase| |
194 |
220 |
195 w := v preferredExtent x max:(panel preferredExtent x). |
221 w := v preferredExtent x max:(panel preferredExtent x). |
196 h := v preferredExtent y + (panel preferredExtent y). |
222 h := v preferredExtent y + (panel preferredExtent y). |
197 top extent:(w @ h). |
223 top extent:(w @ h). |
198 |
224 |
|
225 aView notNil ifTrue:[ |
|
226 top application:(aView application). |
|
227 top beSlave. |
|
228 ]. |
199 top open. |
229 top open. |
200 ^ v |
230 ^ v |
201 |
231 |
202 " |
232 " |
203 self openOn:(View defaultFont). |
233 self openOn:(View defaultFont). |
223 ^ selectedCodePointHolder value |
253 ^ selectedCodePointHolder value |
224 ! |
254 ! |
225 |
255 |
226 selectedCodePointHolder |
256 selectedCodePointHolder |
227 ^ selectedCodePointHolder |
257 ^ selectedCodePointHolder |
|
258 ! ! |
|
259 |
|
260 !CharacterSetView methodsFor:'change & update'! |
|
261 |
|
262 update:something with:aParameter from:changedObject |
|
263 something == #font ifTrue:[ |
|
264 self font:(masterViewOrNil font). |
|
265 ^ self. |
|
266 ]. |
|
267 super update:something with:aParameter from:changedObject |
228 ! ! |
268 ! ! |
229 |
269 |
230 !CharacterSetView methodsFor:'drawing'! |
270 !CharacterSetView methodsFor:'drawing'! |
231 |
271 |
232 redraw |
272 redraw |
354 self clear. |
394 self clear. |
355 self redraw. |
395 self redraw. |
356 ]. |
396 ]. |
357 ! ! |
397 ! ! |
358 |
398 |
359 !CharacterSetView methodsFor:'initialization'! |
399 !CharacterSetView methodsFor:'initialization & release'! |
|
400 |
|
401 destroy |
|
402 masterViewOrNil notNil ifTrue:[ |
|
403 masterViewOrNil removeDependent:self. |
|
404 masterViewOrNil := nil. |
|
405 ]. |
|
406 super destroy. |
|
407 ! |
360 |
408 |
361 initialize |
409 initialize |
362 super initialize. |
410 super initialize. |
363 codePageHolder := 0 asValue. |
411 codePageHolder := 0 asValue. |
364 codePageHolder onChangeSend:#codePageChanged to:self. |
412 codePageHolder onChangeSend:#codePageChanged to:self. |
365 |
413 |
366 selectedCodePointHolder := ValueHolder new. |
414 selectedCodePointHolder := ValueHolder new. |
367 selectedCodePointHolder onChangeSend:#selectedCodePointChanged to:self. |
415 selectedCodePointHolder onChangeSend:#selectedCodePointChanged to:self. |
|
416 ! |
|
417 |
|
418 useSameFontAs:aView |
|
419 masterViewOrNil := aView. |
|
420 masterViewOrNil addDependent:self |
368 ! ! |
421 ! ! |
369 |
422 |
370 !CharacterSetView methodsFor:'queries'! |
423 !CharacterSetView methodsFor:'queries'! |
371 |
424 |
372 preferredExtent |
425 preferredExtent |
380 ! ! |
433 ! ! |
381 |
434 |
382 !CharacterSetView class methodsFor:'documentation'! |
435 !CharacterSetView class methodsFor:'documentation'! |
383 |
436 |
384 version |
437 version |
385 ^ '$Header: /cvs/stx/stx/libwidg2/CharacterSetView.st,v 1.12 2004-02-23 13:27:44 cg Exp $' |
438 ^ '$Header: /cvs/stx/stx/libwidg2/CharacterSetView.st,v 1.13 2004-02-24 10:30:09 cg Exp $' |
386 ! ! |
439 ! ! |