author | Claus Gittinger <cg@exept.de> |
Fri, 15 Jun 2018 10:54:35 +0200 | |
changeset 5816 | 7876c07931a7 |
parent 4946 | bca0c3af0b20 |
child 6018 | 82aee28e50d5 |
permissions | -rw-r--r-- |
2943 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
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 |
" |
|
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
12 |
"{ Package: 'stx:libwidg2' }" |
2943 | 13 |
|
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
2943 | 15 |
|
16 |
HierarchicalItemWithLabel subclass:#HierarchicalItemWithLabelAndIcon |
|
17 |
instanceVariableNames:'icon' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Views-Support' |
|
21 |
! |
|
22 |
||
23 |
!HierarchicalItemWithLabelAndIcon class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! ! |
|
38 |
||
4945
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
39 |
!HierarchicalItemWithLabelAndIcon class methodsFor:'instance creation'! |
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
40 |
|
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
41 |
label:aLabel icon:anIcon |
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
42 |
^ self new label:aLabel icon:anIcon |
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
43 |
! ! |
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
44 |
|
2943 | 45 |
!HierarchicalItemWithLabelAndIcon methodsFor:'accessing'! |
46 |
||
47 |
icon |
|
48 |
"returns the icon" |
|
49 |
||
50 |
^ icon |
|
51 |
! |
|
52 |
||
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
53 |
icon:anIcon |
2943 | 54 |
"set the value of the instance variable 'icon' (automatically generated)" |
55 |
||
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
56 |
icon ~= anIcon ifTrue:[ |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
57 |
icon := anIcon. |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
58 |
self iconChanged |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
59 |
]. |
2943 | 60 |
! |
61 |
||
62 |
label:aLabel icon:anIcon |
|
4946 | 63 |
|anyChange labelChanged| |
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
64 |
|
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
65 |
anyChange := false. |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
66 |
(icon ~= anIcon) ifTrue:[ |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
67 |
icon := anIcon. |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
68 |
anyChange := true |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
69 |
]. |
4946 | 70 |
|
71 |
labelChanged := false. |
|
72 |
(label isString and:[aLabel isString]) ifTrue:[ |
|
73 |
labelChanged := (label sameStringAndEmphasisAs:aLabel) not. |
|
74 |
] ifFalse:[ |
|
75 |
labelChanged := (label ~= aLabel) |
|
76 |
]. |
|
77 |
labelChanged ifTrue:[ |
|
78 |
label := aLabel. |
|
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
79 |
anyChange := true |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
80 |
]. |
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
81 |
anyChange ifTrue:[ self changed ]. |
2943 | 82 |
! |
83 |
||
84 |
labeled:aLabel icon:anIcon |
|
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
85 |
"backward compatibility" |
2943 | 86 |
|
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
87 |
self label:aLabel icon:anIcon |
2943 | 88 |
! ! |
89 |
||
90 |
!HierarchicalItemWithLabelAndIcon class methodsFor:'documentation'! |
|
91 |
||
92 |
version |
|
4945
dde70d8f3913
added instance creation messages label:/label:icon:
Claus Gittinger <cg@exept.de>
parents:
4694
diff
changeset
|
93 |
^ '$Header$' |
4946 | 94 |
! |
95 |
||
96 |
version_CVS |
|
97 |
^ '$Header$' |
|
2943 | 98 |
! ! |
4694
7f830911e3aa
change messages when icon or label changes
Claus Gittinger <cg@exept.de>
parents:
2943
diff
changeset
|
99 |