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