author | Claus Gittinger <cg@exept.de> |
Sun, 12 May 1996 21:07:06 +0200 | |
changeset 173 | d111da00daa9 |
parent 158 | 431e38dfc5ab |
child 555 | adc507caec9e |
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 |
||
123 | 52 |
!ListEntry methodsFor:'drawing'! |
53 |
||
54 |
displayOn:aGC x:x y:y |
|
55 |
"display the receiver on a GC" |
|
56 |
||
57 |
^ self displayOn:aGC x:x y:y opaque:false |
|
58 |
! |
|
59 |
||
60 |
displayOpaqueOn:aGC x:x y:y |
|
61 |
"display the receiver on a GC" |
|
62 |
||
63 |
^ self displayOn:aGC x:x y:y opaque:true |
|
64 |
! ! |
|
65 |
||
58 | 66 |
!ListEntry methodsFor:'queries'! |
67 |
||
68 |
includes:aCharacter |
|
69 |
^ self string includes:aCharacter |
|
70 |
! |
|
71 |
||
123 | 72 |
printString |
73 |
^ self asString |
|
74 |
||
75 |
"Created: 8.2.1996 / 11:56:14 / cg" |
|
76 |
! |
|
77 |
||
78 |
species |
|
79 |
^ String |
|
80 |
||
81 |
"Created: 8.2.1996 / 12:52:38 / cg" |
|
82 |
! |
|
83 |
||
58 | 84 |
string |
85 |
^ self asString |
|
86 |
! ! |
|
87 |
||
88 |
!ListEntry methodsFor:'required protocol'! |
|
89 |
||
90 |
asString |
|
91 |
"return the receiver as a string (for example, to store it in a file)" |
|
92 |
||
93 |
^ self subclassResponsibility |
|
94 |
! |
|
95 |
||
109 | 96 |
displayOn:aGC x:x y:y opaque:opaque |
97 | 97 |
"display the receiver on a GC" |
58 | 98 |
|
99 |
^ self subclassResponsibility |
|
94 | 100 |
! |
58 | 101 |
|
173 | 102 |
heightOn:aGC |
94 | 103 |
"return the height of the receiver when displayed in aGC. |
104 |
Assume the GC's font is taken. If that is not the case in a |
|
105 |
particular subclass, this method is to be redefined there." |
|
106 |
||
107 |
^ aGC font height |
|
108 |
||
173 | 109 |
"Created: 12.5.1996 / 20:37:06 / cg" |
97 | 110 |
! |
111 |
||
173 | 112 |
widthOn:aGC |
97 | 113 |
"return the width (in device units) of the receiver when displayed in aGC" |
114 |
||
115 |
^ self subclassResponsibility |
|
173 | 116 |
|
117 |
"Created: 12.5.1996 / 20:53:09 / cg" |
|
58 | 118 |
! ! |
119 |
||
123 | 120 |
!ListEntry methodsFor:'string protocol'! |
121 |
||
122 |
< aString |
|
123 |
"behave like a string when comparing" |
|
124 |
||
125 |
^ self asString < aString asString |
|
126 |
||
127 |
"Created: 8.2.1996 / 12:01:29 / cg" |
|
128 |
! |
|
129 |
||
130 |
= aString |
|
131 |
"behave like a string when comparing" |
|
132 |
||
133 |
^ self asString = aString asString |
|
134 |
||
135 |
"Created: 8.2.1996 / 12:01:24 / cg" |
|
136 |
! |
|
137 |
||
138 |
at:index |
|
139 |
^ self string at:index |
|
140 |
||
141 |
"Created: 8.2.1996 / 12:53:06 / cg" |
|
142 |
! |
|
143 |
||
144 |
do:aBlock |
|
145 |
^ self string do:aBlock |
|
146 |
||
147 |
"Created: 8.2.1996 / 12:56:06 / cg" |
|
148 |
! |
|
149 |
||
150 |
size |
|
151 |
^ self string size |
|
152 |
||
153 |
"Created: 8.2.1996 / 12:54:45 / cg" |
|
154 |
! ! |
|
155 |
||
98 | 156 |
!ListEntry class methodsFor:'documentation'! |
157 |
||
158 |
version |
|
173 | 159 |
^ '$Header: /cvs/stx/stx/libwidg2/ListEntry.st,v 1.10 1996-05-12 19:06:18 cg Exp $' |
98 | 160 |
! ! |