ListEntry.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:53:39 +0200
changeset 6083 7a2c0a30e75c
parent 5927 f8763479f0c9
child 6119 68569809d6db
permissions -rw-r--r--
#REFACTORING by exept class: NoteBookView changed: #buttonPress:x:y: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5913
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
     1
"{ Encoding: utf8 }"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
     2
58
claus
parents:
diff changeset
     3
"
claus
parents:
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
86
4d7dbb5f1719 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
     5
	      All Rights Reserved
58
claus
parents:
diff changeset
     6
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    12
 hereby transferred.
claus
parents:
diff changeset
    13
"
1812
c9054636e3ea added #hash
Claus Gittinger <cg@exept.de>
parents: 821
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
c9054636e3ea added #hash
Claus Gittinger <cg@exept.de>
parents: 821
diff changeset
    15
5391
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    16
"{ NameSpace: Smalltalk }"
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    17
58
claus
parents:
diff changeset
    18
Object subclass:#ListEntry
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
    19
	instanceVariableNames:''
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
    20
	classVariableNames:''
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
    21
	poolDictionaries:''
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
    22
	category:'Views-Support'
58
claus
parents:
diff changeset
    23
!
claus
parents:
diff changeset
    24
5913
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    25
ListEntry subclass:#SeparatingLineEntry
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    26
	instanceVariableNames:'width'
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    27
	classVariableNames:''
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    28
	poolDictionaries:''
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    29
	privateIn:ListEntry
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    30
!
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    31
58
claus
parents:
diff changeset
    32
!ListEntry class methodsFor:'documentation'!
claus
parents:
diff changeset
    33
claus
parents:
diff changeset
    34
copyright
claus
parents:
diff changeset
    35
"
claus
parents:
diff changeset
    36
 COPYRIGHT (c) 1995 by Claus Gittinger
86
4d7dbb5f1719 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
    37
	      All Rights Reserved
58
claus
parents:
diff changeset
    38
claus
parents:
diff changeset
    39
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    40
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    42
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    43
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    44
 hereby transferred.
claus
parents:
diff changeset
    45
"
claus
parents:
diff changeset
    46
!
claus
parents:
diff changeset
    47
claus
parents:
diff changeset
    48
documentation
claus
parents:
diff changeset
    49
"
claus
parents:
diff changeset
    50
    ListEntry is an abstract superclass for objects which can be used
claus
parents:
diff changeset
    51
    in place of strings in ListViews or SelectionInListViews.
claus
parents:
diff changeset
    52
claus
parents:
diff changeset
    53
    If you want to create new subclasses, implement (at least) the methods
claus
parents:
diff changeset
    54
    found in the 'required protocol' category.
158
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    55
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    56
    [author:]
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    57
        Claus Gittinger
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    58
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    59
    [see also:]
431e38dfc5ab documentation
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    60
        ListView
58
claus
parents:
diff changeset
    61
"
claus
parents:
diff changeset
    62
! !
claus
parents:
diff changeset
    63
5913
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    64
!ListEntry class methodsFor:'instance creation'!
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    65
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    66
separatingLineEntry
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    67
    ^ SeparatingLineEntry new
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    68
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    69
    "Created: / 01-10-2018 / 11:22:03 / Claus Gittinger"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    70
! !
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
    71
5391
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    72
!ListEntry methodsFor:'comparing'!
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    73
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    74
< aString
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    75
    "behave like a string when comparing"
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    76
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    77
    ^ self asString < aString asString
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    78
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    79
    "Created: 8.2.1996 / 12:01:29 / cg"
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    80
!
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    81
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    82
= aString
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    83
    "behave like a string when comparing"
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    84
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    85
    self == aString ifTrue:[^ true].
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    86
    ^ self asString = aString asString
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    87
!
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    88
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    89
hash
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    90
    "return an integer useful for hashing"
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    91
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    92
    ^ self asString hash
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    93
! !
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
    94
669
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
    95
!ListEntry methodsFor:'printing & storing'!
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
    96
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
    97
printOn:aStream
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
    98
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
    99
    aStream nextPutAll:self asString.
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   100
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   101
    "Created: / 20.1.1998 / 14:11:02 / stefan"
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   102
!
58
claus
parents:
diff changeset
   103
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   104
printString
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   105
    ^ self asString
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   106
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   107
    "Created: 8.2.1996 / 11:56:14 / cg"
669
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   108
! !
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   109
82c3b58df75e Define #printOn:
Stefan Vogel <sv@exept.de>
parents: 600
diff changeset
   110
!ListEntry methodsFor:'queries'!
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   111
5927
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   112
hasChangeOfEmphasis
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   113
    "return true, if the receiver contains non-empty emphasis information
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   114
     i.e. any non-normal (=emphasized) characters"
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   115
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   116
    ^ false
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   117
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   118
    "Created: / 27-10-2018 / 09:51:45 / Claus Gittinger"
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   119
!
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   120
2655
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   121
hasIcon
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   122
    ^ false
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   123
!
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   124
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   125
hasImage
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   126
    ^ false
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   127
!
4b72f593d5ba hasImage, hasIcon queries added
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   128
3764
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   129
includes:aCharacter 
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   130
    "behave like a string when testing"
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   131
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   132
    ^ self string includes:aCharacter
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   133
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   134
    "Modified: / 30.10.1997 / 15:42:32 / cg"
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   135
!
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   136
1820
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   137
size
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   138
    "behave like a string when asked for the size"
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   139
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   140
    ^ self string size
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   141
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   142
    "Created: / 8.2.1996 / 12:54:45 / cg"
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   143
    "Modified: / 30.10.1997 / 15:42:19 / cg"
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   144
!
9b17f0c15849 category change
Claus Gittinger <cg@exept.de>
parents: 1812
diff changeset
   145
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   146
species
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   147
    ^ String
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   148
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   149
    "Created: 8.2.1996 / 12:52:38 / cg"
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   150
!
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   151
58
claus
parents:
diff changeset
   152
string
claus
parents:
diff changeset
   153
    ^ self asString
claus
parents:
diff changeset
   154
! !
claus
parents:
diff changeset
   155
claus
parents:
diff changeset
   156
!ListEntry methodsFor:'required protocol'!
claus
parents:
diff changeset
   157
claus
parents:
diff changeset
   158
asString
claus
parents:
diff changeset
   159
    "return the receiver as a string (for example, to store it in a file)"
claus
parents:
diff changeset
   160
claus
parents:
diff changeset
   161
    ^ self subclassResponsibility
claus
parents:
diff changeset
   162
!
claus
parents:
diff changeset
   163
109
Claus Gittinger <cg@exept.de>
parents: 108
diff changeset
   164
displayOn:aGC x:x y:y opaque:opaque
97
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   165
    "display the receiver on a GC"
58
claus
parents:
diff changeset
   166
claus
parents:
diff changeset
   167
    ^ self subclassResponsibility
94
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   168
!
58
claus
parents:
diff changeset
   169
173
d111da00daa9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   170
heightOn:aGC
94
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   171
    "return the height of the receiver when displayed in aGC.
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   172
     Assume the GC's font is taken. If that is not the case in a
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   173
     particular subclass, this method is to be redefined there."
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   174
821
fb1c37408cd9 need device font for query
ca
parents: 734
diff changeset
   175
    ^ aGC font heightOn:(aGC device) 
94
169802ee9a6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   176
173
d111da00daa9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   177
    "Created: 12.5.1996 / 20:37:06 / cg"
97
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   178
!
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   179
2196
2d64b9c3bcea add subclassresponsibility
Stefan Vogel <sv@exept.de>
parents: 1820
diff changeset
   180
sameStringAndEmphasisAs:aStringOrText
2d64b9c3bcea add subclassresponsibility
Stefan Vogel <sv@exept.de>
parents: 1820
diff changeset
   181
2d64b9c3bcea add subclassresponsibility
Stefan Vogel <sv@exept.de>
parents: 1820
diff changeset
   182
    ^ self subclassResponsibility
2d64b9c3bcea add subclassresponsibility
Stefan Vogel <sv@exept.de>
parents: 1820
diff changeset
   183
!
2d64b9c3bcea add subclassresponsibility
Stefan Vogel <sv@exept.de>
parents: 1820
diff changeset
   184
173
d111da00daa9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   185
widthOn:aGC
97
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   186
    "return the width (in device units) of the receiver when displayed in aGC"
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   187
306cb0aa67be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 94
diff changeset
   188
    ^ self subclassResponsibility
173
d111da00daa9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   189
d111da00daa9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   190
    "Created: 12.5.1996 / 20:53:09 / cg"
58
claus
parents:
diff changeset
   191
! !
claus
parents:
diff changeset
   192
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   193
!ListEntry methodsFor:'string protocol'!
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   194
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   195
at:index
600
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   196
    "behave like a string when accessing characters"
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   197
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   198
    ^ self string at:index
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   199
600
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   200
    "Created: / 8.2.1996 / 12:53:06 / cg"
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   201
    "Modified: / 30.10.1997 / 15:41:47 / cg"
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   202
!
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   203
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   204
do:aBlock
600
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   205
    "behave like a string when enumerating characters"
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   206
123
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   207
    ^ self string do:aBlock
5ac860f2e7b8 more String mimicri protocol
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   208
600
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   209
    "Created: / 8.2.1996 / 12:56:06 / cg"
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   210
    "Modified: / 30.10.1997 / 15:42:06 / cg"
5927
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   211
!
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   212
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   213
withoutAnyColorEmphasis
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   214
    "/ to be redefined in subclasses
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   215
    ^ self.
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   216
f8763479f0c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
   217
    "Created: / 27-10-2018 / 10:09:14 / Claus Gittinger"
600
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   218
! !
ccedbbd1eac9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   219
5913
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   220
!ListEntry::SeparatingLineEntry class methodsFor:'documentation'!
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   221
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   222
documentation
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   223
"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   224
  an experiment (unfinished)
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   225
  
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   226
  in a listView:
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   227
                                                                        [exBegin]
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   228
    |top slv wrapper l|
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   229
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   230
    l := OrderedCollection new.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   231
    l add:'one'.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   232
    l add:'two'.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   233
    l add:(ListEntry separatingLineEntry).
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   234
    l add:'three'.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   235
    
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   236
    slv := SelectionInListView new.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   237
    slv list:l.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   238
    wrapper := HVScrollableView forView:slv miniScrollerH:true.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   239
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   240
    top := StandardSystemView extent:150@200.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   241
    top add:wrapper in:(0.0@0.0 corner:1.0@1.0).
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   242
    top open.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   243
                                                                        [exEnd]
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   244
"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   245
! !
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   246
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   247
!ListEntry::SeparatingLineEntry methodsFor:'required protocol'!
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   248
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   249
displayOn:aGC x:x y:y opaque:opaque
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   250
    |hFont aFont yMiddle|
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   251
    
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   252
    "/ hFont := aGC font height.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   253
    aFont := aGC font ascent.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   254
    yMiddle := y - (aFont // 2).
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   255
    ^ aGC displayLineFromX:0 y:yMiddle toX:(width-1) y:yMiddle
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   256
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   257
    "Created: / 01-10-2018 / 11:26:20 / Claus Gittinger"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   258
!
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   259
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   260
widthOn:aGC
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   261
    width := aGC width.
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   262
    ^ width
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   263
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   264
    "Created: / 01-10-2018 / 11:25:33 / Claus Gittinger"
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   265
! !
b8dd70aeb192 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5391
diff changeset
   266
98
de14b996ee80 version at the end
Claus Gittinger <cg@exept.de>
parents: 97
diff changeset
   267
!ListEntry class methodsFor:'documentation'!
de14b996ee80 version at the end
Claus Gittinger <cg@exept.de>
parents: 97
diff changeset
   268
de14b996ee80 version at the end
Claus Gittinger <cg@exept.de>
parents: 97
diff changeset
   269
version
5391
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
   270
    ^ '$Header$'
3764
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   271
!
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   272
1414561b990a category of: #includes:
Claus Gittinger <cg@exept.de>
parents: 2655
diff changeset
   273
version_CVS
5391
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
   274
    ^ '$Header$'
98
de14b996ee80 version at the end
Claus Gittinger <cg@exept.de>
parents: 97
diff changeset
   275
! !
5391
4392c1cf3c16 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3764
diff changeset
   276