author | Claus Gittinger <cg@exept.de> |
Fri, 05 Aug 2005 12:43:51 +0200 | |
changeset 6375 | b4f3981447a7 |
parent 6372 | d59bab947578 |
child 7738 | c731a6d74f04 |
permissions | -rw-r--r-- |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
1 |
" |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
3 |
All Rights Reserved |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
4 |
|
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
5 |
This software is furnished under a license and may be used |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
10 |
hereby transferred. |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
11 |
" |
44 | 12 |
|
3199 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
44 | 15 |
InspectorView subclass:#ColorInspectorView |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
16 |
instanceVariableNames:'colorView' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
17 |
classVariableNames:'' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
18 |
poolDictionaries:'' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
19 |
category:'Interface-Inspector' |
44 | 20 |
! |
21 |
||
87 | 22 |
!ColorInspectorView class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! ! |
|
37 |
||
44 | 38 |
!ColorInspectorView methodsFor:'accessing'! |
39 |
||
40 |
inspect:anObject |
|
41 |
super inspect:anObject. |
|
42 |
realized ifFalse:[^ self]. |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
43 |
|
44 | 44 |
colorView viewBackground:anObject. |
45 |
colorView clear |
|
46 |
! ! |
|
47 |
||
48 |
!ColorInspectorView methodsFor:'initialization'! |
|
49 |
||
50 |
initialize |
|
51 |
|newPanel sub| |
|
52 |
||
53 |
super initialize. |
|
54 |
||
55 |
newPanel := VariableVerticalPanel in:self. |
|
56 |
newPanel origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
57 |
||
58 |
sub := subViews first. |
|
59 |
self removeSubView:sub. |
|
60 |
sub origin:0.0@0.0 corner:1.0@0.8. |
|
61 |
newPanel addSubView:sub. |
|
62 |
||
63 |
colorView := View in:newPanel. |
|
64 |
colorView origin:(0.0 @ 0.8) corner:(1.0 @ 1.0). |
|
65 |
||
66 |
" |
|
67 |
ColorInspectorView inspect:(Color yellow) |
|
68 |
ColorInspectorView inspect:(Color name:'brown') lightened) |
|
69 |
" |
|
70 |
! ! |
|
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
71 |
|
6372 | 72 |
!ColorInspectorView methodsFor:'private'! |
73 |
||
74 |
displayStringForValue:someValue |
|
75 |
"return the values displayString" |
|
76 |
||
77 |
|sel| |
|
78 |
||
79 |
sel := listView at:selectionIndex. |
|
80 |
||
81 |
(sel startsWith:$-) ifTrue:[ |
|
82 |
(sel startsWith:'-rgb') ifTrue:[ |
|
6375 | 83 |
^ '#' , ((inspectedObject rgbValue printStringRadix:16) leftPaddedTo:6 with:$0) |
6372 | 84 |
]. |
85 |
]. |
|
86 |
^ super displayStringForValue:someValue |
|
87 |
! |
|
88 |
||
89 |
pseudoFieldList |
|
90 |
^ #( |
|
91 |
'-rgb' |
|
92 |
) |
|
93 |
! |
|
94 |
||
95 |
valueForSpecialLine:line |
|
96 |
(line startsWith:'-rgb') ifTrue:[ |
|
97 |
^ inspectedObject rgbValue |
|
98 |
]. |
|
99 |
^ super valueForSpecialLine:line |
|
100 |
! ! |
|
101 |
||
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
102 |
!ColorInspectorView class methodsFor:'documentation'! |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
103 |
|
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
104 |
version |
6375 | 105 |
^ '$Header: /cvs/stx/stx/libtool/ColorInspectorView.st,v 1.10 2005-08-05 10:43:40 cg Exp $' |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
106 |
! ! |