author | Claus Gittinger <cg@exept.de> |
Sun, 02 Nov 1997 18:39:18 +0100 | |
changeset 600 | ccedbbd1eac9 |
parent 555 | adc507caec9e |
child 669 | 82c3b58df75e |
permissions | -rw-r--r-- |
58 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
86
4d7dbb5f1719
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
58
diff
changeset
|
3 |
All Rights Reserved |
58 | 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 |
||
13 |
Object subclass:#ListEntry |
|
123 | 14 |
instanceVariableNames:'' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Views-Support' |
|
58 | 18 |
! |
19 |
||
20 |
!ListEntry class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
86
4d7dbb5f1719
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
58
diff
changeset
|
25 |
All Rights Reserved |
58 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
ListEntry is an abstract superclass for objects which can be used |
|
39 |
in place of strings in ListViews or SelectionInListViews. |
|
40 |
||
41 |
If you want to create new subclasses, implement (at least) the methods |
|
42 |
found in the 'required protocol' category. |
|
158 | 43 |
|
44 |
[author:] |
|
45 |
Claus Gittinger |
|
46 |
||
47 |
[see also:] |
|
48 |
ListView |
|
58 | 49 |
" |
50 |
! ! |
|
51 |
||
52 |
!ListEntry methodsFor:'queries'! |
|
53 |
||
123 | 54 |
printString |
55 |
^ self asString |
|
56 |
||
57 |
"Created: 8.2.1996 / 11:56:14 / cg" |
|
58 |
! |
|
59 |
||
60 |
species |
|
61 |
^ String |
|
62 |
||
63 |
"Created: 8.2.1996 / 12:52:38 / cg" |
|
64 |
! |
|
65 |
||
58 | 66 |
string |
67 |
^ self asString |
|
68 |
! ! |
|
69 |
||
70 |
!ListEntry methodsFor:'required protocol'! |
|
71 |
||
72 |
asString |
|
73 |
"return the receiver as a string (for example, to store it in a file)" |
|
74 |
||
75 |
^ self subclassResponsibility |
|
76 |
! |
|
77 |
||
109 | 78 |
displayOn:aGC x:x y:y opaque:opaque |
97 | 79 |
"display the receiver on a GC" |
58 | 80 |
|
81 |
^ self subclassResponsibility |
|
94 | 82 |
! |
58 | 83 |
|
173 | 84 |
heightOn:aGC |
94 | 85 |
"return the height of the receiver when displayed in aGC. |
86 |
Assume the GC's font is taken. If that is not the case in a |
|
87 |
particular subclass, this method is to be redefined there." |
|
88 |
||
89 |
^ aGC font height |
|
90 |
||
173 | 91 |
"Created: 12.5.1996 / 20:37:06 / cg" |
97 | 92 |
! |
93 |
||
173 | 94 |
widthOn:aGC |
97 | 95 |
"return the width (in device units) of the receiver when displayed in aGC" |
96 |
||
97 |
^ self subclassResponsibility |
|
173 | 98 |
|
99 |
"Created: 12.5.1996 / 20:53:09 / cg" |
|
58 | 100 |
! ! |
101 |
||
123 | 102 |
!ListEntry methodsFor:'string protocol'! |
103 |
||
104 |
< aString |
|
105 |
"behave like a string when comparing" |
|
106 |
||
107 |
^ self asString < aString asString |
|
108 |
||
109 |
"Created: 8.2.1996 / 12:01:29 / cg" |
|
110 |
! |
|
111 |
||
112 |
= aString |
|
113 |
"behave like a string when comparing" |
|
114 |
||
115 |
^ self asString = aString asString |
|
116 |
||
117 |
"Created: 8.2.1996 / 12:01:24 / cg" |
|
118 |
! |
|
119 |
||
120 |
at:index |
|
600 | 121 |
"behave like a string when accessing characters" |
122 |
||
123 | 123 |
^ self string at:index |
124 |
||
600 | 125 |
"Created: / 8.2.1996 / 12:53:06 / cg" |
126 |
"Modified: / 30.10.1997 / 15:41:47 / cg" |
|
123 | 127 |
! |
128 |
||
129 |
do:aBlock |
|
600 | 130 |
"behave like a string when enumerating characters" |
131 |
||
123 | 132 |
^ self string do:aBlock |
133 |
||
600 | 134 |
"Created: / 8.2.1996 / 12:56:06 / cg" |
135 |
"Modified: / 30.10.1997 / 15:42:06 / cg" |
|
123 | 136 |
! |
137 |
||
138 |
size |
|
600 | 139 |
"behave like a string when asked for the size" |
140 |
||
123 | 141 |
^ self string size |
142 |
||
600 | 143 |
"Created: / 8.2.1996 / 12:54:45 / cg" |
144 |
"Modified: / 30.10.1997 / 15:42:19 / cg" |
|
145 |
! ! |
|
146 |
||
147 |
!ListEntry methodsFor:'testing'! |
|
148 |
||
149 |
includes:aCharacter |
|
150 |
"behave like a string when testing" |
|
151 |
||
152 |
^ self string includes:aCharacter |
|
153 |
||
154 |
"Modified: / 30.10.1997 / 15:42:32 / cg" |
|
123 | 155 |
! ! |
156 |
||
98 | 157 |
!ListEntry class methodsFor:'documentation'! |
158 |
||
159 |
version |
|
600 | 160 |
^ '$Header: /cvs/stx/stx/libwidg2/ListEntry.st,v 1.12 1997-11-02 17:39:18 cg Exp $' |
98 | 161 |
! ! |