author | Stefan Vogel <sv@exept.de> |
Wed, 16 May 2018 08:37:31 +0200 | |
changeset 6320 | d52325b32f05 |
parent 6304 | 93a632d04f8c |
child 6336 | 034ad643fe9a |
permissions | -rw-r--r-- |
6304 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
5 | 4 |
COPYRIGHT (c) 1989 by Claus Gittinger |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5 |
All Rights Reserved |
0 | 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 |
" |
|
2180
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
14 |
"{ Package: 'stx:libwidg' }" |
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
15 |
|
5369 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
0 | 18 |
View subclass:#ListView |
3563 | 19 |
instanceVariableNames:'list firstLineShown nFullLinesShown nLinesShown fgColor bgColor |
20 |
partialLines leftMargin topMargin textStartLeft textStartTop |
|
21 |
innerWidth tabPositions lineSpacing fontHeight fontAscent |
|
22 |
fontIsFixedWidth fontWidth autoScroll autoScrollBlock |
|
23 |
autoScrollDeltaT wordCheck includesNonStrings widthOfWidestLine |
|
24 |
listMsg viewOrigin listChannel backgroundAlreadyClearedColor |
|
4747 | 25 |
scrollWhenUpdating scrollLocked lineEndCRLF highlightAreas |
26 |
compareModelOnUpdate expandTabsWhenUpdating |
|
27 |
checkLineEndConventionWhenUpdating |
|
4751 | 28 |
checkedLinesForWidthOfContentsComputation' |
3563 | 29 |
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor DefaultTabPositions |
30 |
UserDefaultTabPositions DefaultLeftMargin DefaultTopMargin' |
|
31 |
poolDictionaries:'' |
|
32 |
category:'Views-Text' |
|
0 | 33 |
! |
34 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
35 |
Object subclass:#HighlightArea |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
36 |
instanceVariableNames:'startLine startCol endLine endCol fgColor bgColor' |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
37 |
classVariableNames:'' |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
38 |
poolDictionaries:'' |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
39 |
privateIn:ListView |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
40 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
41 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
42 |
Object subclass:#SearchSpec |
5076 | 43 |
instanceVariableNames:'pattern match ignoreCase variable fullWord forward |
5544 | 44 |
atBeginOfLineOnly ignoreDiacritics regexMatch wrapAtEndOfText' |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
45 |
classVariableNames:'' |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
46 |
poolDictionaries:'' |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
47 |
privateIn:ListView |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
48 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
49 |
|
851
b9d71ccdefaa
care for new fontParameters, if changing from a non-string-list
Claus Gittinger <cg@exept.de>
parents:
837
diff
changeset
|
50 |
!ListView class methodsFor:'documentation'! |
0 | 51 |
|
38 | 52 |
copyright |
53 |
" |
|
54 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
55 |
All Rights Reserved |
38 | 56 |
|
57 |
This software is furnished under a license and may be used |
|
58 |
only in accordance with the terms of that license and with the |
|
59 |
inclusion of the above copyright notice. This software may not |
|
60 |
be provided or otherwise made available to, or used by, any |
|
61 |
other person. No title to or ownership of the software is |
|
62 |
hereby transferred. |
|
63 |
" |
|
64 |
! |
|
65 |
||
0 | 66 |
documentation |
67 |
" |
|
38 | 68 |
a View for (string-)lists. |
69 |
||
4751 | 70 |
This class can only passively display collections of strings, |
71 |
text or display objects which behave line-like (i.e. all have constant height). |
|
72 |
||
73 |
Selections, editing, cursors etc. must be implemented in subclasses. |
|
74 |
(see SelectionInListView, TextView etc.) |
|
38 | 75 |
|
76 |
This code currently handles only fixed-height fonts correctly - |
|
4751 | 77 |
it should be rewritten in some places to not compute the position/height from |
78 |
the view's font height, but by accumulating line heights... |
|
0 | 79 |
|
38 | 80 |
It can only scroll by full lines vertically (i.e. setting firstLineShown to ~~ 1) |
81 |
which should be changed to have this behavior optionally for smooth scroll. |
|
5862 | 82 |
|
4751 | 83 |
The text is internally kept in the 'list' instance variable, and is supposed to consist |
5862 | 84 |
of a collection (Ordered-, String- or VirtualCollection) of line entries. |
4751 | 85 |
Typically, individual entries are either strings/text or nil (for empty lines). |
86 |
However, ANY object which supports the displayOn: and widthIn: protocol can be |
|
120 | 87 |
used - see MultipleColumnListEntry as an example. |
88 |
Therefore, ListView (and all subclasses) are prepared to handle non-string entries |
|
4751 | 89 |
(especially: attributed Text and labelAndIcon-like entities). |
90 |
||
5862 | 91 |
The internal version of the text has tabulators expanded to blanks. |
92 |
ListView is not prepared to deal with them. |
|
93 |
When text is exchanged with an external medium (i.e. reading/writing files), |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
94 |
these are expanded/compressed assuming a tab-setting of 8. |
4751 | 95 |
This is done independent of the user's tab setting, which is used ONLY for positioning, |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
96 |
while the text is edited. |
4751 | 97 |
Thus, even if the tab setting is multiple of 4's, tabs are |
5862 | 98 |
written in multiples of 8 when the text is saved. |
99 |
Since this is the default on all ascii terminals and printers, |
|
100 |
this assures that the text looks correctly indented when finally printed. |
|
120 | 101 |
|
305 | 102 |
Notice: |
4751 | 103 |
------- |
104 |
ListView is one of the OLDEST widget classes in the system and definitely requires a major rewrite: |
|
305 | 105 |
|
120 | 106 |
Due to historic reasons (ListView implemented scrolling before the general |
107 |
scrolling code in View was added), this one does scrolling different from all other |
|
4159
3032a5a9d8de
comment and warning in documentation
Claus Gittinger <cg@exept.de>
parents:
4070
diff
changeset
|
108 |
views. The general scrolling code (in View) uses the transformation for transparent scrolling |
4751 | 109 |
using the viewOrigin (transparent means, that the code does not need to know - it simply draws |
110 |
as if all of the text was visible). |
|
5862 | 111 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
112 |
Here in ListView, the transformation is not used, instead it is done again, and different, |
4751 | 113 |
by keeping the firstLineShown (i.e. vertical offset) and leftOffset (horizontal offset). |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
114 |
Even worse: the firstLineShown is a line-index, the most annoying consequence of this is that |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
115 |
scrolling is done by lines here, whereas it is done in pixels in the View class. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
116 |
Thus, be very careful, when changing things (better: don't touch it ;-). |
4751 | 117 |
Also, the viewOrigin variable is only valid for the x coordinate. The viewOrigin's y is always 0 !! |
120 | 118 |
|
305 | 119 |
Also, all controller functionality is completely performed by the listView |
120 |
(and subclasses) itself. It is still possible, to define and set a specialized |
|
121 |
controller, though. I.e. if you like to change the input behavior, define |
|
122 |
a corresponding controller class and intersect the keyXXX/buttonXXX messages |
|
123 |
there. |
|
124 |
||
4751 | 125 |
This may be totally rewritten ... so don't depend on the internals; especially the scrolling |
120 | 126 |
code will be totally removed here and the inherited functionality be used in the next version. |
38 | 127 |
|
4751 | 128 |
Also Notice: |
129 |
------------ |
|
130 |
because ListView was written at a time when most of the graphics was done via remote connections |
|
131 |
(X-window network protocol), it is highly tuned to avoid redraw operations. Thus, it can be used |
|
132 |
happily over a slow WLAN (say: 64kBit connection). |
|
133 |
In that, it performed *much* better than other widgets, especialy Java and Qt, some of which are |
|
134 |
hardly usable via the network. |
|
135 |
It may be questionable whether this is still a requirement these days, where network connections |
|
5862 | 136 |
are usually pretty fast. |
137 |
However, the author insists on this to remain as it is, because we do have customers |
|
138 |
and applications which rely on relatively good remote display performance!! |
|
4751 | 139 |
Future underlying graphics may well become network dependent in the future, for example, when |
140 |
the display connection is implemented as an RPC into a web browser... |
|
141 |
||
5862 | 142 |
Also Notice (Virtual line collections): |
4751 | 143 |
------------ |
144 |
ListView shall be configurable to avoid accesses to its underlying list if required. |
|
145 |
Currently, it can be customized to disable lineWidth computation, tab expansion and scanning for |
|
5862 | 146 |
non-string entries. |
147 |
All of which is required when huge texts which are not in memory are to be displayed |
|
148 |
(for example: a virtual array of 10million text lines). |
|
149 |
Please be careful to not reintroduce such code when adding features |
|
150 |
(as happened in the past). ListView shall always be configurable to only access |
|
151 |
a minimum subset of the line collection (i.e. only the currently visible page), |
|
152 |
by customizing the tab-expansion, line-end and widthOfContents behavior. |
|
0 | 153 |
|
586 | 154 |
[Instance variables:] |
0 | 155 |
|
1325 | 156 |
list <aCollection> the text strings, a collection of lines. |
5862 | 157 |
Nils may be used for empty lines. |
1325 | 158 |
|
159 |
firstLineShown <Number> the index of the 1st visible line (1 ..) |
|
160 |
leftOffset <Number> left offset for horizontal scroll |
|
161 |
||
162 |
nFullLinesShown <Number> the number of unclipped lines in visible area |
|
5862 | 163 |
(internal; updated on size changes) |
1325 | 164 |
nLinesShown <Number> the number of lines in visible area, incl. partial |
5862 | 165 |
(internal; updated on size changes) |
1325 | 166 |
|
167 |
fgColor <Color> color to draw characters |
|
168 |
bgColor <Color> the background |
|
169 |
||
170 |
partialLines <Boolean> allow last line to be partial displayed |
|
171 |
leftMargin <Number> margin at left in pixels |
|
172 |
topMargin <Number> margin at top in pixels |
|
173 |
textStartLeft <Number> margin + leftMargin (internal) |
|
174 |
textStartTop <Number> margin + topMargin (internal) |
|
175 |
innerWidth <Number> width - margins (internal) |
|
176 |
tabPositions <aCollection> tab stops (cols) |
|
177 |
fontHeight <Number> font height in pixels (internal) |
|
178 |
fontAscent <Number> font ascent in pixels (internal) |
|
6098 | 179 |
fontIsFixed <Boolean> true if it's a fixed font (internal) |
1325 | 180 |
fontWidth <Number> width of space (internal) |
181 |
lineSpacing <Number> pixels between lines |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
182 |
lastSearchPattern <String> last pattern for searching |
5862 | 183 |
(kept to provide a default for next search) |
1325 | 184 |
lastSearchIgnoredCase <Boolean> last search ignored case |
5862 | 185 |
(kept to provide a default for next search) |
1325 | 186 |
wordCheck <Block> rule used for check for word boundaries in word select |
5862 | 187 |
The default rule is to return true for alphaNumeric characters. |
188 |
(can be changed to allow for underscore and other |
|
189 |
characters to be treated as alphaCharacters) |
|
1325 | 190 |
|
191 |
autoScrollBlock <Block> block installed as timeoutBlock when doing an |
|
5862 | 192 |
autoScroll (internal) |
1325 | 193 |
autoScrollDeltaT computed scroll time delta in seconds (internal) |
194 |
||
195 |
includesNonStrings cached flag if any non-strings are in list |
|
196 |
widthOfWidestLine cached width of widest line |
|
197 |
listMsg if view has a model and listMsg is non-nil, |
|
5862 | 198 |
this is sent to the model to acquired a new contents |
199 |
whenever a change of the aspect (aspectMsg) occurs. |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
200 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
201 |
viewOrigin the current origin |
1325 | 202 |
|
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
203 |
backgroundAlreadyClearedColor internal; speedup by avoiding |
5862 | 204 |
multiple fills when drawing |
205 |
internal lines |
|
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
206 |
|
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
207 |
scrollWhenUpdating |
5862 | 208 |
<Symbol> defines how the view is scrolled if the |
209 |
model changes its value by some outside activity |
|
210 |
(i.e. not by user input). |
|
211 |
Can be one of: |
|
212 |
#keep / nil -> stay unchanged |
|
213 |
#endOfText -> scroll to the end |
|
214 |
#beginOfText -> scroll to the top |
|
215 |
The default is #beginOfText (i.e. scroll to top). |
|
120 | 216 |
|
586 | 217 |
[StyleSheet parameters:] |
77 | 218 |
|
1325 | 219 |
textForegroundColor defaults to Black |
220 |
textBackgroundColor defaults to White |
|
221 |
textFont defaults to defaultFont |
|
222 |
textTabPositions defaults to #(1 9 17 25 ...) |
|
586 | 223 |
|
224 |
[author:] |
|
5862 | 225 |
Claus Gittinger |
586 | 226 |
|
227 |
[see also:] |
|
5862 | 228 |
TextView EditTextView |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
229 |
|
0 | 230 |
" |
451 | 231 |
! |
232 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
233 |
examples |
451 | 234 |
" |
235 |
ListViews alone are rarely used - its mostly an abstract superclass |
|
236 |
for TextView, EditTextView and SelectionInListView. |
|
237 |
||
238 |
anyway, here are a few examples: |
|
239 |
||
240 |
basic simple setup: |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
241 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
242 |
|top l| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
243 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
244 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
245 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
246 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
247 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
248 |
l list:#('one' 'two' 'three'). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
249 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
250 |
top open |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
251 |
[exEnd] |
451 | 252 |
|
253 |
||
254 |
||
255 |
specifying textMargins (these have NOTHING to do with the viewInset): |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
256 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
257 |
|top l| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
258 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
259 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
260 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
261 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
262 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
263 |
l list:#('one' 'two' 'three'). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
264 |
l topMargin:10. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
265 |
l leftMargin:20. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
266 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
267 |
top open |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
268 |
[exEnd] |
451 | 269 |
|
270 |
||
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
271 |
|
451 | 272 |
globally set the fg/bg colors: |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
273 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
274 |
|top l| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
275 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
276 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
277 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
278 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
279 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
280 |
l list:#('one' 'two' 'three'). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
281 |
l foregroundColor:(Color white). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
282 |
l backgroundColor:(Color blue). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
283 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
284 |
top open |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
285 |
[exEnd] |
451 | 286 |
|
287 |
||
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
288 |
|
627 | 289 |
non-string (text) entries: |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
290 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
291 |
|top list l| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
292 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
293 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
294 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
295 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
296 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
297 |
list := #('all' 'of' 'your' 'preferred' 'colors') |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
298 |
with:#(red green blue 'orange' cyan) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
299 |
collect:[:s :clr | |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
300 |
Text string:s |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
301 |
emphasis:(Array with:#bold |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
302 |
with:(#color->(Color name:clr))) ]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
303 |
l list:list. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
304 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
305 |
top open |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
306 |
[exEnd] |
627 | 307 |
|
308 |
||
309 |
||
310 |
generic non-string entries: |
|
311 |
(notice: ColoredListEntry is obsoleted by Text) |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
312 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
313 |
|top list l| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
314 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
315 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
316 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
317 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
318 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
319 |
list := #('all' 'of' 'your' 'preferred' 'colors') |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
320 |
with:#(red green blue 'orange' cyan) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
321 |
collect:[:s :clr | ColoredListEntry string:s color:(Color name:clr) ]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
322 |
l list:list. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
323 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
324 |
top open |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
325 |
[exEnd] |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
326 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
327 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
328 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
329 |
using a model (default listMessage is aspectMessage): |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
330 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
331 |
|top model l theModelsText| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
332 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
333 |
model := Plug new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
334 |
model respondTo:#modelsAspect |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
335 |
with:[ theModelsText ]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
336 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
337 |
top := StandardSystemView new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
338 |
top extent:100@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
339 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
340 |
l := ListView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
341 |
l model:model. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
342 |
l aspect:#modelsAspect. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
343 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
344 |
top open. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
345 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
346 |
Delay waitForSeconds:3. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
347 |
theModelsText := #('foo' 'bar' 'baz'). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
348 |
model changed:#modelsAspect. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
349 |
[exEnd] |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
350 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
351 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
352 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
353 |
using a model with different aspects |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
354 |
for two listViews: |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
355 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
356 |
|top model l1 l2 plainText| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
357 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
358 |
plainText := #(''). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
359 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
360 |
model := Plug new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
361 |
model respondTo:#modelsUppercaseText |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
362 |
with:[ plainText asStringCollection |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
363 |
collect:[:l | l asUppercase]]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
364 |
model respondTo:#modelsLowercaseText |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
365 |
with:[ plainText asStringCollection |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
366 |
collect:[:l | l asLowercase]]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
367 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
368 |
top := StandardSystemView extent:200@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
369 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
370 |
l1 := ListView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
371 |
l1 model:model. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
372 |
l1 aspect:#modelsAspect. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
373 |
l1 listMessage:#modelsUppercaseText. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
374 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
375 |
l2 := ListView origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
376 |
l2 model:model. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
377 |
l2 aspect:#modelsAspect. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
378 |
l2 listMessage:#modelsLowercaseText. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
379 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
380 |
top open. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
381 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
382 |
Delay waitForSeconds:3. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
383 |
plainText := #('foo' 'bar' 'baz'). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
384 |
model changed:#modelsAspect. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
385 |
[exEnd] |
4536 | 386 |
|
387 |
using a big list (100000 lines), |
|
388 |
wrapping in a ScrollableView: |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
389 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
390 |
|bigList top lv| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
391 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
392 |
bigList := (1 to:100000) collect:[:lineNr | 'List line Nr. ' , lineNr printString]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
393 |
bigList at:10 put:('Some Text ' asText , 'with Bold part' allBold). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
394 |
bigList at:20 put:('Some Text ' asText , 'with Italic part' allItalic). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
395 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
396 |
top := StandardSystemView extent:200@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
397 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
398 |
lv := HVScrollableView for:ListView in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
399 |
lv origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
400 |
lv list:bigList expandTabs:false scanForNonStrings:false includesNonStrings:false. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
401 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
402 |
top open. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
403 |
[exEnd] |
4536 | 404 |
|
405 |
using a huge virtual list (1 mio simulated lines), |
|
406 |
wrapping in a ScrollableView: |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
407 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
408 |
|virtualList top lv| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
409 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
410 |
virtualList := Plug new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
411 |
virtualList inheritFrom:SequenceableCollection. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
412 |
virtualList respondTo:#size with:[ 1000000 ]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
413 |
virtualList respondTo:#at: with:[:lineNr | 'List line Nr. ' , lineNr printString ]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
414 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
415 |
top := StandardSystemView extent:200@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
416 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
417 |
lv := ScrollableView for:ListView in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
418 |
lv origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
419 |
lv list:virtualList expandTabs:false scanForNonStrings:false includesNonStrings:false. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
420 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
421 |
top open. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
422 |
[exEnd] |
4751 | 423 |
|
424 |
||
425 |
using a huge virtual array (1 mio simulated lines), |
|
426 |
wrapping in a ScrollableView. |
|
427 |
To simulate an expensive computation, a delay is planted into the line generator; |
|
428 |
Startup and display of page full of lines should not take longer than the number of lines shown: |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
429 |
[exBegin] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
430 |
|virtualList top lv| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
431 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
432 |
virtualList := VirtualArray new. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
433 |
virtualList |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
434 |
setSize:1000000; |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
435 |
generator:[:index | Transcript showCR:index. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
436 |
Delay waitForSeconds:0.5. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
437 |
'%1 -> %2' bindWith:index with:index squared]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
438 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
439 |
top := StandardSystemView extent:200@200. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
440 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
441 |
lv := ScrollableView for:ListView in:top. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
442 |
lv origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
443 |
lv expandTabsWhenUpdating:false. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
444 |
lv checkLineEndConventionWhenUpdating:false. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
445 |
lv checkedLinesForWidthOfContentsComputation:-1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
446 |
lv list:virtualList. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
447 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
448 |
top open. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
449 |
[exEnd] |
451 | 450 |
" |
0 | 451 |
! ! |
452 |
||
5756 | 453 |
!ListView class methodsFor:'accessing private classes'! |
454 |
||
455 |
searchSpec |
|
456 |
^ SearchSpec |
|
457 |
! ! |
|
458 |
||
851
b9d71ccdefaa
care for new fontParameters, if changing from a non-string-list
Claus Gittinger <cg@exept.de>
parents:
837
diff
changeset
|
459 |
!ListView class methodsFor:'defaults'! |
0 | 460 |
|
105 | 461 |
defaultTabPositions |
6213 | 462 |
"return an array containing the styleSheet's default tab positions" |
2378 | 463 |
|
3777 | 464 |
^ DefaultTabPositions ? self tab4Positions |
6213 | 465 |
|
466 |
"Modified (comment): / 12-10-2017 / 13:15:41 / cg" |
|
2378 | 467 |
! |
468 |
||
469 |
defaultTabPositions:aVector |
|
6213 | 470 |
"set the array containing the styleSheet's tab positions" |
2378 | 471 |
|
472 |
DefaultTabPositions := aVector |
|
473 |
||
474 |
" |
|
3777 | 475 |
ListView defaultTabPositions:(ListView tab4Positions) |
2378 | 476 |
" |
6213 | 477 |
|
478 |
"Modified (comment): / 12-10-2017 / 13:15:32 / cg" |
|
105 | 479 |
! |
480 |
||
7 | 481 |
tab4Positions |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
482 |
"return an array containing tab positions for 4-col tabs" |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
483 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
484 |
^ #(1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
485 |
85 89 93 97 101 105 109 113 114 121 125 129 133 137 141 145) |
120 | 486 |
! |
487 |
||
488 |
tab8Positions |
|
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
489 |
"return an array containing tab positions for 8-col tabs" |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
490 |
|
120 | 491 |
^ #(1 9 17 25 33 41 49 57 65 73 81 89 97 105 113 121 129 137 145) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
492 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
493 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
494 |
updateStyleCache |
439
4c6799ace14b
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
427
diff
changeset
|
495 |
"extract values from the styleSheet and cache them in class variables" |
4c6799ace14b
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
427
diff
changeset
|
496 |
|
1354 | 497 |
<resource: #style (#'text.foregroundColor' #'text.backgroundColor' |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
498 |
#'text.tabPositions' |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
499 |
#'text.font')> |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
500 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
501 |
DefaultForegroundColor := StyleSheet colorAt:'text.foregroundColor' default:Color black. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
502 |
DefaultBackgroundColor := StyleSheet colorAt:'text.backgroundColor' default:Color white. |
1354 | 503 |
DefaultFont := StyleSheet fontAt:'text.font'. |
5617 | 504 |
"/ that's not style, but a personal setting |
505 |
"/ DefaultTabPositions := StyleSheet at:'text.tabPositions'. |
|
506 |
"/ DefaultTabPositions isNil ifTrue:[DefaultTabPositions := self defaultTabPositions]. |
|
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
507 |
DefaultLeftMargin := 0.5. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
508 |
DefaultTopMargin := 0.5. |
439
4c6799ace14b
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
427
diff
changeset
|
509 |
|
5617 | 510 |
"Modified: / 31-03-2016 / 10:49:45 / cg" |
2378 | 511 |
! |
512 |
||
513 |
userDefaultTabPositions |
|
6213 | 514 |
"return an array containing the user's default tab positions" |
2378 | 515 |
|
516 |
^ UserDefaultTabPositions |
|
6213 | 517 |
|
518 |
"Modified (comment): / 12-10-2017 / 13:15:19 / cg" |
|
2378 | 519 |
! |
520 |
||
521 |
userDefaultTabPositions:aVector |
|
6213 | 522 |
"set the array containing the user's tab positions" |
2378 | 523 |
|
524 |
UserDefaultTabPositions := aVector |
|
525 |
||
526 |
" |
|
527 |
self userDefaultTabPositions:(self tab4Positions) |
|
528 |
" |
|
6213 | 529 |
|
530 |
"Modified (comment): / 12-10-2017 / 13:15:13 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
531 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
532 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
533 |
!ListView methodsFor:'accessing'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
534 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
535 |
innerHeight |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
536 |
"return the number of pixels visible of the contents |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
537 |
- redefined since ListView adds another margin to start the text |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
538 |
somewhat to indented from the 3D border." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
539 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
540 |
^ height - (2 * margin) - topMargin |
0 | 541 |
! ! |
542 |
||
2133 | 543 |
!ListView methodsFor:'accessing-behavior'! |
2132 | 544 |
|
4747 | 545 |
checkLineEndConventionWhenUpdating |
546 |
"return the line-end convention check when updating behavior. |
|
547 |
If true (the default), the first line of the list given is checked for having a |
|
548 |
cr-lf line end (which is a DOS convention), and the lineEndCRLF flag is set dynamically. |
|
549 |
If false, the lineEndCRLF remains as specified by the user. |
|
550 |
You may want to disable this flag if it is very expensive to generate a line |
|
551 |
(although, only the very first line is checked, anyway)" |
|
552 |
||
553 |
^ checkLineEndConventionWhenUpdating |
|
554 |
! |
|
555 |
||
556 |
checkLineEndConventionWhenUpdating:aBoolean |
|
557 |
"define the line-end convention check when updating behavior. |
|
558 |
If true (the default), the first line of the list given is checked for having a |
|
559 |
cr-lf line end (which is a DOS convention), and the lineEndCRLF flag is set dynamically. |
|
560 |
If false, the lineEndCRLF remains as specified by the user. |
|
561 |
You may want to disable this flag if it is very expensive to generate a line |
|
562 |
(although, only the very first line is checked, anyway)" |
|
563 |
||
564 |
checkLineEndConventionWhenUpdating := aBoolean |
|
565 |
! |
|
566 |
||
4751 | 567 |
checkedLinesForWidthOfContentsComputation |
5861 | 568 |
"return how many and which lines to consider in the widthOfContents computation, |
4751 | 569 |
which is needed by the scrollBar interface. |
6229 | 570 |
|
4751 | 571 |
If nil (the default), all lines are processed and the width of the longest line is taken. |
572 |
If positive, that number of lines is checked near the start of the text, |
|
573 |
if negative, from the end of the text. |
|
6229 | 574 |
If 0, the width is dynamically readjusted, as lines are drawn. |
575 |
||
4751 | 576 |
You may want to change this to 1 if it is guaranteed that all linesa are of the same width, |
577 |
or -1, if all are shorter than the last line. |
|
578 |
(useful, for example, when it is very expensive to generate all lines, and a huge number |
|
579 |
of same-width lines is generated through a virtual array)" |
|
580 |
||
581 |
^ checkedLinesForWidthOfContentsComputation |
|
6229 | 582 |
|
583 |
"Modified (comment): / 19-11-2017 / 14:09:19 / cg" |
|
4751 | 584 |
! |
585 |
||
586 |
checkedLinesForWidthOfContentsComputation:aNumberOrNil |
|
5861 | 587 |
"set how many and which lines to consider in the widthOfContents computation, |
4751 | 588 |
which is needed by the scrollBar interface. |
6229 | 589 |
|
4751 | 590 |
If nil (the default), all lines are processed and the width of the longest line is taken. |
591 |
If positive, that number of lines is checked near the start of the text, |
|
592 |
if negative, from the end of the text. |
|
593 |
If 0, the width is dynamically re adjusted, as lines are drawn. |
|
6229 | 594 |
|
4751 | 595 |
You may want to change this to 1 if it is guaranteed that all linesa are of the same width, |
596 |
or -1, if all are shorter than the last line. |
|
597 |
(useful, for example, when it is very expensive to generate all lines, and a huge number |
|
598 |
of same-width lines is generated through a virtual array)" |
|
599 |
||
600 |
checkedLinesForWidthOfContentsComputation := aNumberOrNil |
|
6229 | 601 |
|
602 |
"Modified (comment): / 19-11-2017 / 14:09:13 / cg" |
|
4751 | 603 |
! |
604 |
||
4747 | 605 |
compareModelWhenUpdating |
606 |
"return the compare when updating behavior. |
|
6231 | 607 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
608 |
If true (the default), the list of lines as given due to a model update |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
609 |
is processed and compared against the currently shown text. |
4747 | 610 |
If they are the same, no action is taken. |
6231 | 611 |
|
4747 | 612 |
This behavior is ok in 99.99% of all applications. |
613 |
However, you may turn this off iff: |
|
6231 | 614 |
- it is very expensive to process the list (for example, because the list |
615 |
is defined by a virtual array, which computes the lines dynamically, on |
|
616 |
the fly). |
|
4747 | 617 |
One use where this flag should be turned off is in the hex-memory display, |
618 |
which is able to simulate texts with millions of lines, but they are actually |
|
619 |
simulated by generating the presented lines dynamically, as they are displayed." |
|
620 |
||
621 |
^ compareModelOnUpdate |
|
6231 | 622 |
|
623 |
"Modified (comment): / 19-11-2017 / 14:14:04 / cg" |
|
4747 | 624 |
! |
625 |
||
626 |
compareModelWhenUpdating:aBoolean |
|
627 |
"define the compare when updating behavior. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
628 |
If true (the default), the list of lines as given due to a model update |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
629 |
is processed and compared against the currently shown text. |
4747 | 630 |
If they are the same, no action is taken. |
631 |
This behavior is ok in 99.99% of all applications. |
|
632 |
However, you may turn this off iff: |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
633 |
- it is very expensive to process the list (for example, because the list |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
634 |
is defined by a virtual array, which computes the lines dynamically, on |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
635 |
the fly). |
4747 | 636 |
One use where this flag should be turned off is in the hex-memory display, |
637 |
which is able to simulate texts with millions of lines, but they are actually |
|
638 |
simulated by generating the presented lines dynamically, as they are displayed." |
|
639 |
||
640 |
compareModelOnUpdate := aBoolean |
|
641 |
! |
|
642 |
||
643 |
expandTabsWhenUpdating |
|
644 |
"return the tab expansion behavior. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
645 |
If true (the default), the list of lines as given via #list: or |
4747 | 646 |
due to a model update is processed and lines are replaced by lines with |
647 |
tabs expanded. |
|
648 |
This behavior is ok in 99.99% of all applications. |
|
649 |
However, you may turn this off iff: |
|
5843 | 650 |
- you are certain, that no tabs are in the passed in list |
651 |
- it is very expensive to process the list (for example, because the list |
|
652 |
is defined by a virtual array, which computes the lines dynamically, on the fly). |
|
4747 | 653 |
One use where this flag should be turned off is in the hex-memory display, |
654 |
which is able to simulate texts with millions of lines, but they are actually |
|
5843 | 655 |
simulated by generating the presented lines dynamically, as they are displayed. |
656 |
Notice, that to totally prevent scanning og the whole text, you may have to turn off |
|
657 |
other flags, such as checkineEndConventionWhenUpdating" |
|
4747 | 658 |
|
659 |
^ expandTabsWhenUpdating |
|
660 |
! |
|
661 |
||
662 |
expandTabsWhenUpdating:aBoolean |
|
663 |
"define the tab expansion behavior. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
664 |
If true (the default), the list of lines as given via #list: or |
4747 | 665 |
due to a model update is processed and lines are replaced by lines with |
666 |
tabs expanded. |
|
667 |
This behavior is ok in 99.99% of all applications. |
|
668 |
However, you may turn this off iff: |
|
5843 | 669 |
- you are certain, that no tabs are in the passed in list |
670 |
- it is very expensive to process the list (for example, because the list |
|
671 |
is defined by a virtual array, which computes the lines dynamically, on the fly). |
|
4747 | 672 |
One use where this flag should be turned off is in the hex-memory display, |
673 |
which is able to simulate texts with millions of lines, but they are actually |
|
5843 | 674 |
simulated by generating the presented lines dynamically, as they are displayed. |
675 |
Notice, that to totally prevent scanning og the whole text, you may have to turn off |
|
676 |
other flags, such as checkineEndConventionWhenUpdating" |
|
4747 | 677 |
|
678 |
expandTabsWhenUpdating := aBoolean |
|
679 |
! |
|
680 |
||
6179 | 681 |
isReadOnly |
682 |
"return true, if the text is readonly." |
|
683 |
||
684 |
^ true |
|
685 |
! |
|
686 |
||
3314 | 687 |
lineEndCRLF |
4610 | 688 |
"answer true, if CRLF is used for the line end. |
689 |
This is true for DOS/Windows files. |
|
690 |
Otherwise 'Character cr' is the line end (which is LF in unix)" |
|
691 |
||
3314 | 692 |
^ lineEndCRLF ? false |
693 |
||
694 |
"Created: / 04-07-2006 / 19:05:01 / fm" |
|
695 |
! |
|
696 |
||
6179 | 697 |
readOnly:aBoolean |
698 |
"for protocol compatibility with editTextViews, |
|
699 |
but actually ignored" |
|
700 |
! |
|
701 |
||
2325 | 702 |
scrollWhenUpdating |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
703 |
"return the scroll behavior, when I get a new text |
2325 | 704 |
(via the model or the #contents/#list) |
705 |
Possible returnValues are: |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
706 |
#keep / nil -> no change |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
707 |
#endOfText -> scroll to the end |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
708 |
#beginOfText -> scroll to the top |
3116
2df69a526f06
default for scrollWhenUpdating is now #keep
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
709 |
The default is #keep. |
2325 | 710 |
This may be useful for fields which get new values assigned from |
711 |
the program (i.e. not from the user)" |
|
712 |
||
713 |
^ scrollWhenUpdating |
|
714 |
! |
|
715 |
||
2132 | 716 |
scrollWhenUpdating:aSymbolOrNil |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
717 |
"define how to scroll, when I get a new text |
2132 | 718 |
(via the model or the #contents/#list) |
719 |
Allowed arguments are: |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
720 |
#keep / nil -> no change |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
721 |
#endOfText -> scroll to the end |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
722 |
#beginOfText -> scroll to the top |
3116
2df69a526f06
default for scrollWhenUpdating is now #keep
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
723 |
The default is #keep. |
2132 | 724 |
This may be useful for fields which get new values assigned from |
725 |
the program (i.e. not from the user)" |
|
726 |
||
727 |
scrollWhenUpdating := aSymbolOrNil |
|
4403 | 728 |
! |
729 |
||
730 |
wordCheckBlock:aBlock |
|
731 |
"set the word-check block - this block is called with a character argument, |
|
732 |
when the end/beginning of a word is searched. |
|
733 |
It should return true, if the character belongs to the word. |
|
734 |
The default block is set in #initialize, and returns true for alphanumeric |
|
735 |
(national) characters. |
|
736 |
Applications may change it to include underlines, dollars or other characters. |
|
737 |
(a C/C++ editor would include underlines ...)" |
|
738 |
||
739 |
wordCheck := aBlock. |
|
740 |
||
741 |
"Modified: 22.5.1996 / 12:26:55 / cg" |
|
2132 | 742 |
! ! |
743 |
||
105 | 744 |
!ListView methodsFor:'accessing-contents'! |
745 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
746 |
add:aString |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
747 |
"add a line and redisplay" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
748 |
|
2219
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
749 |
|fontHeightBefore| |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
750 |
|
6304 | 751 |
list isNil ifTrue:[list := StringCollection new]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
752 |
list add:aString. |
2219
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
753 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
754 |
includesNonStrings ifFalse:[ |
6304 | 755 |
includesNonStrings := (aString notNil and:[(aString isSingleByteString) not]). |
756 |
includesNonStrings ifTrue:[ |
|
757 |
fontHeightBefore := fontHeight. |
|
758 |
self getFontParameters. |
|
759 |
fontHeightBefore ~~ fontHeight ifTrue:[ |
|
760 |
self invalidate |
|
761 |
]. |
|
762 |
]. |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
763 |
]. |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
764 |
|
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
765 |
widthOfWidestLine notNil ifTrue:[ |
6304 | 766 |
self recomputeWidthOfWidestLineFor:aString old:nil. |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
767 |
]. |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
768 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
769 |
shown ifTrue:[ |
6304 | 770 |
self redrawLine:(self size). |
2182
fb9bc638123a
mus notify textChanged in #add: / #add:beforeIndex:
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
771 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
772 |
self enqueueDelayedContentsChangedNotification. "recompute scrollbars" |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
773 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
774 |
"Modified: / 25-07-2012 / 12:00:20 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
775 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
776 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
777 |
add:aString beforeIndex:index |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
778 |
"add a line and redisplay" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
779 |
|
2348 | 780 |
|lastShown| |
781 |
||
6304 | 782 |
list isNil ifTrue:[list := StringCollection new]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
783 |
list add:aString beforeIndex:index. |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
784 |
|
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
785 |
widthOfWidestLine notNil ifTrue:[ |
6304 | 786 |
self recomputeWidthOfWidestLineFor:aString old:nil. |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
787 |
]. |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
788 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
789 |
includesNonStrings ifFalse:[ |
6304 | 790 |
includesNonStrings := (aString notNil and:[(aString isSingleByteString) not]). |
851
b9d71ccdefaa
care for new fontParameters, if changing from a non-string-list
Claus Gittinger <cg@exept.de>
parents:
837
diff
changeset
|
791 |
"/ includesNonStrings ifTrue:[self getFontParameters]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
792 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
793 |
shown ifTrue:[ |
6304 | 794 |
lastShown := self lastLineShown. |
795 |
index <= 2 ifTrue:[ |
|
796 |
self invalidate |
|
797 |
] ifFalse:[ |
|
798 |
index to:lastShown do:[:eachLine | |
|
799 |
self invalidateLine:eachLine |
|
800 |
]. |
|
801 |
]. |
|
2182
fb9bc638123a
mus notify textChanged in #add: / #add:beforeIndex:
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
802 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
803 |
self enqueueDelayedContentsChangedNotification. "recompute scrollbars" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
804 |
|
2257
d095d1e0779e
care for scrollWhenUpdating when adding individual lines
src
parents:
2249
diff
changeset
|
805 |
(scrollWhenUpdating == #end or:[scrollWhenUpdating == #endOfText]) ifTrue:[ |
6304 | 806 |
"/ self selection isNil ifTrue:[ |
807 |
self scrollToBottom. |
|
808 |
"/ ] |
|
2257
d095d1e0779e
care for scrollWhenUpdating when adding individual lines
src
parents:
2249
diff
changeset
|
809 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
810 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
811 |
"Modified: / 25-07-2012 / 12:00:42 / cg" |
65 | 812 |
! |
813 |
||
2246 | 814 |
addAll:aCollectionOfLines beforeIndex:index |
2348 | 815 |
"add a bunch of lines and redisplay" |
816 |
||
817 |
|lastShown| |
|
2246 | 818 |
|
6304 | 819 |
list isNil ifTrue:[list := StringCollection new]. |
2246 | 820 |
aCollectionOfLines do:[:eachLine | |
6304 | 821 |
list addAll:aCollectionOfLines beforeIndex:index. |
2246 | 822 |
]. |
2348 | 823 |
includesNonStrings ifFalse:[ |
6304 | 824 |
includesNonStrings := |
825 |
aCollectionOfLines |
|
826 |
contains:[:someLine | |
|
827 |
someLine notNil and:[(someLine isSingleByteString) not]. |
|
828 |
] |
|
2348 | 829 |
]. |
2246 | 830 |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
831 |
widthOfWidestLine notNil ifTrue:[ |
6304 | 832 |
aCollectionOfLines do:[:eachLine | |
833 |
self recomputeWidthOfWidestLineFor:eachLine old:nil. |
|
834 |
]. |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
835 |
]. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
836 |
"/ widthOfWidestLine := nil. "/ i.e. unknown |
2246 | 837 |
self textChanged. |
838 |
||
2348 | 839 |
shown ifTrue:[ |
6304 | 840 |
lastShown := self lastLineShown. |
841 |
((index-1) <= lastShown) ifTrue:[ |
|
842 |
index <= 2 ifTrue:[ |
|
843 |
self invalidate |
|
844 |
] ifFalse:[ |
|
845 |
index-1 to:lastShown do:[:eachLine | |
|
846 |
self invalidateLine:eachLine |
|
847 |
]. |
|
848 |
"/ self redrawFromLine:index-1. |
|
849 |
]. |
|
850 |
]. |
|
2246 | 851 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
852 |
self enqueueDelayedContentsChangedNotification. "recompute scrollbars" |
2257
d095d1e0779e
care for scrollWhenUpdating when adding individual lines
src
parents:
2249
diff
changeset
|
853 |
|
d095d1e0779e
care for scrollWhenUpdating when adding individual lines
src
parents:
2249
diff
changeset
|
854 |
(scrollWhenUpdating == #end or:[scrollWhenUpdating == #endOfText]) ifTrue:[ |
6304 | 855 |
"/ self selection isNil ifTrue:[ |
856 |
self scrollToBottom. |
|
857 |
"/ ] |
|
2257
d095d1e0779e
care for scrollWhenUpdating when adding individual lines
src
parents:
2249
diff
changeset
|
858 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
859 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
860 |
"Modified: / 25-07-2012 / 12:00:54 / cg" |
2246 | 861 |
! |
862 |
||
105 | 863 |
at:lineNr |
6186 | 864 |
"retrieve a line's item; |
865 |
return nil if beyond end-of-text. |
|
866 |
this allows textViews to be used like collections in some places. |
|
867 |
Notice: for text lists, this returns strings (same as listAt:); |
|
868 |
for non-text lists, the item is returned." |
|
105 | 869 |
|
870 |
list isNil ifTrue:[^ nil]. |
|
6248 | 871 |
(lineNr between:1 and:list size) ifFalse:[^ nil]. |
105 | 872 |
^ list at:lineNr |
6186 | 873 |
|
874 |
"Modified (comment): / 18-07-2017 / 13:35:26 / cg" |
|
59 | 875 |
! |
876 |
||
105 | 877 |
at:index put:aString |
878 |
"change a line and redisplay" |
|
879 |
||
2577 | 880 |
|fontHeightBefore widthBefore| |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
881 |
|
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
882 |
fontHeightBefore := fontHeight. |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
883 |
widthBefore := widthOfWidestLine. |
105 | 884 |
self withoutRedrawAt:index put:aString. |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
885 |
|
105 | 886 |
shown ifTrue:[ |
6304 | 887 |
fontHeightBefore ~= fontHeight ifTrue:[ |
888 |
"/ must redraw everything |
|
889 |
self invalidate. |
|
890 |
^ self |
|
891 |
]. |
|
892 |
self redrawLine:index. |
|
2219
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
893 |
|
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
894 |
"/ the code below is wrong - we really have to redraw everything, if the |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
895 |
"/ fontHeight changes (due to a labelAndIcon in the list). |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
896 |
|
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
897 |
|
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
898 |
"/ "/ this could have changed the font height; |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
899 |
"/ "/ must clear all below last line, if it became smaller |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
900 |
"/ fontHeightBefore > fontHeight ifTrue:[ |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
901 |
"/ (self listLineIsVisible:(self size)) ifTrue:[ |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
902 |
"/ self clearRectangle:(margin @ (self yOfVisibleLine:nLinesShown+1)) |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
903 |
"/ corner:(width-margin) @ (height-margin). |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
904 |
"/ ]. |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
905 |
"/ self redrawFromLine:index |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
906 |
"/ ] ifFalse:[ |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
907 |
"/ self redrawLine:index |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
908 |
"/ ]. |
9ffca3757666
fixed redraw, when at:put: or add:
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
909 |
|
6304 | 910 |
"/ asynchronous: |
1194 | 911 |
"/ visibleLine := self listLineToVisibleLine:index. |
912 |
"/ visibleLine notNil ifTrue:[ |
|
913 |
"/ y := self yOfVisibleLine:visibleLine. |
|
914 |
"/ self invalidate:((margin @ y) extent:(width@fontHeight)) |
|
915 |
"/ ]. |
|
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
916 |
|
6304 | 917 |
widthBefore ~~ widthOfWidestLine ifTrue:[ |
918 |
self enqueueDelayedContentsChangedNotification |
|
919 |
] |
|
105 | 920 |
] |
1194 | 921 |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
922 |
"Modified: / 25-07-2012 / 12:01:46 / cg" |
105 | 923 |
! |
924 |
||
2427
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
925 |
characterAtCharacterPosition:charPos |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
926 |
"return the character at a 1-based character position. |
2427
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
927 |
Return a space character if nothing is there |
2707 | 928 |
(i.e. beyond the end of the line or below the last line)" |
2427
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
929 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
930 |
|line col| |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
931 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
932 |
line := self lineOfCharacterPosition:charPos. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
933 |
col := charPos - (self characterPositionOfLine:line col:1) + 1. |
2443 | 934 |
col == 0 ifTrue:[^ Character cr]. |
2427
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
935 |
^ self characterAtLine:line col:col |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
936 |
! |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
937 |
|
598
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
938 |
characterAtLine:lineNr col:colNr |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
939 |
"return the character at physical line/col. |
6155 | 940 |
The lineNr and colNr arguments start at 1, for the top-left character. |
598
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
941 |
Return a space character if nothing is there |
2707 | 942 |
(i.e. beyond the end of the line or below the last line)" |
598
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
943 |
|
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
944 |
|line| |
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
945 |
|
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
946 |
list notNil ifTrue:[ |
6155 | 947 |
line := self listAt:lineNr. |
948 |
line notNil ifTrue:[ |
|
949 |
(line size >= colNr) ifTrue:[ |
|
950 |
^ line at:colNr |
|
951 |
] |
|
952 |
] |
|
598
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
953 |
]. |
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
954 |
^ Character space |
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
955 |
|
6155 | 956 |
"Created: / 29-04-1996 / 12:11:00 / cg" |
957 |
"Modified (comment): / 11-05-2017 / 17:11:16 / stefan" |
|
598
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
958 |
! |
5d5194703de8
characterAtLine:col: moved to here
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
959 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
960 |
contents |
4610 | 961 |
"return the contents as a string, terminated by the line end character (sequence)" |
962 |
||
963 |
|stringCollection lineEnd| |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
964 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
965 |
list isNil ifTrue:[^ '']. |
4610 | 966 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
967 |
self lineEndCRLF ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
968 |
lineEnd := String crlf. |
4610 | 969 |
] ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
970 |
lineEnd := Character cr. |
3314 | 971 |
]. |
4610 | 972 |
|
973 |
stringCollection := list asStringCollection. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
974 |
^ stringCollection |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
975 |
asStringWith:lineEnd |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
976 |
from:1 to:stringCollection size |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
977 |
compressTabs:false |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
978 |
final:lineEnd |
3314 | 979 |
|
980 |
"Modified: / 04-07-2006 / 19:18:47 / fm" |
|
105 | 981 |
! |
982 |
||
983 |
contents:something |
|
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
984 |
"set the contents (either a String or a Collection of strings) |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
985 |
also scroll to top. See #setContents:, which does not scroll. |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
986 |
If the argument is a string, it is converted |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
987 |
to a collection of line-strings here." |
105 | 988 |
|
989 |
|l| |
|
990 |
||
991 |
l := something. |
|
992 |
l notNil ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
993 |
l isString ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
994 |
l := l asStringCollection |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
995 |
] |
105 | 996 |
]. |
997 |
self list:l |
|
652 | 998 |
|
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
999 |
"Modified: 5.6.1997 / 11:11:54 / cg" |
51 | 1000 |
! |
1001 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1002 |
from:from to:to do:aBlock |
652 | 1003 |
"evaluate aBlock on some of my lines" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1004 |
|
3256
0e978bc1d5fd
examples for big and huge lists added
Claus Gittinger <cg@exept.de>
parents:
3253
diff
changeset
|
1005 |
list from:from to:to do:aBlock. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1006 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1007 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1008 |
grow:n |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1009 |
"grow our list" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1010 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1011 |
^ list grow:n. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1012 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1013 |
|
2455 | 1014 |
lineAtY:y |
1015 |
"return the lineNr for a given y-(view-)coordinate" |
|
1016 |
||
1017 |
|visibleLine| |
|
1018 |
||
1019 |
visibleLine := self visibleLineOfY:y. |
|
1020 |
visibleLine isNil ifTrue:[^ nil]. |
|
1021 |
^ self visibleLineToListLine:visibleLine. |
|
1022 |
! |
|
1023 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1024 |
list |
652 | 1025 |
"return the contents as a collection of strings. |
5978 | 1026 |
This returns the view's internal list - modifying it may confuse |
652 | 1027 |
the listView." |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1028 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1029 |
^ list |
652 | 1030 |
|
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1031 |
"Modified: 5.6.1997 / 11:10:54 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1032 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1033 |
|
0 | 1034 |
list:aCollection |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1035 |
"set the contents (a collection of strings or list entries) |
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1036 |
and scroll as specified in scrollWhenUpdating (default:top-left). |
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1037 |
See also #setList:, which does not scroll. |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1038 |
Tabs are expanded (to spaces). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1039 |
The passed list is scanned for nonStrings |
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1040 |
(remembered to optimize later redraws)." |
128 | 1041 |
|
4751 | 1042 |
self list:aCollection expandTabs:expandTabsWhenUpdating |
652 | 1043 |
|
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1044 |
"Modified: 5.6.1997 / 11:10:45 / cg" |
128 | 1045 |
! |
1046 |
||
1047 |
list:aCollection expandTabs:expand |
|
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1048 |
"set the contents (a collection of strings) |
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1049 |
and scroll as specified in scrollWhenUpdating (default:top-left). |
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1050 |
If expand is true, tabs are expanded (to spaces). |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1051 |
The passed list is scanned for nonStrings (remembered to optimize |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1052 |
later redraws)." |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1053 |
|
4765 | 1054 |
self list:aCollection expandTabs:expand scanForNonStrings:true |
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1055 |
|
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1056 |
"Modified: 5.6.1997 / 11:09:44 / cg" |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1057 |
! |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1058 |
|
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1059 |
list:aCollection expandTabs:expand scanForNonStrings:scan |
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1060 |
"set the contents (a collection of strings) |
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1061 |
and scroll as specified in scrollWhenUpdating (default:top-left). |
1240
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1062 |
If expand is true, tabs are expanded (to spaces). |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1063 |
If scan is true, scan the passed list for nonStrings; otherwise, |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1064 |
assume that it does contain non-strings |
1b3611a8e972
added low-level entry to set the list without a non-string scan
Claus Gittinger <cg@exept.de>
parents:
1234
diff
changeset
|
1065 |
(remembered to optimize later redraws)." |
0 | 1066 |
|
1241 | 1067 |
self |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1068 |
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nil |
1241 | 1069 |
|
1070 |
"Modified: 5.6.1997 / 12:40:35 / cg" |
|
1071 |
! |
|
1072 |
||
4747 | 1073 |
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStringsIfNoScan |
1074 |
"set the contents (a collection of strings) |
|
1075 |
and scroll as specified in scrollWhenUpdating (default:top-left). |
|
1076 |
If expand is true, tabs are expanded (to spaces). |
|
1077 |
If scan is true, scan the passed list for nonStrings; |
|
1078 |
otherwise, take the information from the nonStrings arg. |
|
1079 |
(the nonStrings information is remembered to optimize later redraws & height computations)." |
|
1080 |
||
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1081 |
self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1082 |
list:aCollection |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1083 |
expandTabs:expand |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1084 |
scanForNonStrings:scan |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1085 |
includesNonStrings:nonStringsIfNoScan |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1086 |
redraw:true |
4747 | 1087 |
! |
1088 |
||
1089 |
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStringsIfNoScan redraw:doRedraw |
|
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1090 |
"set the contents (a collection of strings) |
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1091 |
and scroll as specified in scrollWhenUpdating (default:top-left). |
1241 | 1092 |
If expand is true, tabs are expanded (to spaces). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1093 |
If scan is true, scan the passed list for nonStrings; |
1241 | 1094 |
otherwise, take the information from the nonStrings arg. |
1095 |
(the nonStrings information is remembered to optimize later redraws & height computations)." |
|
1096 |
||
2199
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1097 |
|oldFirst oldLeft nonStringsBefore fontHeightBefore |
3821 | 1098 |
scrollToEnd scrollToTop newLeftOffset wText same firstLine| |
2891 | 1099 |
|
4747 | 1100 |
"/ cg: what is the point in comparing here? |
1101 |
"/ I think, if there is something to optimize, |
|
1102 |
"/ the caller should do so (moved to getListFromModel). |
|
1103 |
"/ notice, that it may be very expensive to ask aCollection for each line |
|
1104 |
"/ for example, iff the lines are generated on the fly by an algorithm |
|
1105 |
false ifTrue:[ |
|
6304 | 1106 |
"/ see if there is a change at all. |
1107 |
"/ use to compare using =, but that's not enough in case of emphasis change. |
|
1108 |
aCollection size == list size ifTrue:[ |
|
1109 |
same := true. |
|
1110 |
aCollection size > 0 ifTrue:[ |
|
1111 |
aCollection with:list do:[:eachNewLine :eachOldLine | |
|
1112 |
(eachNewLine == eachOldLine) |
|
1113 |
ifFalse:[ |
|
1114 |
same := false. |
|
1115 |
] |
|
1116 |
] |
|
1117 |
]. |
|
1118 |
same ifTrue:[^ self]. |
|
1119 |
]. |
|
2891 | 1120 |
]. |
2199
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1121 |
|
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1122 |
scrollToTop := scrollWhenUpdating == #begin or:[scrollWhenUpdating == #beginOfText]. |
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1123 |
scrollToEnd := scrollWhenUpdating == #end or:[scrollWhenUpdating == #endOfText]. |
0 | 1124 |
|
4747 | 1125 |
(aCollection isEmptyOrNil and:[list isEmptyOrNil]) ifTrue:[ |
6304 | 1126 |
"no contents change" |
1127 |
list := aCollection. |
|
1128 |
scrollLocked ifFalse:[ |
|
1129 |
scrollToTop ifTrue:[ |
|
1130 |
self scrollToTop. |
|
1131 |
] ifFalse:[ |
|
1132 |
scrollToEnd ifTrue:[ |
|
1133 |
self scrollToBottom. |
|
1134 |
] |
|
1135 |
]. |
|
1136 |
self scrollToLeft. |
|
1137 |
]. |
|
1138 |
^ self |
|
0 | 1139 |
]. |
3314 | 1140 |
|
4747 | 1141 |
checkLineEndConventionWhenUpdating ifTrue:[ |
6304 | 1142 |
"Check if the we use DOS/Windows line end convention with CR LF. |
1143 |
The LF has already been consumed by the conversion to a StringCollection, |
|
1144 |
now check for and remove the trailing left over CRs" |
|
1145 |
||
1146 |
lineEndCRLF := (aCollection size > 0 |
|
1147 |
and:[(firstLine := aCollection at:1) isString |
|
1148 |
and:[firstLine notEmpty |
|
1149 |
and:[firstLine string endsWith:Character return]]]). |
|
4747 | 1150 |
]. |
3314 | 1151 |
lineEndCRLF ifTrue:[ |
6304 | 1152 |
list := aCollection |
1153 |
collect:[:eachLineWithCROrNil | |
|
1154 |
eachLineWithCROrNil isNil |
|
1155 |
ifTrue:nil |
|
1156 |
ifFalse:[(eachLineWithCROrNil endsWith:Character return) |
|
1157 |
ifTrue:[eachLineWithCROrNil copyButLast:1] |
|
1158 |
ifFalse:[eachLineWithCROrNil]]]. |
|
3314 | 1159 |
] ifFalse:[ |
6304 | 1160 |
list := aCollection. |
3314 | 1161 |
]. |
0 | 1162 |
|
864 | 1163 |
nonStringsBefore := includesNonStrings. |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1164 |
fontHeightBefore := fontHeight. |
864 | 1165 |
includesNonStrings := false. |
1166 |
||
152 | 1167 |
list notNil ifTrue:[ |
6304 | 1168 |
expand ifTrue:[ |
1169 |
self expandTabs |
|
1170 |
] ifFalse:[ |
|
1171 |
scan ifTrue:[ |
|
1172 |
includesNonStrings := list contains:[:e | e isString not]. |
|
1173 |
] ifFalse:[ |
|
1174 |
includesNonStrings := nonStringsIfNoScan ? nonStringsBefore |
|
1175 |
] |
|
1176 |
]. |
|
0 | 1177 |
]. |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1178 |
(includesNonStrings ~~ nonStringsBefore) ifTrue:[ |
6304 | 1179 |
self getFontParameters. |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1180 |
]. |
152 | 1181 |
|
125 | 1182 |
widthOfWidestLine := nil. "/ i.e. unknown |
0 | 1183 |
oldFirst := firstLineShown. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
1184 |
oldLeft := viewOrigin x. |
2128
33830e4f998f
added control over how-to-scroll when updating text.
Claus Gittinger <cg@exept.de>
parents:
2090
diff
changeset
|
1185 |
|
2199
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1186 |
(includesNonStrings ~~ nonStringsBefore) ifTrue:[ |
6304 | 1187 |
self computeNumberOfLinesShown. |
2199
455cd1c65af1
auto-scroll (when fetching list from model) to bottom fixed
Claus Gittinger <cg@exept.de>
parents:
2188
diff
changeset
|
1188 |
]. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
1189 |
|
4747 | 1190 |
scrollLocked ifFalse:[ |
6304 | 1191 |
newLeftOffset := viewOrigin x. |
1192 |
scrollToTop ifTrue:[ |
|
1193 |
firstLineShown := 1. |
|
1194 |
newLeftOffset := 0. |
|
1195 |
] ifFalse:[ |
|
1196 |
scrollToEnd ifTrue:[ |
|
1197 |
firstLineShown := (list size - nFullLinesShown + 1) max:1. |
|
1198 |
newLeftOffset := 0. |
|
1199 |
] |
|
1200 |
]. |
|
1201 |
newLeftOffset > 0 ifTrue:[ |
|
1202 |
wText := self widthOfContents. |
|
1203 |
(viewOrigin x + self innerWidth) > wText ifTrue:[ |
|
1204 |
newLeftOffset := (wText - self innerWidth) max:0. |
|
1205 |
]. |
|
1206 |
]. |
|
1207 |
newLeftOffset ~= oldLeft ifTrue:[ |
|
1208 |
viewOrigin := newLeftOffset @ viewOrigin y. |
|
1209 |
]. |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
1210 |
]. |
837 | 1211 |
|
38 | 1212 |
realized ifTrue:[ |
6304 | 1213 |
self contentsChanged. |
1214 |
scrollLocked ifFalse:[ |
|
1215 |
" |
|
1216 |
don't use scroll here to avoid double redraw |
|
1217 |
" |
|
1218 |
viewOrigin := viewOrigin isNil ifTrue:[0@0] ifFalse:[(viewOrigin x) @ 0]. |
|
1219 |
gc transformation:nil. |
|
1220 |
||
1221 |
oldFirst ~~ firstLineShown ifTrue:[ |
|
1222 |
self originChanged:0 @ ((oldFirst - 1) * fontHeight negated). |
|
1223 |
]. |
|
1224 |
]. |
|
1225 |
doRedraw ifTrue:[ |
|
1226 |
shown ifTrue:[ |
|
1227 |
self invalidate. |
|
1228 |
] |
|
1229 |
] |
|
0 | 1230 |
] |
153 | 1231 |
|
3314 | 1232 |
"Modified: / 30-08-1995 / 19:07:13 / claus" |
1233 |
"Created: / 05-06-1997 / 12:40:06 / cg" |
|
1234 |
"Modified: / 04-07-2006 / 19:12:39 / fm" |
|
3339 | 1235 |
"Modified: / 22-08-2006 / 11:59:56 / cg" |
0 | 1236 |
! |
1237 |
||
2812 | 1238 |
listAt:lineNr |
1239 |
"given a lineNumber, return the corresponding string |
|
1240 |
This is used for accessing; i.e. for non-string entries, this |
|
6186 | 1241 |
returns the corresponding string. |
1242 |
Use #at: to get to the real item (if it is not a string)" |
|
2812 | 1243 |
|
1244 |
|l| |
|
1245 |
||
1246 |
l := self at:lineNr. |
|
1247 |
l isNil ifTrue:[^ l]. |
|
1248 |
^ self visibleStringFrom:l "/ l asString |
|
1249 |
||
6186 | 1250 |
"Modified: / 07-09-1995 / 15:54:59 / claus" |
1251 |
"Modified: / 18-07-2017 / 13:35:54 / cg" |
|
2812 | 1252 |
! |
1253 |
||
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1254 |
removeFromIndex:startLineNr toIndex:endLineNr |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1255 |
"delete some lines" |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1256 |
|
3442
418b14cb6a78
do not always flush widthOfWidestLine info.
Claus Gittinger <cg@exept.de>
parents:
3437
diff
changeset
|
1257 |
|nLines widestLineRemoved| |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1258 |
|
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1259 |
list isNil ifTrue:[^ self]. |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1260 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1261 |
widestLineRemoved := self widthOfWidestLineBetween:startLineNr and:endLineNr. |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1262 |
list removeFromIndex:startLineNr toIndex:(endLineNr min:list size). |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1263 |
|
3442
418b14cb6a78
do not always flush widthOfWidestLine info.
Claus Gittinger <cg@exept.de>
parents:
3437
diff
changeset
|
1264 |
widthOfWidestLine == widestLineRemoved ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1265 |
widthOfWidestLine := nil. "/ i.e. unknown |
3442
418b14cb6a78
do not always flush widthOfWidestLine info.
Claus Gittinger <cg@exept.de>
parents:
3437
diff
changeset
|
1266 |
]. |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1267 |
self textChanged. |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1268 |
|
2237
43f0318a830e
scroll pixel bug; removeFromIndex:toIndex: redraw bug.
Claus Gittinger <cg@exept.de>
parents:
2233
diff
changeset
|
1269 |
((startLineNr <= self lastLineShown) |
43f0318a830e
scroll pixel bug; removeFromIndex:toIndex: redraw bug.
Claus Gittinger <cg@exept.de>
parents:
2233
diff
changeset
|
1270 |
and:[endLineNr >= firstLineShown]) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1271 |
startLineNr to:self lastLineShown do:[:eachLine | |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1272 |
self invalidateLine:eachLine |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1273 |
]. |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1274 |
]. |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1275 |
|
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1276 |
nLines := list size. |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1277 |
(firstLineShown >= nLines) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1278 |
self makeLineVisible:nLines |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1279 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1280 |
self enqueueDelayedContentsChangedNotification. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1281 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1282 |
"Modified: / 25-07-2012 / 12:01:59 / cg" |
2233
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1283 |
! |
ea4d220ac381
added #removeFromIndex:toIndex:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
1284 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1285 |
removeIndex:lineNr |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
1286 |
"delete a line, redraw the view" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1287 |
|
1453 | 1288 |
|visLine w h x |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1289 |
srcY "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1290 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1291 |
(self removeIndexWithoutRedraw:lineNr) ifFalse:[^ self]. |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
1292 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1293 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1294 |
is there a need to redraw ? |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1295 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1296 |
shown ifFalse:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1297 |
visLine := self listLineToVisibleLine:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1298 |
visLine notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1299 |
w := self widthForScrollBetween:lineNr and:(firstLineShown + nLinesShown). |
1433 | 1300 |
"/ x := textStartLeft. |
1301 |
"/ CLAUS fixes leftOver selection pixels |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1302 |
w := w + leftMargin. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1303 |
x := margin. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1304 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1305 |
srcY := topMargin + (visLine * fontHeight). |
1453 | 1306 |
"/ h := ((nLinesShown - visLine) * fontHeight). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1307 |
h := (height - margin - srcY). |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1308 |
h > 0 ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1309 |
self catchExpose. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1310 |
self |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1311 |
copyFrom:self |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1312 |
x:x y:srcY |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1313 |
toX:x y:(srcY - fontHeight) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1314 |
width:w height:h |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1315 |
async:true. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1316 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1317 |
self redrawVisibleLine:nFullLinesShown. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1318 |
" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1319 |
redraw last partial line - if any |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1320 |
" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1321 |
(nFullLinesShown ~~ nLinesShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1322 |
self redrawVisibleLine:nLinesShown |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1323 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1324 |
h > 0 ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1325 |
self waitForExpose |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1326 |
]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1327 |
] |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
1328 |
|
1460
b9929a029249
dont bitBlt if height is <= 0
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
1329 |
"Modified: / 27.2.1998 / 12:36:59 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1330 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1331 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1332 |
removeIndexWithoutRedraw:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1333 |
"delete a line, given its lineNr - no redraw; |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1334 |
return true, if something was really deleted (so sender knows, |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1335 |
if a redraw is needed)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1336 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1337 |
(list isNil or:[lineNr > self size]) ifTrue:[^ false]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1338 |
list removeIndex:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1339 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1340 |
lineNr < firstLineShown ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1341 |
firstLineShown := firstLineShown - 1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1342 |
]. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1343 |
self enqueueDelayedContentsChangedNotification. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1344 |
^ true |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1345 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1346 |
"Modified: / 25-07-2012 / 12:02:09 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1347 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1348 |
|
2248
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1349 |
replaceFrom:startLineNr to:endLineNr with:aCollection startingAt:replStartIndex |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1350 |
"replace some lines" |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1351 |
|
6304 | 1352 |
list isNil ifTrue:[ list := StringCollection new:endLineNr ]. |
2248
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1353 |
list replaceFrom:startLineNr to:endLineNr with:aCollection startingAt:replStartIndex. |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1354 |
|
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1355 |
widthOfWidestLine := nil. "/ i.e. unknown |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1356 |
self textChanged. |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1357 |
|
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1358 |
((startLineNr <= self lastLineShown) |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1359 |
and:[endLineNr >= firstLineShown]) ifTrue:[ |
6304 | 1360 |
self invalidate. |
2248
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1361 |
]. |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1362 |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1363 |
self enqueueDelayedContentsChangedNotification. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1364 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1365 |
"Modified: / 25-07-2012 / 12:02:15 / cg" |
2248
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1366 |
! |
c6cb654bb807
added #replaceFrom:to:with:startingAt:
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1367 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1368 |
setContents:something |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1369 |
"set the contents (either a string or a Collection of strings) |
5947 | 1370 |
don't change position (i.e. do not scroll). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1371 |
This can be used to update a self-changing list |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1372 |
(for example: a file list being shown, without disturbing user too much). |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1373 |
Compare with #contents:, which scrolls to top." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1374 |
|
2891 | 1375 |
|l| |
1376 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1377 |
l := something. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1378 |
l notNil ifTrue:[ |
5947 | 1379 |
l isString ifTrue:[ |
1380 |
l := l asStringCollection |
|
1381 |
] |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1382 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1383 |
self setList:l. |
267
cc8e122f7dbe
Reset cache widthOfLongestLine in setList:, also reposition if contents fits
Stefan Vogel <sv@exept.de>
parents:
249
diff
changeset
|
1384 |
|
cc8e122f7dbe
Reset cache widthOfLongestLine in setList:, also reposition if contents fits
Stefan Vogel <sv@exept.de>
parents:
249
diff
changeset
|
1385 |
"Modified: 18.12.1995 / 22:20:43 / stefan" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1386 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1387 |
|
105 | 1388 |
setList:aCollection |
1389 |
"set the contents (a collection of strings); |
|
153 | 1390 |
do not change position (i.e. do not scroll). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1391 |
This can be used to update a self-changing list |
105 | 1392 |
(for example: a file list being shown, without disturbing user too much)" |
1393 |
||
1394 |
^ self setList:aCollection expandTabs:true |
|
0 | 1395 |
! |
1396 |
||
153 | 1397 |
setList:aCollection expandTabs:expandTabs |
1398 |
"set the contents (a collection of strings); |
|
1399 |
do not change position (i.e. do not scroll). |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1400 |
This can be used to update a self-changing list |
153 | 1401 |
(for example: a file list being shown, without disturbing the user too much)" |
1402 |
||
1497
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1403 |
self setList:aCollection expandTabs:expandTabs redraw:true |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1404 |
|
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1405 |
"Modified: / 22.4.1998 / 11:12:24 / cg" |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1406 |
! |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1407 |
|
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1408 |
setList:aCollection expandTabs:expandTabs redraw:doRedraw |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1409 |
"set the contents (a collection of strings); |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1410 |
do not change position (i.e. do not scroll). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1411 |
This can be used to update a self-changing list |
1497
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1412 |
(for example: a file list being shown, without disturbing the user too much)" |
5b55a84e2258
added entry to set the list without redrawing
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
1413 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1414 |
self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1415 |
setList:aCollection expandTabs:expandTabs scanForNonStrings:true includesNonStrings:nil |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1416 |
redraw:doRedraw |
4747 | 1417 |
! |
1418 |
||
1419 |
setList:aCollection expandTabs:expandTabs scanForNonStrings:scan includesNonStrings:nonStringsIfNoScan redraw:doRedraw |
|
1420 |
"set the contents (a collection of strings); |
|
1421 |
do not change position (i.e. do not scroll). |
|
1422 |
This can be used to update a self-changing list |
|
1423 |
(for example: a file list being shown, without disturbing the user too much). |
|
1424 |
TODO: this stinks: most of the code is the same as in #list:expandTabs:... |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1425 |
needs a refactoring" |
4747 | 1426 |
|
1427 |
|prev| |
|
1428 |
||
1429 |
prev := scrollLocked. |
|
1430 |
[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1431 |
scrollLocked := false. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1432 |
self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1433 |
list:aCollection |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1434 |
expandTabs:expandTabs |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1435 |
scanForNonStrings:scan |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1436 |
includesNonStrings:nonStringsIfNoScan |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1437 |
redraw:doRedraw |
4747 | 1438 |
] ensure:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1439 |
scrollLocked := prev |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1440 |
]. |
4747 | 1441 |
"/ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1442 |
"/ |
4747 | 1443 |
"/"/ scrollLocked ifTrue:[ |
1444 |
"/"/ self setList:newText expandTabs:expandTabsWhenUpdating |
|
1445 |
"/"/ ] ifFalse:[ |
|
1446 |
"/ self list:newText expandTabs:expandTabsWhenUpdating scanForNonStrings:expandTabsWhenUpdating |
|
1447 |
"/"/ ] |
|
1448 |
"/ |
|
1449 |
"/ |oldFirst nonStringsBefore| |
|
1450 |
"/ |
|
1451 |
"/ (aCollection isNil and:[list isNil]) ifTrue:[ |
|
1452 |
"/ "no change" |
|
1453 |
"/ ^ self |
|
1454 |
"/ ]. |
|
1455 |
"/ |
|
1456 |
"/ list := aCollection. |
|
1457 |
"/ |
|
1458 |
"/ nonStringsBefore := includesNonStrings. |
|
1459 |
"/ includesNonStrings := false. |
|
1460 |
"/ |
|
1461 |
"/ list notNil ifTrue:[ |
|
1462 |
"/ expandTabs ifTrue:[ |
|
1463 |
"/ self expandTabs |
|
1464 |
"/ ] ifFalse:[ |
|
1465 |
"/ scan ifTrue:[ |
|
1466 |
"/ includesNonStrings := (list findFirst:[:e | e isString not]) ~~ 0. |
|
1467 |
"/ ] ifFalse:[ |
|
1468 |
"/ includesNonStrings := nonStringsIfNoScan ? nonStringsBefore |
|
1469 |
"/ ] |
|
1470 |
"/ ]. |
|
1471 |
"/ ]. |
|
1472 |
"/ (includesNonStrings ~~ nonStringsBefore) ifTrue:[ |
|
1473 |
"/ self getFontParameters. |
|
1474 |
"/ self computeNumberOfLinesShown. |
|
1475 |
"/ ]. |
|
1476 |
"/ |
|
1477 |
"/ "/ new: reposition horizontally if too big |
|
1478 |
"/ widthOfWidestLine := nil. "/ i.e. unknown |
|
1479 |
"/ innerWidth >= self widthOfContents ifTrue:[ |
|
1480 |
"/ viewOrigin := 0 @ viewOrigin y. |
|
1481 |
"/ ]. |
|
1482 |
"/ self contentsChanged. |
|
1483 |
"/ |
|
1484 |
"/ "/ new: reposition vertically if too big |
|
1485 |
"/ (firstLineShown + nFullLinesShown) > self size ifTrue:[ |
|
1486 |
"/ oldFirst := firstLineShown. |
|
1487 |
"/ firstLineShown := self size - nFullLinesShown + 1. |
|
1488 |
"/ firstLineShown < 1 ifTrue:[firstLineShown := 1]. |
|
1489 |
"/ oldFirst ~= firstLineShown ifTrue:[ |
|
1490 |
"/ viewOrigin y:((firstLineShown - 1) * fontHeight). |
|
1491 |
"/ self originChanged:0 @ ((oldFirst - 1) negated * fontHeight). |
|
1492 |
"/ shown ifTrue:[ |
|
1493 |
"/ self clearView. |
|
1494 |
"/ ] |
|
1495 |
"/ ] |
|
1496 |
"/ ]. |
|
1497 |
"/ |
|
1498 |
"/ (shown and:[doRedraw]) ifTrue:[ |
|
1499 |
"/ self invalidate |
|
1500 |
"/ "/ self redrawFromVisibleLine:1 to:nLinesShown |
|
1501 |
"/ ] |
|
1502 |
"/ |
|
1503 |
"/ "Modified: / 18.12.1995 / 23:27:54 / stefan" |
|
1504 |
"/ "Created: / 22.4.1998 / 11:11:51 / cg" |
|
1505 |
"/ "Modified: / 26.7.1998 / 13:46:49 / cg" |
|
153 | 1506 |
! |
1507 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1508 |
size |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1509 |
"return the size (i.e. number of lines) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1510 |
this allows textViews to be used like collections in some places." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1511 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1512 |
^ list size. |
0 | 1513 |
! |
1514 |
||
919 | 1515 |
stringAtLine:lineNr from:col1 to:col2 |
1516 |
"return the substring starting at physical line/col1, up-to and |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1517 |
including col2. |
919 | 1518 |
The lineNr and colNr arguments start at 1, for the top-left character. |
1519 |
Fills the string with space characters at the right. |
|
2707 | 1520 |
(i.e. beyond the end of the line or below the last line)" |
919 | 1521 |
|
1522 |
|line len s| |
|
1523 |
||
1524 |
len := col2 - col1 + 1. |
|
1525 |
list notNil ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1526 |
line := self listAt:lineNr. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1527 |
line notNil ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1528 |
(line size >= col1) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1529 |
s := line copyFrom:col1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1530 |
s size < len ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1531 |
^ s paddedTo:len |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1532 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1533 |
^ s copyTo:len |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1534 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1535 |
] |
919 | 1536 |
]. |
1537 |
^ String new:len withAll:Character space |
|
1538 |
||
1539 |
"Created: 7.1.1997 / 19:58:43 / cg" |
|
1540 |
! |
|
1541 |
||
2427
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1542 |
textFromCharacterPosition:charPos1 to:charPos2 |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1543 |
"return some text as a collection of (line-)strings." |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1544 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1545 |
|line1 col1 line2 col2| |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1546 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1547 |
line1 := self lineOfCharacterPosition:charPos1. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1548 |
col1 := charPos1 - (self characterPositionOfLine:line1 col:1) + 1. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1549 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1550 |
line2 := self lineOfCharacterPosition:charPos2. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1551 |
col2 := charPos2 - (self characterPositionOfLine:line2 col:1) + 1. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1552 |
|
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1553 |
^ self textFromLine:line1 col:col1 toLine:line2 col:col2. |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1554 |
! |
43cc7ea39bac
more editing stuff (xxx-characterPosition)
Claus Gittinger <cg@exept.de>
parents:
2423
diff
changeset
|
1555 |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1556 |
textFromLine:startLine col:startCol toLine:endLine col:endCol |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1557 |
"return some text as a collection of (line-)strings." |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1558 |
|
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1559 |
|text sz index last| |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1560 |
|
4422
9954fb1dc0a4
changed: #textFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
4403
diff
changeset
|
1561 |
startLine isNil ifTrue:[^ nil]. |
9954fb1dc0a4
changed: #textFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
4403
diff
changeset
|
1562 |
endLine isNil ifTrue:[^ nil]. |
9954fb1dc0a4
changed: #textFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
4403
diff
changeset
|
1563 |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1564 |
(startLine == endLine) ifTrue:[ |
6019 | 1565 |
"part of a line" |
1566 |
^ StringCollection with:(self listAt:startLine from:startCol to:endCol) |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1567 |
]. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1568 |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1569 |
sz := endLine - startLine + 1. |
6019 | 1570 |
sz < 1 ifTrue:[^ StringCollection new]. |
2687 | 1571 |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1572 |
text := StringCollection new:sz. |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1573 |
|
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1574 |
"get 1st and last (possibly) partial lines" |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1575 |
text at:1 put:(self listAt:startLine from:startCol). |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1576 |
endCol == 0 ifTrue:[ |
6019 | 1577 |
last := '' |
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1578 |
] ifFalse:[ |
6019 | 1579 |
last := self listAt:endLine to:endCol. |
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1580 |
]. |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1581 |
text at:sz put:last. |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1582 |
|
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1583 |
"get bulk of text" |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1584 |
index := 2. |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1585 |
(startLine + 1) to:(endLine - 1) do:[:lineNr | |
6019 | 1586 |
text at:index put:(self listAt:lineNr). |
1587 |
index := index + 1 |
|
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1588 |
]. |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1589 |
^ text |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1590 |
|
4422
9954fb1dc0a4
changed: #textFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
4403
diff
changeset
|
1591 |
"Created: / 22-02-2000 / 23:53:06 / cg" |
2158
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1592 |
! |
1fbe3297506f
generalized text-access fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2133
diff
changeset
|
1593 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1594 |
withoutRedrawAt:index put:aString |
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1595 |
"change a line without redisplay and WITHOUT any sizeChange notifications. |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1596 |
Somewhat dangerous, since scrollBars will not be informed about contents-changes. |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1597 |
Use only if multiple lines are to be changed, and a sizeChanged is invoked by some other |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1598 |
means at the end." |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1599 |
|
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
1600 |
|didIncludeNonStrings oldLine| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1601 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1602 |
self checkForExistingLine:index. |
2180
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1603 |
|
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1604 |
oldLine := self listAt:index. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1605 |
list at:index put:aString. |
2180
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1606 |
oldLine ~= aString ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1607 |
self textChanged |
2180
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1608 |
]. |
d208b77444a7
must set modified flag in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1609 |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1610 |
didIncludeNonStrings := includesNonStrings. |
105 | 1611 |
includesNonStrings ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1612 |
includesNonStrings := (aString notNil and:[(aString isSingleByteString) not]). |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1613 |
] ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1614 |
(aString isNil or:[(aString isSingleByteString)]) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1615 |
includesNonStrings := list contains:[:l | l notNil and:[(l isSingleByteString) not]]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1616 |
] |
105 | 1617 |
]. |
851
b9d71ccdefaa
care for new fontParameters, if changing from a non-string-list
Claus Gittinger <cg@exept.de>
parents:
837
diff
changeset
|
1618 |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1619 |
includesNonStrings ~~ didIncludeNonStrings ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1620 |
self getFontParameters. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1621 |
self computeNumberOfLinesShown |
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1622 |
]. |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1623 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1624 |
widthOfWidestLine notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1625 |
self recomputeWidthOfWidestLineFor:aString old:oldLine. |
1963
aa5d0f63db19
notify about contentsChange in #withoutRedrawAt:put:
Claus Gittinger <cg@exept.de>
parents:
1938
diff
changeset
|
1626 |
]. |
634
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1627 |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
1628 |
"Modified: / 26.7.1998 / 13:00:14 / cg" |
105 | 1629 |
! ! |
1630 |
||
2455 | 1631 |
!ListView methodsFor:'accessing-look'! |
1632 |
||
1633 |
backgroundColor |
|
1634 |
"return the background color" |
|
1635 |
||
1636 |
^ bgColor |
|
1637 |
! |
|
1638 |
||
1639 |
backgroundColor:aColor |
|
1640 |
"set the background color of the contents" |
|
1641 |
||
1642 |
bgColor ~~ aColor ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1643 |
bgColor := aColor. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1644 |
self viewBackground:bgColor. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1645 |
self invalidate "/ clear; redraw |
2455 | 1646 |
] |
1647 |
||
1648 |
"Modified: 3.5.1997 / 10:27:40 / cg" |
|
1649 |
! |
|
1650 |
||
1651 |
font:aFont |
|
1652 |
"set the font for all shown text. |
|
1653 |
Redraws everything. |
|
1654 |
CAVEAT: with the addition of Text objects, |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1655 |
this method is going to be obsoleted by a textStyle |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1656 |
method, which allows specific control over |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1657 |
normalFont/boldFont/italicFont parameters." |
2455 | 1658 |
|
1659 |
aFont isNil ifTrue:[ |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1660 |
^ self error:'nil font' mayProceed:true |
2455 | 1661 |
]. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1662 |
gc font ~~ aFont ifTrue:[ |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1663 |
preferredExtent := nil. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1664 |
widthOfWidestLine := nil. "/ i.e. unknown |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1665 |
super font:aFont. |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1666 |
self getFontParameters. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1667 |
realized ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1668 |
(gc font graphicsDevice == device) ifTrue:[ |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1669 |
self computeNumberOfLinesShown. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1670 |
shown ifTrue:[ |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1671 |
self redrawFromVisibleLine:1 to:nLinesShown |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1672 |
] |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1673 |
]. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1674 |
self enqueueDelayedContentsChangedNotification |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1675 |
] |
2455 | 1676 |
] |
1677 |
||
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
1678 |
"Modified: / 25-07-2012 / 12:01:36 / cg" |
2455 | 1679 |
! |
1680 |
||
1681 |
fontHeight:pixels |
|
4830 | 1682 |
"set the lines height - that's the number of pixels, |
2455 | 1683 |
by which lines are vertically separated." |
1684 |
||
1685 |
fontHeight ~~ pixels ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1686 |
fontHeight := pixels. |
2455 | 1687 |
] |
1688 |
||
1689 |
"Created: 17.4.1997 / 01:41:33 / cg" |
|
1690 |
! |
|
1691 |
||
1692 |
foregroundColor |
|
1693 |
"return the foreground color" |
|
1694 |
||
1695 |
^ fgColor |
|
1696 |
! |
|
1697 |
||
1698 |
foregroundColor:aColor |
|
1699 |
"set the foreground color" |
|
1700 |
||
1701 |
fgColor ~~ aColor ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1702 |
fgColor := aColor. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1703 |
self invalidate |
2455 | 1704 |
] |
1705 |
||
1706 |
"Modified: 29.5.1996 / 16:19:02 / cg" |
|
1707 |
! |
|
1708 |
||
1709 |
foregroundColor:color1 backgroundColor:color2 |
|
1710 |
"set both foreground and background colors" |
|
1711 |
||
1712 |
((fgColor ~~ color1) or:[bgColor ~~ color2]) ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1713 |
fgColor := color1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1714 |
bgColor := color2. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1715 |
self invalidate |
2455 | 1716 |
] |
1717 |
||
1718 |
"Modified: 29.5.1996 / 16:19:05 / cg" |
|
1719 |
! |
|
1720 |
||
1721 |
innerHorizontalMargin |
|
1722 |
"return the margin between the left border and the 1st col" |
|
1723 |
||
1724 |
^ leftMargin |
|
1725 |
||
1726 |
"Created: 16.1.1996 / 19:28:23 / cg" |
|
1727 |
! |
|
1728 |
||
1729 |
innerVerticalMargin |
|
1730 |
"return the margin between the top border and the 1st line" |
|
1731 |
||
1732 |
^ topMargin |
|
1733 |
||
1734 |
"Created: 16.1.1996 / 19:28:00 / cg" |
|
1735 |
! |
|
1736 |
||
1737 |
leftMargin |
|
1738 |
"return the margin to left of 1st col" |
|
1739 |
||
1740 |
^ leftMargin |
|
1741 |
! |
|
1742 |
||
1743 |
leftMargin:aNumber |
|
1744 |
"set the margin between the left border and the 1st col" |
|
1745 |
||
1746 |
leftMargin := aNumber. |
|
1747 |
textStartLeft := aNumber + margin. |
|
1748 |
innerWidth := width - aNumber - margin |
|
1749 |
||
1750 |
"Modified: 28.2.1996 / 19:32:55 / cg" |
|
1751 |
! |
|
1752 |
||
1753 |
level:aNumber |
|
1754 |
"set the 3D level - caught here to update text-position variables |
|
1755 |
(which avoids many computations later)" |
|
1756 |
||
1757 |
|newMargin| |
|
1758 |
||
1759 |
aNumber ~~ level ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1760 |
newMargin := aNumber abs. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1761 |
textStartLeft := leftMargin + newMargin. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1762 |
textStartTop := topMargin + newMargin. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1763 |
innerWidth := width - textStartLeft - newMargin. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1764 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1765 |
super level:aNumber. |
2455 | 1766 |
] |
1767 |
||
1768 |
"Modified: 11.8.1997 / 02:59:15 / cg" |
|
1769 |
! |
|
1770 |
||
4668 | 1771 |
lineSpacing |
1772 |
"get the lineSpacing - that's an additional number of pixels, |
|
1773 |
by which lines are vertically separated." |
|
1774 |
||
1775 |
^ lineSpacing |
|
1776 |
! |
|
1777 |
||
2455 | 1778 |
lineSpacing:pixels |
4668 | 1779 |
"set the lineSpacing - that's an additional number of pixels, |
2455 | 1780 |
by which lines are vertically separated." |
1781 |
||
1782 |
lineSpacing ~~ pixels ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1783 |
lineSpacing := pixels. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1784 |
self getFontParameters. |
2455 | 1785 |
] |
1786 |
||
1787 |
"Modified: 22.5.1996 / 12:22:29 / cg" |
|
1788 |
! |
|
1789 |
||
1790 |
partialLines:aBoolean |
|
1791 |
"allow/disallow display of a last partial line" |
|
1792 |
||
1793 |
partialLines := aBoolean. |
|
1794 |
self computeNumberOfLinesShown |
|
1795 |
! |
|
1796 |
||
1797 |
topMargin:aNumber |
|
1798 |
"set the margin between the top border and the 1st line" |
|
1799 |
||
1800 |
topMargin := aNumber. |
|
1801 |
textStartTop := topMargin + margin. |
|
1802 |
! |
|
1803 |
||
1804 |
viewBackground:aColor |
|
1805 |
super viewBackground:aColor. |
|
1806 |
self isTextView ifFalse:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1807 |
self backgroundColor:aColor |
2455 | 1808 |
]. |
1809 |
! ! |
|
1810 |
||
118 | 1811 |
!ListView methodsFor:'accessing-mvc'! |
1812 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1813 |
addModelInterfaceTo:aDictionary |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1814 |
"see comment in View>>modelInterface" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1815 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1816 |
super addModelInterfaceTo:aDictionary. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1817 |
aDictionary at:#listMessage put:listMsg |
118 | 1818 |
! |
1819 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1820 |
listMessage |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1821 |
"return the listMsg selector; |
5780 | 1822 |
if non-nil, this is the message sent to the model (if any) to acquire |
125 | 1823 |
a new text upon change of the aspect. |
120 | 1824 |
This defaults to the aspect-selector." |
118 | 1825 |
|
125 | 1826 |
^ listMsg |
1827 |
! |
|
1828 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1829 |
listMessage:aSymbol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1830 |
"ST-80 compatibility: set the listMsg selector; |
5780 | 1831 |
if non-nil, this will be sent to the model (if any) to acquire a |
125 | 1832 |
new text upon change of the aspect. |
1833 |
This defaults to the aspect-selector." |
|
1834 |
||
1835 |
listMsg := aSymbol. |
|
120 | 1836 |
! |
1837 |
||
907
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1838 |
model:aModel |
5029 | 1839 |
"define the receiver's model, from which the text is |
5780 | 1840 |
to be acquired via list- or aspect-messages, whenever its aspect |
907
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1841 |
changes." |
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1842 |
|
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1843 |
super model:aModel. |
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1844 |
self getListFromModel |
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1845 |
|
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1846 |
"Created: 31.12.1996 / 14:56:43 / stefan" |
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1847 |
! |
ea81777689f1
Move #model: from TextView to ListView.
Stefan Vogel <sv@exept.de>
parents:
903
diff
changeset
|
1848 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1849 |
on:aModel aspect:aspectSymbol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1850 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1851 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1852 |
^ self on:aModel aspect:aspectSymbol change:nil list:aspectSymbol menu:nil |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1853 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1854 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1855 |
on:aModel aspect:aspectSymbol change:changeSymbol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1856 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1857 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1858 |
^self on:aModel aspect:aspectSymbol change:changeSymbol list:aspectSymbol menu:nil |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1859 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1860 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1861 |
on:aModel aspect:aspectSymbol change:changeSymbol list:listSymbol menu:menuSymbol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1862 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1863 |
|
4015
8647dad37cb0
comment/format in: #on:aspect:change:list:menu:
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1864 |
aspectSymbol notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1865 |
aspectMsg := aspectSymbol. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1866 |
listMsg isNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1867 |
listMsg := aspectSymbol |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
1868 |
] |
4015
8647dad37cb0
comment/format in: #on:aspect:change:list:menu:
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
1869 |
]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1870 |
listSymbol notNil ifTrue:[listMsg := listSymbol]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1871 |
changeSymbol notNil ifTrue:[changeMsg := changeSymbol]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1872 |
menuMsg := menuSymbol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1873 |
self model:aModel. |
909
be8e88881f4d
dont clear listMessage in #on:aspect:...
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1874 |
|
be8e88881f4d
dont clear listMessage in #on:aspect:...
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1875 |
"Modified: 2.1.1997 / 16:11:16 / cg" |
105 | 1876 |
! |
1877 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1878 |
on:aModel aspect:aspectSymbol change:changeSymbol menu:menuSymbol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1879 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1880 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1881 |
^ self on:aModel aspect:aspectSymbol change:changeSymbol list:nil menu:menuSymbol |
0 | 1882 |
! |
1883 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1884 |
on:aModel aspect:aspectSymbol list:listSymbol menu:menuSymbol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1885 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1886 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1887 |
^ self on:aModel aspect:aspectSymbol change:nil list:listSymbol menu:menuSymbol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1888 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1889 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1890 |
on:aModel aspect:aspectSymbol menu:menuSymbol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1891 |
"ST-80 compatibility" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1892 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
1893 |
^self on:aModel aspect:aspectSymbol change:nil list:aspectSymbol menu:menuSymbol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1894 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1895 |
|
2227 | 1896 |
!ListView methodsFor:'change & update'! |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1897 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1898 |
update:something with:aParameter from:changedObject |
2322 | 1899 |
|idx| |
1900 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1901 |
changedObject == model ifTrue:[ |
5884 | 1902 |
model isList ifTrue:[ |
1903 |
list ~~ model ifTrue:[ |
|
1904 |
something == #at: ifTrue:[ |
|
1905 |
idx := aParameter isCollection ifTrue:[aParameter at:1] |
|
1906 |
ifFalse:[aParameter]. |
|
1907 |
^ self at:aParameter put:(model at:idx). |
|
1908 |
]. |
|
1909 |
something == #insert: ifTrue:[ |
|
1910 |
(list size + 1) >= aParameter ifTrue:[ |
|
1911 |
^ self add:(model at:aParameter) beforeIndex:aParameter |
|
1912 |
]. |
|
1913 |
]. |
|
1914 |
something == #remove: ifTrue:[ |
|
1915 |
list size >= aParameter ifTrue:[ |
|
1916 |
^ self removeIndex:aParameter |
|
1917 |
] |
|
1918 |
]. |
|
1919 |
]. |
|
1920 |
self getListFromModel. |
|
1921 |
^ self |
|
1922 |
]. |
|
1923 |
||
1924 |
(aspectMsg notNil |
|
1925 |
and:[something == aspectMsg]) ifTrue:[ |
|
1926 |
self getListFromModel. |
|
1927 |
^ self |
|
1928 |
]. |
|
1929 |
something isNil ifTrue:[ |
|
1930 |
"/ model changed (not more information) |
|
1931 |
self getListFromModel. |
|
1932 |
^ self |
|
1933 |
]. |
|
1934 |
something == #size ifTrue:[ |
|
1935 |
self getListFromModelScroll:false. |
|
1936 |
^ self |
|
1937 |
]. |
|
0 | 1938 |
]. |
3425
883607c8a0df
care for listChannel changes
Claus Gittinger <cg@exept.de>
parents:
3398
diff
changeset
|
1939 |
changedObject == listChannel ifTrue:[ |
5884 | 1940 |
self getListFromModel. |
1941 |
^ self |
|
3425
883607c8a0df
care for listChannel changes
Claus Gittinger <cg@exept.de>
parents:
3398
diff
changeset
|
1942 |
]. |
883607c8a0df
care for listChannel changes
Claus Gittinger <cg@exept.de>
parents:
3398
diff
changeset
|
1943 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
1944 |
^ super update:something with:aParameter from:changedObject |
1099
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
1945 |
|
3425
883607c8a0df
care for listChannel changes
Claus Gittinger <cg@exept.de>
parents:
3398
diff
changeset
|
1946 |
"Modified: / 08-11-2006 / 19:40:29 / cg" |
0 | 1947 |
! ! |
1948 |
||
105 | 1949 |
!ListView methodsFor:'drawing'! |
1950 |
||
1951 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
|
1952 |
"draw a visible line range in fg/bg" |
|
1953 |
||
1954 |
|y "{ Class: SmallInteger }" |
|
1955 |
x "{ Class: SmallInteger }" |
|
1956 |
startLine "{ Class: SmallInteger }" |
|
1957 |
endLine "{ Class: SmallInteger }" |
|
2089
b774525a10b2
avoid drawing blue-on-blue, if selection bg is lines fg color
Claus Gittinger <cg@exept.de>
parents:
2082
diff
changeset
|
1958 |
listSize e sH l| |
105 | 1959 |
|
1960 |
y := self yOfVisibleLine:startVisLineNr. |
|
394
795f293f8520
fixed debris-leftover in scrollDown
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
1961 |
sH := lineSpacing // 2. |
795f293f8520
fixed debris-leftover in scrollDown
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
1962 |
|
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
1963 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
6053 | 1964 |
gc paint:bg. |
1965 |
gc fillRectangleX:margin y:y-sH |
|
1966 |
width:(width - (margin * 2)) |
|
1967 |
height:(endVisLineNr - startVisLineNr + 1) * fontHeight + (lineSpacing - sH). |
|
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
1968 |
]. |
105 | 1969 |
list isNil ifTrue:[^ self]. |
1970 |
||
1971 |
y := y + fontAscent. |
|
1972 |
listSize := self size. |
|
1973 |
||
1974 |
startLine := startVisLineNr + firstLineShown - 1. |
|
1975 |
endLine := endVisLineNr + firstLineShown - 1. |
|
1976 |
(startLine == 0) ifTrue:[ |
|
5862 | 1977 |
y := y + fontHeight. |
1978 |
startLine := startLine + 1 |
|
105 | 1979 |
]. |
1980 |
||
1981 |
(endLine > listSize) ifTrue:[ |
|
5862 | 1982 |
e := listSize |
105 | 1983 |
] ifFalse:[ |
5862 | 1984 |
e := endLine |
105 | 1985 |
]. |
1986 |
||
1987 |
(startLine <= e) ifTrue:[ |
|
5862 | 1988 |
x := textStartLeft - viewOrigin x. |
6053 | 1989 |
gc paint:fg on:bg. |
5862 | 1990 |
"/ don't use list from:to:do:, to allow for subclasses to redefine the enumeration (TableView) |
1991 |
self from:startLine to:e do:[:line | |
|
1992 |
line notNil ifTrue:[ |
|
1993 |
"/ remove line's color emphasis, to enforce color. |
|
1994 |
"/ otherwise blue text is not visible if selection-bg is blue |
|
1995 |
l := self withoutColorEmphasis:line ifFg:fg andBg:bg. |
|
6053 | 1996 |
gc displayOpaqueString:l x:x y:y. |
5862 | 1997 |
|
1998 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
1999 |
self updateWidthOfWidestLineFor:l |
|
2000 |
]. |
|
2001 |
]. |
|
2002 |
y := y + fontHeight |
|
2003 |
] |
|
105 | 2004 |
] |
2005 |
||
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2006 |
"Modified: / 15.12.1999 / 23:19:39 / cg" |
7 | 2007 |
! |
2008 |
||
131 | 2009 |
drawLine:line atX:x inVisible:visLineNr with:fg and:bg |
2010 |
"draw a given string at visible lines position with |
|
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2011 |
given x position in fg/bg. Clears the whole line before drawing the string. |
5198 | 2012 |
This is a low level entry; not meant for public use." |
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2013 |
|
5372 | 2014 |
|y l halfSpacing extraBelow| |
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2015 |
|
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2016 |
y := self yOfVisibleLine:visLineNr. |
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
2017 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
6065 | 2018 |
gc paint:bg. |
5862 | 2019 |
halfSpacing := (lineSpacing//2). |
2020 |
extraBelow := 0. |
|
2021 |
self highlightLineSpacing ifTrue:[ |
|
2022 |
extraBelow := halfSpacing. |
|
2023 |
]. |
|
6053 | 2024 |
gc fillRectangleX:margin y:y - halfSpacing |
2025 |
width:(width - (2 * margin)) |
|
2026 |
height:fontHeight+extraBelow. |
|
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
2027 |
]. |
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2028 |
line notNil ifTrue:[ |
6053 | 2029 |
gc paint:fg on:bg. |
5862 | 2030 |
|
2031 |
"/ remove lines color emphasis, to enforce color. |
|
2032 |
"/ otherwise blue text is not visible if selection-bg is blue. |
|
2033 |
"/ this is only done in EditTextViews and subClasses. |
|
2034 |
self suppressEmphasisInSelection ifTrue:[ |
|
2035 |
l := self withoutColorEmphasis:line ifFg:fg andBg:bg. |
|
2036 |
] ifFalse:[ |
|
2037 |
l := line |
|
2038 |
]. |
|
6065 | 2039 |
|
2040 |
"/ in the future, we may like to have a flag setting, which highlights non-ISO8859 characters; |
|
2041 |
"/ so we can tell, which chars make problems when saving as non-UTF8 |
|
2042 |
||
2043 |
"/ l string bytesPerCharacter > 1 ifTrue:[ |
|
2044 |
"/ l do:[:each | each bytesPerCharacter > 1 ifTrue:[ self halt ]]. |
|
2045 |
"/ ]. |
|
6053 | 2046 |
gc displayOpaqueString:l x:x y:(y + fontAscent). |
5862 | 2047 |
|
2048 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
2049 |
self updateWidthOfWidestLineFor:l |
|
2050 |
]. |
|
5372 | 2051 |
]. |
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2052 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2053 |
"Modified: / 15.12.1999 / 23:19:46 / cg" |
422
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2054 |
! |
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2055 |
|
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2056 |
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2057 |
"draw a given string at visible lines position with |
12bfba6f62b5
redraw debris leftover fixed (cursorStyle==#motif)
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
2058 |
given x position in fg/bg. Clears partial line before drawing the string. |
131 | 2059 |
Low level entry; not meant for public use." |
2060 |
||
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2061 |
|y l| |
105 | 2062 |
|
2063 |
y := self yOfVisibleLine:visLineNr. |
|
2064 |
line notNil ifTrue:[ |
|
6053 | 2065 |
gc paint:fg on:bg. |
5862 | 2066 |
|
2067 |
"/ remove lines color emphasis, to enforce color. |
|
2068 |
"/ otherwise blue text is not visible if selection-bg is blue |
|
2069 |
l := self withoutColorEmphasis:line ifFg:fg andBg:bg. |
|
6053 | 2070 |
gc displayOpaqueString:l x:x y:(y + fontAscent). |
5862 | 2071 |
|
2072 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
2073 |
self updateWidthOfWidestLineFor:l |
|
2074 |
]. |
|
105 | 2075 |
] |
191
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
2076 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2077 |
"Modified: / 15.12.1999 / 23:19:55 / cg" |
105 | 2078 |
! |
2079 |
||
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2080 |
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg |
105 | 2081 |
"draw single character at col index of visible line in fg/bg" |
2082 |
||
2561 | 2083 |
|y yf x len lineString characterString w| |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2084 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2085 |
lineString := lineStringArg. |
2561 | 2086 |
len := lineString size. |
1927
d5e14e7bce6f
fixed cursor drawing over coloured text
Claus Gittinger <cg@exept.de>
parents:
1911
diff
changeset
|
2087 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
2088 |
x := (self xOfCol:col inVisibleLine:visLineNr) - viewOrigin x. |
105 | 2089 |
y := self yOfVisibleLine:visLineNr. |
2561 | 2090 |
yf := y - (lineSpacing // 2). |
2091 |
||
6053 | 2092 |
gc paint:bg. |
2576
8af235849704
partial redraw behone non-string lines end
Michael Beyl <mb@exept.de>
parents:
2565
diff
changeset
|
2093 |
|
2561 | 2094 |
(lineString notNil and:[lineString isString not]) ifTrue:[ |
5862 | 2095 |
w := lineString widthFrom:col to:(col min:len) on:self. |
2096 |
w <= 0 ifTrue:[ |
|
2097 |
w := gc font width. |
|
6053 | 2098 |
gc fillRectangleX:x y:yf width:w height:fontHeight. |
2099 |
gc paint:fg |
|
5862 | 2100 |
]. |
2101 |
self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[ |
|
2102 |
self drawVisibleLine:visLineNr with:fg and:bg |
|
2103 |
]. |
|
2104 |
^ self |
|
2561 | 2105 |
]. |
2106 |
||
2654 | 2107 |
(lineString isNil or:[col > len]) ifTrue:[ |
6053 | 2108 |
gc fillRectangleX:x y:yf width:(gc font width) height:fontHeight. |
2109 |
gc paint:fg |
|
105 | 2110 |
] ifFalse:[ |
5862 | 2111 |
characterString := lineString copyFrom:col to:col. |
2112 |
||
2113 |
"/ remove lines color emphasis, to enforce color. |
|
2114 |
"/ otherwise blue text is not visible if selection-bg is blue |
|
2115 |
characterString := self withoutColorEmphasis:characterString ifFg:fg andBg:bg. |
|
2116 |
w := characterString widthOn:self. |
|
2117 |
||
6053 | 2118 |
gc fillRectangleX:x y:yf width:w height:fontHeight. |
2119 |
gc paint:fg. |
|
5862 | 2120 |
self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[ |
6053 | 2121 |
gc displayString:characterString x:x y:(y + fontAscent) |
5862 | 2122 |
]. |
2123 |
||
2124 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
2125 |
self updateWidthOfWidestLineFor:characterString |
|
2126 |
]. |
|
105 | 2127 |
] |
191
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
2128 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2129 |
"Modified: / 15.12.1999 / 23:21:12 / cg" |
105 | 2130 |
! |
2131 |
||
2558
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
2132 |
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg |
105 | 2133 |
"draw part of a visible line in fg/bg" |
2134 |
||
4637 | 2135 |
|y yf x lineString len characterString w endCol sCol eCol numExtraCols| |
2558
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
2136 |
|
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
2137 |
"/ hack - please rewrite |
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
2138 |
endCol := endColOrNil ? lineStringArg size. |
105 | 2139 |
(endCol >= startCol) ifTrue:[ |
4049 | 2140 |
sCol := startCol max:1. |
2141 |
||
2142 |
lineString := lineStringArg. |
|
2143 |
||
2144 |
x := (self xOfCol:sCol inVisibleLine:visLineNr) - viewOrigin x. |
|
2145 |
y := (self yOfVisibleLine:visLineNr). |
|
2146 |
yf := y - (lineSpacing // 2). |
|
2147 |
||
2148 |
len := lineString size. |
|
5111 | 2149 |
(lineString notNil and:[lineString isString not ]) |
4049 | 2150 |
ifTrue:[ |
2151 |
w := lineString widthFrom:sCol to:(endCol min:len) on:self. |
|
2152 |
endCol > len ifTrue:[ |
|
2153 |
sCol > len ifTrue:[ |
|
4637 | 2154 |
numExtraCols := (endCol - sCol + 1). |
4049 | 2155 |
] ifFalse:[ |
4637 | 2156 |
numExtraCols := (endCol - len" + 1"). |
4049 | 2157 |
]. |
6053 | 2158 |
gc paint:bg. |
2159 |
gc fillRectangleX:x+w y:yf width:(numExtraCols * fontWidth) height:fontHeight. |
|
4049 | 2160 |
]. |
2161 |
w > 0 ifTrue:[ |
|
2162 |
self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[ |
|
6053 | 2163 |
gc drawVisibleLine:visLineNr with:fg and:bg. |
5862 | 2164 |
]. |
2165 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
2166 |
self updateWidthOfWidestLineFor:characterString |
|
2167 |
]. |
|
4049 | 2168 |
]. |
2169 |
^ self. |
|
2170 |
]. |
|
2171 |
||
2172 |
(sCol > len) ifTrue:[ |
|
2173 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
|
2174 |
len := endCol - sCol + 1. |
|
6053 | 2175 |
gc paint:bg. |
2176 |
gc fillRectangleX:x y:yf |
|
4049 | 2177 |
width:(fontWidth * len) |
2178 |
height:fontHeight |
|
2179 |
] |
|
2180 |
] ifFalse:[ |
|
2181 |
eCol := endCol. |
|
2182 |
(endCol > len) ifTrue:[ |
|
2183 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
|
2184 |
characterString := lineString string species new:endCol. |
|
2185 |
characterString replaceFrom:1 to:len with:lineString startingAt:1. |
|
2186 |
lineString := characterString. |
|
2187 |
] ifTrue:[ |
|
2188 |
eCol := len. |
|
2189 |
]. |
|
2190 |
]. |
|
2191 |
||
2192 |
"/ remove any color emphasis, to enforce drawing in fg/bg |
|
2193 |
||
2194 |
lineString := self withoutColorEmphasis:lineString ifFg:fg andBg:bg. |
|
2195 |
||
2196 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
|
5111 | 2197 |
(lineString isSingleByteString) ifTrue:[ |
4049 | 2198 |
fontIsFixedWidth ifTrue:[ |
2199 |
w := (eCol - sCol + 1) * fontWidth |
|
2200 |
] ifFalse:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2201 |
w := gc font widthOf:lineString from:sCol to:eCol |
4049 | 2202 |
] |
2203 |
] ifFalse:[ |
|
2204 |
w := lineString widthFrom:sCol to:endCol on:self |
|
2205 |
]. |
|
6053 | 2206 |
gc paint:bg. |
2207 |
gc fillRectangleX:x y:yf width:w height:fontHeight. |
|
4049 | 2208 |
]. |
6053 | 2209 |
gc paint:fg on:bg. |
4049 | 2210 |
w notNil ifTrue:[ |
2211 |
"/ clip req'd for VISTAs new font rendering (which seems to shoot over the compute |
|
2212 |
self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[ |
|
4495 | 2213 |
"/ self displayOpaqueString:lineString from:sCol to:eCol x:x y:(y + fontAscent) |
6053 | 2214 |
gc displayString:lineString from:sCol to:eCol x:x y:(y + fontAscent) |
4049 | 2215 |
] |
2216 |
] ifFalse:[ |
|
4495 | 2217 |
"/ self displayOpaqueString:lineString from:sCol to:eCol x:x y:(y + fontAscent) |
6053 | 2218 |
gc displayString:lineString from:sCol to:eCol x:x y:(y + fontAscent) opaque:false maxWidth:self width |
4049 | 2219 |
]. |
5862 | 2220 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
2221 |
self updateWidthOfWidestLineFor:lineString |
|
2222 |
]. |
|
4049 | 2223 |
] |
105 | 2224 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2225 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2226 |
"Modified: / 15.12.1999 / 23:21:43 / cg" |
0 | 2227 |
! |
2228 |
||
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2229 |
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2230 |
"draw right part of a visible line from startCol to end of line in fg/bg" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2231 |
|
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2232 |
|y x index1 index2 lineWithoutColor| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2233 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2234 |
(startCol < 1) ifTrue:[ |
5862 | 2235 |
index1 := 1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2236 |
] ifFalse:[ |
5862 | 2237 |
index1 := startCol |
0 | 2238 |
]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2239 |
y := self yOfVisibleLine:visLineNr. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
2240 |
x := (self xOfCol:index1 inVisibleLine:visLineNr) - viewOrigin x. |
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
2241 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
6053 | 2242 |
gc paint:bg. |
2243 |
gc fillRectangleX:x y:y - (lineSpacing // 2) |
|
2244 |
width:(width + viewOrigin x - x) height:fontHeight. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2245 |
]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2246 |
lineString notNil ifTrue:[ |
5862 | 2247 |
lineString isString ifFalse:[ |
2248 |
self drawLine:lineString inVisible:visLineNr from:startCol to:nil with:fg and:bg. |
|
2249 |
] ifTrue:[ |
|
2250 |
lineWithoutColor := self withoutColorEmphasis:lineString ifFg:fg andBg:bg. |
|
2251 |
index2 := lineWithoutColor size. |
|
2252 |
(index2 < index1) ifTrue:[^ self]. |
|
2253 |
(index1 <= index2) ifTrue:[ |
|
2254 |
self paint:fg on:bg. |
|
2255 |
"/ self displayOpaqueString:lineWithoutColor from:index1 to:index2 x:x y:(y + fontAscent) |
|
6053 | 2256 |
gc displayString:lineWithoutColor from:index1 to:index2 x:x y:(y + fontAscent). |
5862 | 2257 |
|
2258 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
|
2259 |
self updateWidthOfWidestLineFor:lineWithoutColor |
|
2260 |
]. |
|
2261 |
] |
|
2262 |
] |
|
0 | 2263 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2264 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2265 |
"Modified: / 15.12.1999 / 23:24:40 / cg" |
105 | 2266 |
! |
2267 |
||
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2268 |
drawLine:line inVisible:visLineNr with:fg and:bg |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2269 |
"draw a given string at visible lines position in fg/bg" |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2270 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2271 |
self drawLine:line atX:(textStartLeft - viewOrigin x) inVisible:visLineNr with:fg and:bg |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2272 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2273 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2274 |
drawVisibleLine:visLineNr col:col with:fg and:bg |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2275 |
"draw single character at col index of visible line in fg/bg" |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2276 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2277 |
self |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2278 |
drawLine:(self visibleAt:visLineNr) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2279 |
inVisible:visLineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2280 |
col:col |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2281 |
with:fg and:bg |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2282 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2283 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2284 |
drawVisibleLine:visLineNr from:startCol to:endCol with:fg and:bg |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2285 |
"draw part of a visible line in fg/bg" |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2286 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2287 |
self |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2288 |
drawLine:(self visibleAt:visLineNr) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2289 |
inVisible:visLineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2290 |
from:startCol to:endCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2291 |
with:fg and:bg |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2292 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2293 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2294 |
drawVisibleLine:visLineNr from:startCol with:fg and:bg |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2295 |
"draw right part of a visible line from startCol to end of line in fg/bg" |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2296 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2297 |
self |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2298 |
drawLine:(self visibleAt:visLineNr) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2299 |
inVisible:visLineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2300 |
from:startCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2301 |
with:fg and:bg |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2302 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
2303 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2304 |
drawVisibleLine:visLineNr with:fg and:bg |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2305 |
"draw a visible line in fg/bg" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2306 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2307 |
self |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2308 |
drawLine:(self visibleAt:visLineNr) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2309 |
atX:(textStartLeft - viewOrigin x) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2310 |
inVisible:visLineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2311 |
with:fg |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2312 |
and:bg |
427
a75bc351b17f
slight rewrites (changes for accelerator-display)
Claus Gittinger <cg@exept.de>
parents:
422
diff
changeset
|
2313 |
|
a75bc351b17f
slight rewrites (changes for accelerator-display)
Claus Gittinger <cg@exept.de>
parents:
422
diff
changeset
|
2314 |
"Modified: 28.2.1996 / 19:30:23 / cg" |
1462 | 2315 |
! |
2316 |
||
2317 |
fillRectangleX:x y:y width:w height:h |
|
2318 |
"fill rectangle; checks whether the rectangle already is filled with |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2319 |
the current paint (#redrawX:y:w:h)." |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2320 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2321 |
backgroundAlreadyClearedColor ~~ self paint ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2322 |
super fillRectangleX:x y:y width:w height:h |
1462 | 2323 |
] |
1465
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2324 |
! |
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2325 |
|
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2326 |
invalidateLine:line |
1466
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2327 |
"invalidate the area of a single line. |
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2328 |
This arranges for that line to be redrawn asynchronously (later). |
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2329 |
If multiple such invalidations arrive, those areas may be lumped |
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2330 |
together for a block update. |
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2331 |
The update takes place when the windowGroup process gets a chance to |
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2332 |
process expose events." |
1465
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2333 |
|
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2334 |
|yTop visLineNr| |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2335 |
|
1465
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2336 |
visLineNr := self listLineToVisibleLine:line. |
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2337 |
visLineNr notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2338 |
yTop := self yOfVisibleLine:visLineNr. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2339 |
yTop isNil ifTrue:[^ self]. "/ not visible |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2340 |
(yTop + fontHeight) < 0 ifTrue:[^ self]. "/ not visible |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2341 |
self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2342 |
invalidateDeviceRectangle:(Rectangle |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2343 |
left:margin top:yTop-(lineSpacing//2) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2344 |
width:(width - (2 * margin)) height:fontHeight) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2345 |
repairNow:false. |
1465
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2346 |
] |
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2347 |
|
7832492b8443
added #invalidateLine: for asynchronous redraw of a single line
Claus Gittinger <cg@exept.de>
parents:
1462
diff
changeset
|
2348 |
"Created: / 5.3.1998 / 01:24:19 / cg" |
1466
fd077de6285d
comment for #invalidateLine:
Claus Gittinger <cg@exept.de>
parents:
1465
diff
changeset
|
2349 |
"Modified: / 5.3.1998 / 13:41:31 / cg" |
105 | 2350 |
! ! |
2351 |
||
2752 | 2352 |
!ListView methodsFor:'event handling'! |
105 | 2353 |
|
887
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2354 |
contentsChanged |
4634 | 2355 |
"size of contents changed - move origin up if possible" |
887
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2356 |
|
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2357 |
|listSize newOrigin| |
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2358 |
|
890
abd28e2f66ca
stefan ! test your changes ;-)
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
2359 |
shown ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2360 |
list notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2361 |
listSize := self numberOfLines. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2362 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2363 |
listSize == 0 ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2364 |
widthOfWidestLine := 0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2365 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2366 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2367 |
" |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2368 |
if we are beyond the end, scroll up a bit |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2369 |
" |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2370 |
((firstLineShown + nFullLinesShown) > listSize) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2371 |
newOrigin := listSize - nFullLinesShown + 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2372 |
newOrigin < 1 ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2373 |
newOrigin := 1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2374 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2375 |
self scrollToLine: newOrigin. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2376 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2377 |
]. |
887
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2378 |
]. |
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2379 |
|
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2380 |
^ super contentsChanged |
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2381 |
|
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2382 |
"Modified: 18.11.1996 / 19:50:07 / stefan" |
1099
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
2383 |
"Modified: 5.3.1997 / 15:50:46 / cg" |
887
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2384 |
! |
9b25df4d193a
Recompute origin when one or more lines have been deleted.
Stefan Vogel <sv@exept.de>
parents:
883
diff
changeset
|
2385 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2386 |
keyPress:key x:x y:y |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2387 |
"a key was pressed - handle page-keys here" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2388 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2389 |
<resource: #keyboard (#PreviousPage #NextPage #HalfPageUp #HalfPageDown |
5790 | 2390 |
#BeginOfText #EndOfText |
2391 |
#ScrollUp #ScrollDown |
|
5927 | 2392 |
)> |
2731
0f3c02f592d0
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2707
diff
changeset
|
2393 |
|n| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2394 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2395 |
(key == #PreviousPage) ifTrue: [^ self pageUp]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2396 |
(key == #NextPage) ifTrue: [^ self pageDown]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2397 |
(key == #HalfPageUp) ifTrue: [^ self halfPageUp]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2398 |
(key == #HalfPageDown) ifTrue: [^ self halfPageDown]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2399 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2400 |
(key == #BeginOfText) ifTrue:[^ self scrollToTop]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2401 |
(key == #EndOfText) ifTrue:[^ self scrollToBottom]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2402 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2403 |
(key == #ScrollUp) ifTrue:[ |
5790 | 2404 |
n := 1 + (self sensor compressKeyPressEventsWithKey:#ScrollUp). |
2405 |
^ self scrollUp:n |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2406 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2407 |
(key == #ScrollDown) ifTrue:[ |
5790 | 2408 |
n := 1 + (self sensor compressKeyPressEventsWithKey:#ScrollDown). |
2409 |
^ self scrollDown:n |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2410 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2411 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2412 |
super keyPress:key x:x y:y |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2413 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2414 |
|
6252 | 2415 |
keyboardZoom:largerBoolean |
5790 | 2416 |
"CTRL+/- zoom action" |
2417 |
||
6252 | 2418 |
self fontLargerOrSmaller:largerBoolean |
2419 |
! |
|
2420 |
||
2421 |
keyboardZoom:largerBoolean inAllViews:inAllViews |
|
5924 | 2422 |
"CTRL+/- zoom action" |
2423 |
||
2424 |
inAllViews ifTrue:[ |
|
5925 | 2425 |
SimpleView allSubInstancesDo:[:each | |
6252 | 2426 |
each keyboardZoom:largerBoolean |
5924 | 2427 |
]. |
2428 |
] ifFalse:[ |
|
6252 | 2429 |
self keyboardZoom:largerBoolean |
5924 | 2430 |
]. |
5790 | 2431 |
! |
2432 |
||
2273
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2433 |
mapped |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2434 |
self stopAutoScroll. |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2435 |
super mapped |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2436 |
! |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2437 |
|
3836 | 2438 |
mouseWheelZoom:amount |
4070
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2439 |
"CTRL-wheel action" |
3836 | 2440 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2441 |
|oldSize newSize delta mul font| |
3836 | 2442 |
|
2443 |
amount > 0 ifTrue:[ |
|
4070
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2444 |
"/ delta := 1. mul := 1. |
5790 | 2445 |
delta := 0. mul := 1.05. |
3836 | 2446 |
] ifFalse:[ |
4070
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2447 |
"/ delta := -1. mul := 1. |
5790 | 2448 |
delta := 0. mul := 0.95. |
3836 | 2449 |
]. |
2450 |
||
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2451 |
font := gc font. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2452 |
font sizeUnit ~~ #px ifTrue:[ |
4070
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2453 |
oldSize := font size. |
5790 | 2454 |
newSize := (((oldSize + delta)* mul) max:4) min:100. |
4070
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2455 |
newSize ~= oldSize ifTrue:[ |
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2456 |
self font:(font asSize:newSize). |
8225a547d6a7
comment/format in: #mouseWheelZoom:
Claus Gittinger <cg@exept.de>
parents:
4049
diff
changeset
|
2457 |
] |
3836 | 2458 |
]. |
2459 |
! |
|
2460 |
||
0 | 2461 |
redrawX:x y:y width:w height:h |
2462 |
"a region must be redrawn" |
|
2463 |
||
1462 | 2464 |
|startCol endCol line saveClip |
2465 |
startLine "{ Class:SmallInteger }" |
|
2466 |
stopLine "{ Class:SmallInteger }" |
|
2467 |
| |
|
0 | 2468 |
|
127 | 2469 |
shown ifFalse:[^ self]. |
2470 |
||
0 | 2471 |
startLine := self visibleLineOfY:y. |
2472 |
stopLine := self visibleLineOfY:(y + h). |
|
2473 |
||
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2474 |
saveClip := gc clippingBoundsOrNil. |
6032 | 2475 |
self clippingBounds:(Rectangle left:x top:y width:w height:h). |
6053 | 2476 |
gc paint:bgColor. |
2477 |
gc fillRectangleX:x y:y width:w height:h. |
|
1462 | 2478 |
backgroundAlreadyClearedColor := bgColor. |
2479 |
||
2480 |
(includesNonStrings or:[w > (width // 4 * 3)]) ifTrue:[ |
|
6032 | 2481 |
"includes non strings or area is big enough: redraw whole lines" |
2482 |
self redrawFromVisibleLine:startLine to:stopLine |
|
0 | 2483 |
] ifFalse:[ |
6032 | 2484 |
line := self visibleAt:startLine. |
2485 |
||
2486 |
(fontIsFixedWidth and:[line isSingleByteString]) ifFalse:[ |
|
2487 |
"start/end col has to be computed for each line" |
|
2488 |
||
2489 |
startLine to:stopLine do:[:i | |
|
2490 |
startCol := self colOfX:x inVisibleLine:i. |
|
2491 |
endCol := self colOfX:(x + w) inVisibleLine:i. |
|
2492 |
startCol > 0 ifTrue:[ |
|
2493 |
endCol > 0 ifTrue:[ |
|
2494 |
self redrawVisibleLine:i from:startCol to:endCol |
|
2495 |
] |
|
2496 |
] |
|
2497 |
] |
|
2498 |
] ifTrue:[ |
|
2499 |
"start/end col is the same for all lines" |
|
2500 |
startCol := self colOfX:x inVisibleLine:startLine. |
|
2501 |
endCol := self colOfX:(x + w) inVisibleLine:startLine. |
|
2502 |
startCol > 0 ifTrue:[ |
|
2503 |
endCol > 0 ifTrue:[ |
|
2504 |
startLine to:stopLine do:[:i | |
|
2505 |
line := self visibleAt:i. |
|
2506 |
(line isSingleByteString) ifTrue:[ |
|
2507 |
self redrawVisibleLine:i from:startCol to:endCol |
|
2508 |
] ifFalse:[ |
|
2509 |
self redrawVisibleLine:i |
|
2510 |
] |
|
2511 |
] |
|
2512 |
] |
|
2513 |
] |
|
2514 |
] |
|
1462 | 2515 |
]. |
2516 |
backgroundAlreadyClearedColor := nil. |
|
6032 | 2517 |
self clippingBounds:saveClip. |
0 | 2518 |
! |
2519 |
||
105 | 2520 |
sizeChanged:how |
2521 |
"size changed - move origin up if possible" |
|
2522 |
||
2523 |
super sizeChanged:how. |
|
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
2524 |
|
105 | 2525 |
self computeNumberOfLinesShown. |
2526 |
||
2527 |
innerWidth := width - textStartLeft - margin. |
|
1972 | 2528 |
|
2577 | 2529 |
"/ Makes trouble when fighting with SelListViews sizeChanged-positioning ... |
1972 | 2530 |
"/ |
2531 |
"/ shown ifFalse:[^ self]. |
|
2532 |
"/ list isNil ifTrue:[^ self]. |
|
2533 |
"/ |
|
2534 |
"/ listSize := self numberOfLines. |
|
2535 |
"/ " |
|
2536 |
"/ if we are beyond the end, scroll up a bit |
|
2537 |
"/ " |
|
2538 |
"/ ((firstLineShown + nFullLinesShown) >= listSize) ifTrue:[ |
|
2539 |
"/ self scrollToBottom. |
|
2540 |
"/ ^ self |
|
1429
b7b7f3477594
do not invalidate, when the size changes;
Claus Gittinger <cg@exept.de>
parents:
1425
diff
changeset
|
2541 |
"/ ]. |
643 | 2542 |
|
1429
b7b7f3477594
do not invalidate, when the size changes;
Claus Gittinger <cg@exept.de>
parents:
1425
diff
changeset
|
2543 |
"Modified: / 18.11.1996 / 19:37:02 / stefan" |
b7b7f3477594
do not invalidate, when the size changes;
Claus Gittinger <cg@exept.de>
parents:
1425
diff
changeset
|
2544 |
"Modified: / 27.1.1998 / 14:10:04 / cg" |
2273
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2545 |
! |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2546 |
|
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2547 |
unmap |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2548 |
self stopAutoScroll. |
e40b815ce3e2
stop autoscroll if no longer visible
Claus Gittinger <cg@exept.de>
parents:
2258
diff
changeset
|
2549 |
super unmap |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2550 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2551 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2552 |
!ListView methodsFor:'initialization'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2553 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2554 |
create |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2555 |
super create. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2556 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2557 |
"I cache font parameters here - they are used so often ..." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2558 |
self getFontParameters. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2559 |
self computeNumberOfLinesShown. |
1990 | 2560 |
fgColor := fgColor onDevice:device. |
2561 |
bgColor := bgColor onDevice:device |
|
105 | 2562 |
! |
2563 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2564 |
defaultControllerClass |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2565 |
self class == ListView ifTrue:[^ ListViewController]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2566 |
^ super defaultControllerClass |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2567 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2568 |
|
940 | 2569 |
fetchDeviceResources |
2570 |
"fetch device colors, to avoid reallocation at redraw time" |
|
2571 |
||
2572 |
super fetchDeviceResources. |
|
2573 |
||
1990 | 2574 |
fgColor notNil ifTrue:[fgColor := fgColor onDevice:device]. |
2575 |
bgColor notNil ifTrue:[bgColor := bgColor onDevice:device]. |
|
940 | 2576 |
|
2577 |
"Created: 14.1.1997 / 00:12:12 / cg" |
|
2578 |
! |
|
2579 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2580 |
initStyle |
967 | 2581 |
"setup viewStyle specifics" |
2582 |
||
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2583 |
|n| |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2584 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2585 |
super initStyle. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2586 |
|
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2587 |
n := DefaultTopMargin. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2588 |
n isInteger ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2589 |
n := (self verticalPixelPerMillimeter:n) rounded. |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2590 |
]. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2591 |
self topMargin:n. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2592 |
|
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2593 |
n := DefaultLeftMargin. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2594 |
n isInteger ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2595 |
n := (self verticalPixelPerMillimeter:n) rounded. |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2596 |
]. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2597 |
self leftMargin:n. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2598 |
|
4573 | 2599 |
lineSpacing := 2. |
4577 | 2600 |
"/ q&d temporary hack. |
2601 |
"/ X11 fonts are currently so ugly... add more spacing. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2602 |
device isX11Platform ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2603 |
lineSpacing := lineSpacing + 3. |
4577 | 2604 |
]. |
940 | 2605 |
fgColor := DefaultForegroundColor. |
2606 |
bgColor := DefaultBackgroundColor. |
|
4322 | 2607 |
|
2608 |
"Modified (comment): / 05-10-2011 / 15:51:02 / az" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2609 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2610 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2611 |
initialize |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2612 |
super initialize. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2613 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2614 |
viewOrigin := 0@0. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2615 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2616 |
textStartTop := topMargin + margin. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2617 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2618 |
bitGravity := #NorthWest. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2619 |
list := nil. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2620 |
firstLineShown := 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2621 |
nFullLinesShown := 1. "just any value ..." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2622 |
nLinesShown := 1. "just any value" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2623 |
partialLines := true. |
5683 | 2624 |
tabPositions := UserDefaultTabPositions ? self class defaultTabPositions. |
864 | 2625 |
includesNonStrings := false. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2626 |
lineEndCRLF := false. |
4751 | 2627 |
checkedLinesForWidthOfContentsComputation := nil."/ i.e. all |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2628 |
self getFontParameters. |
3312 | 2629 |
self initializeWordCheckAction. |
4747 | 2630 |
|
3312 | 2631 |
scrollWhenUpdating := #keep. "/ #beginOfText. |
4747 | 2632 |
expandTabsWhenUpdating := true. |
2633 |
compareModelOnUpdate := true. |
|
2634 |
checkLineEndConventionWhenUpdating := true. |
|
2635 |
scrollLocked := false. |
|
3312 | 2636 |
autoScroll := true. |
2637 |
||
2638 |
"Modified: / 03-07-2006 / 17:03:59 / cg" |
|
2639 |
! |
|
2640 |
||
3564 | 2641 |
initializeWordCheckAction |
4403 | 2642 |
"the wordCheck is a predicate block which returns true if the given character |
2643 |
belongs to the (textual) word. Used with double click to select a word. |
|
2644 |
When editing code, typically characters which are part of an identifier |
|
2645 |
are part of a word (underline, dollar, but no other non-letters). |
|
2646 |
The standardWordCheck aks the current userPreferences for details." |
|
2647 |
||
3564 | 2648 |
wordCheck := [:char | self standardWordCheck:char]. |
2649 |
||
2650 |
"Created: / 03-07-2006 / 17:03:50 / cg" |
|
2651 |
! |
|
2652 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2653 |
realize |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2654 |
|sz| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2655 |
|
2305
f2850e54b0ab
only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents:
2273
diff
changeset
|
2656 |
self extentChangedFlag ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2657 |
self computeNumberOfLinesShown. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2658 |
]. |
691
906e4d67b9cf
fixed makeLineVisible; when not-yet realized
Claus Gittinger <cg@exept.de>
parents:
688
diff
changeset
|
2659 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2660 |
firstLineShown ~~ 1 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2661 |
sz := self size. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2662 |
firstLineShown + nLinesShown > sz ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2663 |
self scrollToLine:sz - nLinesShown. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2664 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2665 |
]. |
691
906e4d67b9cf
fixed makeLineVisible; when not-yet realized
Claus Gittinger <cg@exept.de>
parents:
688
diff
changeset
|
2666 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2667 |
super realize. |
837 | 2668 |
|
1081
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2669 |
"/ old: fetch models value on realize; |
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2670 |
"/ new: fetch value when model is assigned. |
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2671 |
"/ |
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2672 |
"/ model notNil ifTrue:[ |
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2673 |
"/ self getListFromModel. |
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2674 |
"/ ] |
691
906e4d67b9cf
fixed makeLineVisible; when not-yet realized
Claus Gittinger <cg@exept.de>
parents:
688
diff
changeset
|
2675 |
|
825
d115a0923b7d
Send #getListFromModel when setting #model:
Stefan Vogel <sv@exept.de>
parents:
820
diff
changeset
|
2676 |
"Modified: 15.8.1996 / 13:08:56 / stefan" |
1081
0d3f4ad6e7e5
now fetch models value when model is assigned;
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
2677 |
"Modified: 28.2.1997 / 19:44:19 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2678 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2679 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2680 |
recreate |
2258 | 2681 |
"recreate after a snapin or a migration" |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2682 |
|n| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2683 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2684 |
super recreate. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2685 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2686 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2687 |
recompute margins and font parameters |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2688 |
- display may have different resolution/font sizes. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2689 |
" |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2690 |
"/ topMargin := (self verticalPixelPerMillimeter:0.5) rounded. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2691 |
"/ self leftMargin:(self horizontalPixelPerMillimeter:0.5) rounded. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2692 |
|
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2693 |
n := DefaultTopMargin. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2694 |
n isInteger ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2695 |
n := (self verticalPixelPerMillimeter:n) rounded. |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2696 |
]. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2697 |
self topMargin:n. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2698 |
|
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2699 |
n := DefaultLeftMargin. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2700 |
n isInteger ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2701 |
n := (self verticalPixelPerMillimeter:n) rounded. |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2702 |
]. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2703 |
self leftMargin:n. |
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2704 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2705 |
self getFontParameters |
1693
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2706 |
|
e76979454c2f
more flexible top/leftMargin handling
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
2707 |
"Modified: / 26.9.1998 / 17:09:32 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2708 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2709 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2710 |
!ListView methodsFor:'private'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2711 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2712 |
absoluteLineToVisibleLine:absLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2713 |
"given an absolute line (1..) return visible linenr or nil" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2714 |
|
2976 | 2715 |
<resource:#obsolete> |
2423
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2716 |
self obsoleteMethodWarning:'use #listLineToVisibleLine:'. |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2717 |
^ self listLineToVisibleLine:absLineNr |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2718 |
|
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2719 |
"/ absLineNr isNil ifTrue:[^ nil]. |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2720 |
"/ (absLineNr < firstLineShown) ifTrue:[^ nil]. |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2721 |
"/ (absLineNr >= (firstLineShown + nLinesShown)) ifTrue:[^ nil]. |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2722 |
"/ ^ absLineNr - firstLineShown + 1 |
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2723 |
"/ |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2724 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2725 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2726 |
checkForExistingLine:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2727 |
"check if a line for lineNr exists; if not, expand text" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2728 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2729 |
list isNil ifTrue: [ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2730 |
list := StringCollection new:lineNr. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2731 |
self contentsChanged |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2732 |
] ifFalse: [ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2733 |
lineNr > (list size) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2734 |
self grow:lineNr. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2735 |
self contentsChanged |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2736 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2737 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2738 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2739 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2740 |
colOfX:x inVisibleLine:visLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2741 |
"given a visible lineNr and x-coordinate, return colNr" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2742 |
|
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2743 |
|lineString linePixelWidth xRel runCol posLeft posRight done |
1259
aba6a9deab8d
break out of col-search loop in case of bad string
Claus Gittinger <cg@exept.de>
parents:
1249
diff
changeset
|
2744 |
hasEmphasis oPosRight oPosLeft| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2745 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
2746 |
xRel := x - textStartLeft + viewOrigin x. |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2747 |
(xRel <= 0) ifTrue:[^ 1]. |
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2748 |
|
1656
1202fbc95970
some fixes forvariable fonts on win32
Claus Gittinger <cg@exept.de>
parents:
1637
diff
changeset
|
2749 |
lineString := self visibleAt:visLineNr. |
1202fbc95970
some fixes forvariable fonts on win32
Claus Gittinger <cg@exept.de>
parents:
1637
diff
changeset
|
2750 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2751 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2752 |
for fix fonts, this is easy ... |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2753 |
" |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2754 |
(fontIsFixedWidth |
5928 | 2755 |
and:[lineString isNil or:[lineString hasChangeOfEmphasis not]]) ifTrue:[ |
5793 | 2756 |
^ (xRel // fontWidth) + 1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2757 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2758 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2759 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2760 |
for variable fonts, more work is required ... |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2761 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2762 |
lineString notNil ifTrue:[ |
5793 | 2763 |
lineString := self visibleStringFrom:lineString. |
2764 |
(hasEmphasis := lineString hasChangeOfEmphasis) ifTrue:[ |
|
2765 |
linePixelWidth := lineString widthOn:self |
|
2766 |
] ifFalse:[ |
|
2767 |
lineString := lineString string. |
|
2768 |
linePixelWidth := gc font widthOf:lineString. |
|
2769 |
] |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2770 |
] ifFalse:[ |
5793 | 2771 |
linePixelWidth := 0 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2772 |
]. |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2773 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2774 |
(linePixelWidth <= xRel) ifTrue:[ |
5793 | 2775 |
fontWidth == 0 ifTrue:[ |
2776 |
" |
|
2777 |
although this 'cannot happen', |
|
2778 |
it seems that X reports this width for some strange fonts ... |
|
2779 |
" |
|
2780 |
^ lineString size |
|
2781 |
]. |
|
2782 |
^ lineString size + ((xRel - linePixelWidth) // fontWidth) + 1 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2783 |
]. |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2784 |
|
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2785 |
"/ cannot simply count individual characters, |
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2786 |
"/ since kerning or other non-linear effects may be involved ... |
4245
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2787 |
"/ use a binary search, initialized with some guess. |
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2788 |
|
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2789 |
"/ a guess: take some 'average' character's width and compute an initial guess |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2790 |
runCol := x // (gc font widthOf:'e'). |
4247 | 2791 |
runCol := runCol min:lineString size. |
4245
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2792 |
|
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2793 |
"/ runCol := lineString size // 2. |
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2794 |
"/ (runCol == 0) ifTrue:[runCol := 1]. |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2795 |
|
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2796 |
hasEmphasis ifTrue:[ |
5793 | 2797 |
posLeft := (lineString copyFrom:1 to:(runCol - 1)) widthOn:self. |
2798 |
posRight := (lineString copyFrom:1 to:runCol) widthOn:self. |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2799 |
] ifFalse:[ |
5793 | 2800 |
posLeft := gc font widthOf:lineString from:1 to:(runCol - 1). |
2801 |
posRight := gc font widthOf:lineString from:1 to:runCol. |
|
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2802 |
]. |
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2803 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2804 |
done := (posLeft <= xRel) and:[posRight > xRel]. |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2805 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2806 |
[done] whileFalse:[ |
5793 | 2807 |
oPosRight := posRight. |
2808 |
oPosLeft := posLeft. |
|
2809 |
||
2810 |
(posRight <= xRel) ifTrue:[ |
|
2811 |
runCol := runCol + 1. |
|
2812 |
posLeft := posRight. |
|
2813 |
hasEmphasis ifTrue:[ |
|
2814 |
posRight := (lineString copyFrom:1 to:runCol) widthOn:self. |
|
2815 |
] ifFalse:[ |
|
2816 |
posRight := gc font widthOf:lineString from:1 to:runCol |
|
2817 |
] |
|
2818 |
] ifFalse:[ |
|
2819 |
(posLeft > xRel) ifTrue:[ |
|
2820 |
runCol := runCol - 1. |
|
2821 |
(runCol == 0) ifTrue:[^ 0]. |
|
2822 |
posRight := posLeft. |
|
2823 |
hasEmphasis ifTrue:[ |
|
2824 |
posLeft := (lineString copyFrom:1 to:(runCol - 1)) widthOn:self. |
|
2825 |
] ifFalse:[ |
|
2826 |
posLeft := gc font widthOf:lineString from:1 to:(runCol - 1) |
|
2827 |
] |
|
2828 |
] |
|
2829 |
]. |
|
2830 |
done := (posLeft <= xRel) and:[posRight > xRel]. |
|
1775 | 2831 |
"234567890123456789012345678901234567890" |
5793 | 2832 |
((oPosRight == posRight) and:[oPosLeft == posLeft]) ifTrue:[ |
2833 |
"/ paranoia: just in case there are unprintable characters |
|
2834 |
"/ (avoid endless loop if the binary search does not make progress) |
|
2835 |
done := true. |
|
2836 |
] |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2837 |
]. |
1777 | 2838 |
"/self paint:Color red. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
2839 |
"/self displayRectangleX:posLeft+textStartLeft-viewOrigin x y:(self yOfVisibleLine:visLineNr) |
1777 | 2840 |
"/ width:(posRight-posLeft) height:fontHeight. |
5793 | 2841 |
"/self paint:self blackColor. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2842 |
^ runCol |
650
563ea7f99aa8
handle emphasized text in #colOfX...
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
2843 |
|
4245
4c62eadf9898
changed: #colOfX:inVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
4203
diff
changeset
|
2844 |
"Modified: / 25-04-2011 / 11:26:58 / cg" |
4247 | 2845 |
"Modified: / 02-05-2011 / 14:08:54 / sr" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2846 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2847 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2848 |
computeNumberOfLinesShown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2849 |
"recompute the number of visible lines" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2850 |
|
716
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2851 |
|innerHeight| |
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2852 |
|
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2853 |
innerHeight := self innerHeight. |
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2854 |
nFullLinesShown := (innerHeight + lineSpacing) // fontHeight. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2855 |
nLinesShown := nFullLinesShown. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2856 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2857 |
partialLines ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2858 |
((nLinesShown * fontHeight) < innerHeight) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2859 |
nLinesShown := nLinesShown + 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2860 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2861 |
] |
716
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2862 |
|
366fca254239
fixed number-of-lines computation
Claus Gittinger <cg@exept.de>
parents:
691
diff
changeset
|
2863 |
"Modified: 29.5.1996 / 14:48:43 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2864 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2865 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2866 |
convertRTF:aList |
3844 | 2867 |
<resource: #obsolete> |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2868 |
"this is a q&d RTF to poor-text converter which removes any rich stuff. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2869 |
- a first shot 'til DocumentView is finished ..." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2870 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2871 |
|newList newLine charIndex inEscape char special| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2872 |
|
652 | 2873 |
self obsoleteMethodWarning. |
2874 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2875 |
newList := StringCollection new:200. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2876 |
newList grow:0. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2877 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2878 |
newLine := ''. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2879 |
aList do:[:line | |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2880 |
((line size == 0) or:[line isBlank]) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2881 |
newList add:newLine. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2882 |
newLine := '' |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2883 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2884 |
special := ((line at:1) == ${) or:[(line includes:$\)]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2885 |
special := special or:[(line at:1) == $}]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2886 |
special ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2887 |
newList add:(newLine , line) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2888 |
] ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2889 |
charIndex := 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2890 |
[charIndex <= line size] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2891 |
char := line at:charIndex. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2892 |
((char == ${ ) or:[char == $} ]) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2893 |
"left-brace: ignore rest of line" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2894 |
charIndex := line size + 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2895 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2896 |
(char == $\) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2897 |
inEscape := true |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2898 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2899 |
inEscape ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2900 |
(char == Character space) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2901 |
inEscape := false |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2902 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2903 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2904 |
newLine := newLine copyWith:char |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2905 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2906 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2907 |
charIndex := charIndex + 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2908 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2909 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2910 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
2911 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2912 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2913 |
^ newList |
652 | 2914 |
|
2915 |
"Modified: 18.5.1996 / 14:03:16 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2916 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2917 |
|
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2918 |
enqueueDelayedContentsChangedNotification |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2919 |
"because contentschanged may be slow (recomputing width of widest line), |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2920 |
we delay its execution by pushing it onto the event queue. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2921 |
This has the effect of allowing for multiple add-lines before recomputing. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2922 |
Much speeding up inserting into long lists" |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2923 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2924 |
|sensor| |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2925 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2926 |
sensor := self sensor. |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2927 |
(sensor hasUserEvent:#contentsChanged for:self) ifFalse:[ |
6158 | 2928 |
sensor pushUserEvent:#contentsChanged for:self |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2929 |
]. |
6158 | 2930 |
"/ used to be synchronous: |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2931 |
"/ self contentsChanged. "recompute scrollbars" |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2932 |
|
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2933 |
"Created: / 25-07-2012 / 11:59:58 / cg" |
6158 | 2934 |
"Modified (comment): / 22-05-2017 / 12:07:37 / mawalch" |
4435
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2935 |
! |
3cacb6eddf23
added: #enqueueDelayedContentsChangedNotification
Claus Gittinger <cg@exept.de>
parents:
4422
diff
changeset
|
2936 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2937 |
getFontParameters |
668
729295eb37fc
use fonts averageHeight for line-grid; redefine in TextView to use maxHeight
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2938 |
"get some info of the used font. They are cached since we use them often .. |
5721 | 2939 |
The code below uses the font's average height parameters - these |
668
729295eb37fc
use fonts averageHeight for line-grid; redefine in TextView to use maxHeight
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2940 |
are not OK for some oversized national characters (such as A-dieresis). |
729295eb37fc
use fonts averageHeight for line-grid; redefine in TextView to use maxHeight
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2941 |
Therefore, this method should be redefined in views which will be used |
729295eb37fc
use fonts averageHeight for line-grid; redefine in TextView to use maxHeight
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2942 |
with national characters (i.e. editTextViews)." |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2943 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2944 |
|hMax newDeviceFont| |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2945 |
|
5818 | 2946 |
newDeviceFont := gc deviceFont. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2947 |
hMax := newDeviceFont height. |
1451
3598c65cd89d
search max height, if non-strings are present
Claus Gittinger <cg@exept.de>
parents:
1450
diff
changeset
|
2948 |
|
634
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2949 |
includesNonStrings == true ifTrue:[ |
5818 | 2950 |
"/ |
2951 |
"/ find maximum height of lines |
|
2952 |
"/ |
|
2953 |
hMax := list inject:hMax into:[:maxSoFar :thisLine | |
|
2954 |
thisLine isNil ifTrue:[ |
|
2955 |
maxSoFar |
|
2956 |
] ifFalse:[ |
|
2957 |
(thisLine isSingleByteString) ifTrue:[ |
|
2958 |
maxSoFar |
|
2959 |
] ifFalse:[ |
|
2960 |
maxSoFar max:(thisLine heightOn:self) |
|
2961 |
] |
|
2962 |
] |
|
2963 |
]. |
|
1451
3598c65cd89d
search max height, if non-strings are present
Claus Gittinger <cg@exept.de>
parents:
1450
diff
changeset
|
2964 |
|
634
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2965 |
]. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2966 |
fontHeight := newDeviceFont maxHeight. |
4573 | 2967 |
"/ fontHeight := font height. |
2968 |
fontHeight := fontHeight max:(hMax + lineSpacing). |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2969 |
fontAscent := newDeviceFont ascent. "/ maxAscent. -- see SelectionInListViews selection in motif style |
4573 | 2970 |
"/ fontAscent := font maxAscent "ascent". "/ maxAscent. -- see SelectionInListViews selection in motif style |
2971 |
"/ fontAscent := (font maxAscent + font ascent) // 2. "/ maxAscent. -- see SelectionInListViews selection in motif style |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2972 |
fontWidth := newDeviceFont width. |
5928 | 2973 |
fontWidth == 0 ifTrue:[ |
2974 |
"/ should not happen, but some bad fonts seem to have it |
|
2975 |
('ListView [info]: font says, it has zero width: ', newDeviceFont printString) infoPrintCR. |
|
2976 |
fontWidth := 1. |
|
2977 |
]. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
2978 |
fontIsFixedWidth := newDeviceFont isFixedWidth. |
634
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2979 |
|
1260
5a548d4c6724
handle nil entry in #getFontParameters
Claus Gittinger <cg@exept.de>
parents:
1259
diff
changeset
|
2980 |
"Modified: 3.7.1997 / 12:24:25 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2981 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2982 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
2983 |
getListFromModel |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2984 |
"ask my model (if any) for the text via the listMsg. |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2985 |
If there is no listMessage, try aspect for backward compatibility." |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2986 |
|
5031 | 2987 |
|newText msg doCompareIfUnchanged| |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2988 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2989 |
model notNil ifTrue:[ |
5884 | 2990 |
msg := listMsg ? aspectMsg. |
2991 |
||
2992 |
msg notNil ifTrue:[ |
|
2993 |
doCompareIfUnchanged := compareModelOnUpdate. |
|
2994 |
||
2995 |
newText := model perform:msg. |
|
2996 |
"/ cg: this makes many optimizations (virtualArray) useless; |
|
2997 |
"/ I do not think that this is a good idea: |
|
2998 |
"/ text notNil ifTrue:[ |
|
2999 |
"/ so I changed it to: |
|
3000 |
(newText notNil and:[newText isString]) ifTrue:[ |
|
3001 |
newText := newText asStringCollection. |
|
3002 |
] ifFalse:[ |
|
3003 |
newText == model ifTrue:[ |
|
3004 |
self isReadOnly ifTrue:[ |
|
3005 |
newText := model. |
|
3006 |
self list:newText expandTabs:expandTabsWhenUpdating scanForNonStrings:expandTabsWhenUpdating. |
|
3007 |
^ self. |
|
3008 |
] . |
|
3009 |
"/ I must operate on a copy |
|
3010 |
newText := model asNewOrderedCollection. |
|
3011 |
"/ doCompareIfUnchanged := false. |
|
3012 |
]. |
|
3013 |
]. |
|
3014 |
||
3015 |
doCompareIfUnchanged ifTrue:[ |
|
3016 |
"/ see if there is a change at all. |
|
3017 |
"/ use to compare using =, but that's not enough in case of emphasis change. |
|
3018 |
newText size == list size ifTrue:[ |
|
3019 |
|same| |
|
3020 |
||
3021 |
same := true. |
|
3022 |
newText size > 0 ifTrue:[ |
|
3023 |
newText ~~ list ifTrue:[ |
|
3024 |
newText with:list do:[:eachNewLine :eachOldLine | |
|
3025 |
(eachNewLine == eachOldLine) ifFalse:[ |
|
3026 |
same := false. |
|
3027 |
] |
|
3028 |
] |
|
3029 |
]. |
|
3030 |
]. |
|
3031 |
same ifTrue:[^ self]. |
|
3032 |
]. |
|
3033 |
]. |
|
3034 |
||
3035 |
"/ SV: this compare does not work, if model uses (i.e. updates) |
|
3036 |
"/ the same stringCollection as the view!! |
|
3037 |
true "text ~= list" ifTrue:[ |
|
3038 |
"/ changed #list to care for scrollLocked |
|
4747 | 3039 |
"/ scrollLocked ifTrue:[ |
3040 |
"/ self setList:newText expandTabs:expandTabsWhenUpdating |
|
3041 |
"/ ] ifFalse:[ |
|
5884 | 3042 |
self list:newText expandTabs:expandTabsWhenUpdating scanForNonStrings:expandTabsWhenUpdating |
4747 | 3043 |
"/ ] |
5884 | 3044 |
]. |
3045 |
]. |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3046 |
]. |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3047 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3048 |
"Modified: 26.4.1996 / 14:09:42 / cg" |
1027
fe7279540aa5
Fix getListFromModel when model updates the stringCollection
Stefan Vogel <sv@exept.de>
parents:
993
diff
changeset
|
3049 |
"Modified: 19.2.1997 / 12:08:50 / stefan" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3050 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3051 |
|
1099
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
3052 |
getListFromModelScroll:aBoolean |
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
3053 |
"ask my model (if any) for the text via the listMsg. |
3249
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3054 |
If there is no listMessage, try aspect for backward compatibility. |
4747 | 3055 |
If aBoolean is false, scrolling is suppressed here" |
3249
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3056 |
|
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3057 |
|prev| |
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3058 |
|
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3059 |
prev := scrollLocked. |
4747 | 3060 |
scrollLocked := aBoolean not. |
3249
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3061 |
[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3062 |
self getListFromModel |
3249
a4beb76b3f59
code formatting is now undoable
Claus Gittinger <cg@exept.de>
parents:
3198
diff
changeset
|
3063 |
] ensure:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3064 |
scrollLocked := prev. |
1099
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
3065 |
]. |
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
3066 |
! |
eccab3759ddb
in setList: - only redraw lines if required.
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
3067 |
|
5372 | 3068 |
highlightLineSpacing |
3069 |
"true if the spacing between lines is to be drawn with selected color, |
|
3070 |
false if it remains white. |
|
3071 |
false for selection in list views; true for edit/text views" |
|
3072 |
||
3073 |
^ true |
|
3074 |
! |
|
3075 |
||
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3076 |
line:line withoutEmphasis:emphasisToRemove |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3077 |
(line notNil |
2558
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
3078 |
and:[line isString]) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3079 |
^ line withoutEmphasis:emphasisToRemove. |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3080 |
]. |
2558
4c10bec1117d
more selection fixes (with non-string/non-text lines)
Michael Beyl <mb@exept.de>
parents:
2557
diff
changeset
|
3081 |
^ line |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3082 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3083 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3084 |
listAt:lineNr from:startCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3085 |
"return right substring from startCol to end of a line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3086 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3087 |
|line| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3088 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3089 |
line := self listAt:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3090 |
line isNil ifTrue:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3091 |
(startCol > line size) ifTrue:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3092 |
^ line copyFrom:startCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3093 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3094 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3095 |
listAt:lineNr from:startCol to:endCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3096 |
"return substring from startCol to endCol of a line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3097 |
|
4638 | 3098 |
|line lineLen nCols| |
3099 |
||
3100 |
nCols := (endCol - startCol + 1). |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3101 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3102 |
line := self listAt:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3103 |
lineLen := line size. |
4638 | 3104 |
|
3105 |
(line isNil or:[startCol > lineLen]) ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3106 |
(nCols > 0) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3107 |
^ (String new:nCols) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3108 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3109 |
^ nil |
4638 | 3110 |
]. |
3111 |
||
3112 |
(endCol > lineLen) ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3113 |
^ (line copyFrom:startCol to:lineLen) , (String new:(endCol-lineLen)) |
4638 | 3114 |
]. |
3115 |
^ line copyFrom:startCol to:endCol |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3116 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3117 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3118 |
listAt:lineNr to:endCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3119 |
"return left substring from start to endCol of a line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3120 |
|
4639 | 3121 |
|line lineSize| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3122 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3123 |
line := self listAt:lineNr. |
4638 | 3124 |
line isNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3125 |
(endCol > 0) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3126 |
^ (String new:endCol) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3127 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3128 |
^ nil |
4638 | 3129 |
]. |
3130 |
||
3131 |
lineSize := line size. |
|
4639 | 3132 |
|
3133 |
(endCol > lineSize) ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3134 |
^ (line copyTo:lineSize) , (String new:(endCol - lineSize)). |
4638 | 3135 |
]. |
4639 | 3136 |
^ line copyTo:endCol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3137 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3138 |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3139 |
listLineIsVisible:listLineNr |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3140 |
"return true, if a particular line is visible" |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3141 |
|
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3142 |
|visibleLineNr "{ Class: SmallInteger }"| |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3143 |
|
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3144 |
shown ifFalse:[^ false]. |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3145 |
listLineNr isNil ifTrue:[^ false]. |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3146 |
visibleLineNr := listLineNr + 1 - firstLineShown. |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3147 |
^ (visibleLineNr between:1 and:nLinesShown) |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3148 |
|
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3149 |
"Created: / 26.7.1998 / 13:24:16 / cg" |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3150 |
! |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3151 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3152 |
listLineToVisibleLine:listLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3153 |
"given a list line (1..) return visible linenr or nil" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3154 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3155 |
|visibleLineNr "{ Class: SmallInteger }"| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3156 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3157 |
shown ifFalse:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3158 |
listLineNr isNil ifTrue:[^ nil]. |
2423
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
3159 |
visibleLineNr := listLineNr - firstLineShown + 1. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3160 |
(visibleLineNr between:1 and:nLinesShown) ifFalse:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3161 |
^ visibleLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3162 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3163 |
|
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3164 |
recomputeWidthOfWidestLineFor:aString |
4751 | 3165 |
<resource: #obsolete> |
3166 |
self recomputeWidthOfWidestLineFor:aString old:nil |
|
3167 |
! |
|
3168 |
||
3169 |
recomputeWidthOfWidestLineFor:newEntry old:oldEntry |
|
3170 |
"a new line was added (oldEntry == nil) or replaced oldEntry. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3171 |
Update the widthOfWidestLine cache or flush it, if we cannot easily |
4751 | 3172 |
figure out the overall text width" |
3173 |
||
3174 |
|newW oldW| |
|
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3175 |
|
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3176 |
widthOfWidestLine notNil ifTrue:[ |
6293 | 3177 |
newEntry isNil ifTrue:[ |
3178 |
newW := 0 |
|
3179 |
] ifFalse:[ |
|
3180 |
(newEntry isSingleByteString) ifTrue:[ |
|
3181 |
newW := gc font widthOf:newEntry |
|
3182 |
] ifFalse:[ |
|
3183 |
newW := newEntry widthOn:self |
|
3184 |
]. |
|
3185 |
]. |
|
3186 |
||
3187 |
newW >= widthOfWidestLine ifTrue:[ |
|
3188 |
widthOfWidestLine := newW. |
|
3189 |
] ifFalse:[ |
|
3190 |
oldEntry isNil ifTrue:[ |
|
3191 |
oldW := 0 |
|
3192 |
] ifFalse:[ |
|
3193 |
(oldEntry isSingleByteString) ifTrue:[ |
|
3194 |
oldW := gc font widthOf:oldEntry |
|
3195 |
] ifFalse:[ |
|
3196 |
oldW := oldEntry widthOn:self |
|
3197 |
]. |
|
3198 |
]. |
|
3199 |
newW > oldW ifTrue:[ |
|
3200 |
"/ no change; new entries width is between this width and amx width |
|
3201 |
] ifFalse:[ |
|
3202 |
"/ new entry is smaller than oldEntry; if the oldEntry was the previous max, |
|
3203 |
"/ we don't know the new max |
|
3204 |
oldW = widthOfWidestLine ifTrue:[ |
|
3205 |
widthOfWidestLine := nil "/ means: unknown |
|
3206 |
] ifFalse:[ |
|
3207 |
"/ old line was not the widest, and new line is shorter; |
|
3208 |
"/ no change |
|
3209 |
] |
|
3210 |
] |
|
3211 |
]. |
|
2224
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3212 |
]. |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3213 |
^ widthOfWidestLine |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3214 |
! |
b060609f7c16
must recompute width of contents, if inserting/removing lines
Claus Gittinger <cg@exept.de>
parents:
2219
diff
changeset
|
3215 |
|
2225
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3216 |
suppressEmphasisInSelection |
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3217 |
"selection is shown with original emphasis" |
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3218 |
|
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3219 |
^ false |
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3220 |
! |
65ac7cbffc60
added suppressEmphasisInSelection handling
Claus Gittinger <cg@exept.de>
parents:
2224
diff
changeset
|
3221 |
|
2181 | 3222 |
textChanged |
3223 |
"ignored here" |
|
3224 |
! |
|
3225 |
||
5862 | 3226 |
updateWidthOfWidestLineFor:aLine |
3227 |
"when set to do this dynamically |
|
3228 |
(eg when checkedLinesForWidthOfContentsComputation == 0)" |
|
3229 |
||
3230 |
|w| |
|
3231 |
||
5884 | 3232 |
w := self widthOfLineString:aLine. |
3233 |
w > (widthOfWidestLine ? 0) ifTrue:[ |
|
5862 | 3234 |
widthOfWidestLine := w. |
3235 |
self contentsChanged. |
|
3236 |
]. |
|
3237 |
! |
|
3238 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3239 |
visibleAt:visibleLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3240 |
"return what is visible at line (numbers start at 1). |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3241 |
This is used for redrawing; i.e. for non-string entries, this |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3242 |
returns the original." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3243 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3244 |
|listLineNr listsize| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3245 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3246 |
listLineNr := visibleLineNr + firstLineShown - 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3247 |
(listLineNr == 0) ifTrue:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3248 |
(list notNil) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3249 |
listsize := self size |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3250 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3251 |
listsize := 0 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3252 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3253 |
(listLineNr <= listsize) ifTrue:[^ self at:listLineNr]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3254 |
^ '' |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3255 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3256 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3257 |
visibleLineOfY:y |
3818 | 3258 |
"given a y-coordinate, return the visible lineNr |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3259 |
- works for fix-height fonts only" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3260 |
|
1448
4220c80ab099
Do not reurn lineNumbers < 1 in #visibleLineOfY:
Stefan Vogel <sv@exept.de>
parents:
1433
diff
changeset
|
3261 |
^ (((y - textStartTop) // fontHeight) + 1) max:1 |
4220c80ab099
Do not reurn lineNumbers < 1 in #visibleLineOfY:
Stefan Vogel <sv@exept.de>
parents:
1433
diff
changeset
|
3262 |
|
4220c80ab099
Do not reurn lineNumbers < 1 in #visibleLineOfY:
Stefan Vogel <sv@exept.de>
parents:
1433
diff
changeset
|
3263 |
"Modified: / 13.2.1998 / 20:57:26 / stefan" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3264 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3265 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3266 |
visibleLineToAbsoluteLine:visibleLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3267 |
"given a visible line (1..) return absolut linenr" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3268 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3269 |
visibleLineNr isNil ifTrue:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3270 |
^ visibleLineNr + firstLineShown - 1 |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3271 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3272 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3273 |
visibleLineToListLine:visibleLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3274 |
"given a visible line (1..) return linenr in list or nil |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3275 |
(this one returns nil if the given visibleLineNr is one of the |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3276 |
separators)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3277 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3278 |
|listLineNr "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3279 |
listsize "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3280 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3281 |
visibleLineNr isNil ifTrue:[^ nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3282 |
listLineNr := visibleLineNr + firstLineShown - 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3283 |
(listLineNr == 0) ifTrue:[^nil]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3284 |
listsize := self size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3285 |
(listLineNr <= listsize) ifTrue:[^ listLineNr]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3286 |
^ nil |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3287 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3288 |
|
2559 | 3289 |
visibleStringFrom:aString |
3290 |
^ aString asString |
|
3291 |
! |
|
3292 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3293 |
widthForScrollBetween:firstLine and:lastLine |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3294 |
"return the width in pixels for a scroll between firstLine and lastLine. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3295 |
- used to optimize scrolling, by limiting the scrolled area. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3296 |
Subclasses with selections or other additional visible stuff should redefine |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3297 |
this method." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3298 |
|
957
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3299 |
^ innerWidth |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3300 |
|
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3301 |
"/ "for small width, its not worth searching for |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3302 |
"/ longest line ... |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3303 |
"/ " |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3304 |
"/ (width < 300) ifTrue:[^ innerWidth]. |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3305 |
"/ |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3306 |
"/ "for large lists, search may take longer than scrolling full |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3307 |
"/ " |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3308 |
"/ self size > 2000 ifTrue:[^ innerWidth]. |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3309 |
"/ |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3310 |
"/ " |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3311 |
"/ if there is a pattern-background, we have to scroll everything |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3312 |
"/ " |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3313 |
"/ (viewBackground isColor not |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3314 |
"/ or:[viewBackground isDithered]) ifTrue:[ |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3315 |
"/ ^ width |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3316 |
"/ ]. |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3317 |
"/ |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3318 |
"/ w := self widthOfWidestLineBetween:firstLine and:lastLine. |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3319 |
"/ (w > innerWidth) ifTrue:[^ innerWidth]. |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3320 |
"/ ^ w |
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3321 |
|
0d6a4d572aa2
oops - widthForScroll was wrong
Claus Gittinger <cg@exept.de>
parents:
954
diff
changeset
|
3322 |
"Modified: 17.1.1997 / 17:44:12 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3323 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3324 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3325 |
widthOfLineString:entry |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3326 |
"return the width of an entry" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3327 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3328 |
entry isNil ifTrue:[^ 0]. |
5111 | 3329 |
(entry isSingleByteString) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3330 |
^ gc font widthOf:entry |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3331 |
]. |
634
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3332 |
^ entry widthOn:self |
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3333 |
|
1ca770b2c494
handle items which are higher than the font (LabelAndIcons, for example)
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3334 |
"Modified: 12.5.1996 / 20:09:53 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3335 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3336 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3337 |
widthOfWidestLineBetween:firstLine and:lastLine |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3338 |
"return the width in pixels of the widest line in a range |
5480 | 3339 |
- used to optimize scrolling, by limiting the scrolled area; |
3340 |
not for scrollbar or other width related stuff which should be exact." |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3341 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3342 |
|max "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3343 |
first "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3344 |
last "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3345 |
thisLen "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3346 |
listSize "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3347 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3348 |
includesNonStrings ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3349 |
^ width |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3350 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3351 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3352 |
fontIsFixedWidth ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3353 |
^ (self lengthOfLongestLineBetween:firstLine and:lastLine) * fontWidth |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3354 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3355 |
listSize := self size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3356 |
max := 0. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3357 |
first := firstLine. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3358 |
last := lastLine. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3359 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3360 |
(first > listSize) ifTrue:[^ max]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3361 |
(last > listSize) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3362 |
last := listSize |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3363 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3364 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3365 |
self from:first to:last do:[:line | |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3366 |
line notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3367 |
(line isSingleByteString) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3368 |
thisLen := gc font widthOf:line |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3369 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3370 |
thisLen := line widthOn:self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3371 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3372 |
(thisLen > max) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3373 |
max := thisLen |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3374 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3375 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3376 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3377 |
^ max |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3378 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3379 |
|
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3380 |
withoutAnyColorEmphasis:line |
4046 | 3381 |
(line notNil and:[line isText]) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3382 |
^ line withoutAnyColorEmphasis |
4046 | 3383 |
]. |
3384 |
^ line |
|
3385 |
||
3386 |
" |
|
3387 |
'hello' asText colorizeAllWith:Color red. |
|
3388 |
('hello' asText colorizeAllWith:Color red) withoutForegroundColorEmphasis. |
|
4392 | 3389 |
('hello' asText colorizeAllWith:Color red) withoutAnyColorEmphasis. |
4046 | 3390 |
" |
4392 | 3391 |
|
3392 |
"Modified (comment): / 06-03-2012 / 18:16:41 / cg" |
|
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3393 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3394 |
|
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3395 |
withoutBackgroundColorEmphasis:line |
4046 | 3396 |
(line notNil and:[line isText]) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3397 |
^ line withoutBackgroundColorEmphasis |
4046 | 3398 |
]. |
3399 |
^ line |
|
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3400 |
! |
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3401 |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3402 |
withoutColorEmphasis:line |
4046 | 3403 |
(line notNil and:[line isText]) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3404 |
^ line withoutForegroundColorEmphasis |
4046 | 3405 |
]. |
3406 |
^ line |
|
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3407 |
! |
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3408 |
|
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3409 |
withoutColorEmphasis:line ifFg:fg andBg:bg |
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3410 |
"/ remove lines color emphasis, to enforce color. |
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3411 |
"/ otherwise blue text is not visible if selection-bg is blue |
4046 | 3412 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3413 |
(line notNil |
4046 | 3414 |
and:[line isText |
3415 |
and:[fg ~= fgColor or:[bg ~= bgColor]]]) ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3416 |
^ line withoutAnyColorEmphasis |
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3417 |
]. |
2557
dabeb8404df8
selecting colored Text: draw correctly in selection-colors
Claus Gittinger <cg@exept.de>
parents:
2513
diff
changeset
|
3418 |
^ line |
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3419 |
|
4392 | 3420 |
"Created: / 15-12-1999 / 23:19:30 / cg" |
2090
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3421 |
! |
85c0dd8a4281
selection over colored text - again
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
3422 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3423 |
xOfCol:col inVisibleLine:visLineNr |
2209 | 3424 |
"given a visible line- and colNr, return the x-coordinate in view" |
3425 |
||
3426 |
|line lineSize tcol lText| |
|
3427 |
||
3428 |
col == 1 ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3429 |
lText := 0 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3430 |
] ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3431 |
tcol := col - 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3432 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3433 |
line := self visibleAt:visLineNr. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3434 |
(fontIsFixedWidth |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3435 |
and:[line isNil or:[line isSingleByteString]]) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3436 |
ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3437 |
lText := (tcol * fontWidth) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3438 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3439 |
line notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3440 |
lineSize := line string size |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3441 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3442 |
lineSize := 0 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3443 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3444 |
(lineSize == 0) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3445 |
lText := (tcol * fontWidth) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3446 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3447 |
(lineSize < col) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3448 |
lText := (line widthOn:self) + (fontWidth * (tcol - lineSize)) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3449 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3450 |
(line isSingleByteString) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3451 |
lText := (gc font widthOf:line from:1 to:tcol) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3452 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3453 |
lText := line widthFrom:1 to:tcol on:self. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3454 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3455 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3456 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3457 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3458 |
]. |
2209 | 3459 |
^ lText + textStartLeft |
670
8e381269591c
more fixes for non-string entries
Claus Gittinger <cg@exept.de>
parents:
668
diff
changeset
|
3460 |
|
1656
1202fbc95970
some fixes forvariable fonts on win32
Claus Gittinger <cg@exept.de>
parents:
1637
diff
changeset
|
3461 |
"Modified: / 3.9.1998 / 21:56:33 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3462 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3463 |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3464 |
yOfLine:lineNr |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3465 |
"given a physical lineNr, return y-coordinate in view |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3466 |
- works for fix-height fonts only" |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3467 |
|
4641 | 3468 |
|visLine| |
3469 |
||
3470 |
visLine := self listLineToVisibleLine:lineNr. |
|
3471 |
visLine isNil ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3472 |
^ nil |
4641 | 3473 |
]. |
3474 |
^ self yOfVisibleLine:visLine |
|
1608
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3475 |
|
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3476 |
"Created: / 26.7.1998 / 13:23:16 / cg" |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3477 |
! |
ce06a6553af1
fixed redraw after a change of the item size
Claus Gittinger <cg@exept.de>
parents:
1582
diff
changeset
|
3478 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3479 |
yOfVisibleLine:visLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3480 |
"given a visible lineNr, return y-coordinate in view |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3481 |
- works for fix-height fonts only" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3482 |
|
3819 | 3483 |
"/ care for visLineNr being nil during initialization |
3484 |
^ (((visLineNr ? 1) - 1) * fontHeight) + textStartTop |
|
3398
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3485 |
! |
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3486 |
|
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3487 |
yVisibleToLineNr:yVisible |
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3488 |
|vL| |
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3489 |
|
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3490 |
vL := self visibleLineOfY:yVisible. |
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3491 |
^ self visibleLineToListLine:vL |
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3492 |
|
d5c915fe3d92
oops - ListModelView protocol
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
3493 |
"Created: / 20-09-2006 / 15:29:12 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3494 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3495 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3496 |
!ListView methodsFor:'queries'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3497 |
|
4303 | 3498 |
characterPositionOfLine:lineNr col:colArg |
2812 | 3499 |
"given a line/col position, return the character index within the contents-string, |
4468
6d711c19c529
comment/format in: #characterPositionOfLine:col:
Claus Gittinger <cg@exept.de>
parents:
4463
diff
changeset
|
3500 |
- used with compiler's error-positioning, which is based on character positions |
2812 | 3501 |
of the contents-string." |
3502 |
||
4468
6d711c19c529
comment/format in: #characterPositionOfLine:col:
Claus Gittinger <cg@exept.de>
parents:
4463
diff
changeset
|
3503 |
|lineString charPos lineEndCharSize col| |
3314 | 3504 |
|
3854 | 3505 |
lineEndCharSize := self lineEndCRLF ifTrue:[2] ifFalse:[1]. |
2812 | 3506 |
|
3507 |
self checkForExistingLine:lineNr. |
|
4468
6d711c19c529
comment/format in: #characterPositionOfLine:col:
Claus Gittinger <cg@exept.de>
parents:
4463
diff
changeset
|
3508 |
charPos := 1. |
2812 | 3509 |
1 to:(lineNr - 1) do:[:lnr | |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3510 |
lineString := self at:lnr. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3511 |
lineString notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3512 |
charPos := charPos + (lineString string) size |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3513 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3514 |
charPos := charPos + lineEndCharSize "the return-character" |
2812 | 3515 |
]. |
4303 | 3516 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3517 |
"/ NEW: expand that line, so that characterAtCharacterPosition returns the correct character |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3518 |
"/ wrong: will modify!! |
5691 | 3519 |
"/ (lineString := self at:lineNr) size < colArg ifTrue:[ |
3520 |
"/ "/ expand this line |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3521 |
"/ self at:lineNr put:((lineString ? ''),(String new:colArg-lineString size)). |
5691 | 3522 |
"/ ]. |
3523 |
||
3524 |
"/ OLD: if beyond end of line, be careful to not advance into next line. |
|
4759 | 3525 |
"/ otherwise, syntaxHighlighter (and others) walk into trouble, |
3526 |
"/ if clicked on a space beyond a line's end. |
|
3527 |
col := colArg min:((self at:lineNr) size + 1). |
|
4468
6d711c19c529
comment/format in: #characterPositionOfLine:col:
Claus Gittinger <cg@exept.de>
parents:
4463
diff
changeset
|
3528 |
^ charPos + col - 1 |
3314 | 3529 |
|
3530 |
"Modified: / 04-07-2006 / 19:14:25 / fm" |
|
5691 | 3531 |
"Modified: / 01-05-2016 / 15:48:24 / cg" |
2812 | 3532 |
! |
3533 |
||
3534 |
colOfCharacterPosition:charPos |
|
3535 |
"given a character index within the contents-string, |
|
3536 |
return the column number where the character is |
|
3537 |
- used to find line to hilight from Compilers error-position" |
|
3538 |
||
3539 |
|line| |
|
3540 |
||
3541 |
line := self lineOfCharacterPosition:charPos. |
|
3542 |
^ charPos - (self characterPositionOfLine:line col:1) + 1. |
|
3543 |
||
3544 |
! |
|
3545 |
||
1525
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3546 |
currentLine |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3547 |
"the current line (for relative gotos); |
1525
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3548 |
since listViews have no cursor, the first shown line is returned here. |
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3549 |
Redefined in editTextView, to return the cursors line." |
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3550 |
|
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3551 |
^ firstLineShown |
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3552 |
|
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3553 |
"Created: / 17.5.1998 / 20:07:36 / cg" |
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3554 |
! |
6079f38d5e89
added #currentLine (req'd for relative gotos)
Claus Gittinger <cg@exept.de>
parents:
1497
diff
changeset
|
3555 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3556 |
firstLineShown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3557 |
"return the index of the first (possibly partial) visible line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3558 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3559 |
^ firstLineShown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3560 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3561 |
|
311
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3562 |
heightForLines:numberOfLines |
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3563 |
"return the height of the receiver, if numberOfLines are to be displayed" |
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3564 |
|
5818 | 3565 |
^ numberOfLines * fontHeight + topMargin + gc deviceFont descent + lineSpacing + (margin * 2) |
311
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3566 |
|
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3567 |
"Created: 27.1.1996 / 16:55:39 / cg" |
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3568 |
! |
cddf10b2207e
added query for height with n lines
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
3569 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3570 |
heightOfContents |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3571 |
"return the height of the contents in pixels |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3572 |
- used for scrollbar interface" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3573 |
|
5818 | 3574 |
|numLines| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3575 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3576 |
numLines := self numberOfLines. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3577 |
numLines == 0 ifTrue:[^ 0]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3578 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3579 |
"/ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3580 |
"/ kludge for last partial line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3581 |
"/ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3582 |
"/ nFullLinesShown ~~ nLinesShown ifTrue:[ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3583 |
"/ numLines := numLines + 1 |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3584 |
"/ ]. |
5947 | 3585 |
^ numLines * fontHeight "don't take font height here - think of LabelAndIcons" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3586 |
"/ + textStartTop |
5585 | 3587 |
- (lineSpacing // 2) |
5818 | 3588 |
+ (gc deviceFont descent) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3589 |
"/ + (font descent * 2) "makes it look better" |
5585 | 3590 |
. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3591 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3592 |
"/ "it used to be that code - which is wrong" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3593 |
"/ (nLinesShown == nFullLinesShown) ifTrue:[ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3594 |
"/ ^ numLines * fontHeight |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3595 |
"/ ]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3596 |
"/ "add one - otherwise we cannot make last line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3597 |
"/ fully visible since scrolling is done by full lines only" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3598 |
"/ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3599 |
"/ ^ (numLines + 1) * fontHeight |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3600 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3601 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3602 |
lastLineShown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3603 |
"return the index of the last (possibly partial) visible line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3604 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3605 |
^ firstLineShown + nLinesShown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3606 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3607 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3608 |
leftIndentOfLine:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3609 |
"return the number of spaces at the left in line, lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3610 |
returns 0 for empty lines." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3611 |
|
566 | 3612 |
|lineString indent| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3613 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3614 |
lineString := self listAt:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3615 |
lineString notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3616 |
indent := lineString leftIndent. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3617 |
indent == lineString size ifTrue:[^ 0]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3618 |
^ indent. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3619 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3620 |
^ 0 |
566 | 3621 |
|
3622 |
"Modified: 20.4.1996 / 19:30:38 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3623 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3624 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3625 |
lengthOfLongestLine |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3626 |
"return the length (in characters) of the longest line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3627 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3628 |
^ self lengthOfLongestLineBetween:1 and:self size |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3629 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3630 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3631 |
lengthOfLongestLineBetween:firstLine and:lastLine |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3632 |
"return the length (in characters) of the longest line in a line-range" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3633 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3634 |
|max "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3635 |
thisLen "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3636 |
listSize "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3637 |
first "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3638 |
last "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3639 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3640 |
list isNil ifTrue:[^ 0]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3641 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3642 |
listSize := self size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3643 |
max := 0. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3644 |
first := firstLine. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3645 |
last := lastLine. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3646 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3647 |
(first > listSize) ifTrue:[^ max]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3648 |
(last > listSize) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3649 |
last := listSize |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3650 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3651 |
self from:first to:last do:[:lineString | |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3652 |
lineString notNil ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3653 |
thisLen := lineString size. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3654 |
(thisLen > max) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3655 |
max := thisLen |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3656 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3657 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3658 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3659 |
^ max |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3660 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3661 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3662 |
|
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3663 |
lineIsFullyVisible:line |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3664 |
"is line fully visible?" |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3665 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3666 |
(line >= firstLineShown |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3667 |
and:[ line < (firstLineShown + nFullLinesShown) ]) ifTrue:[ ^ true ]. |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3668 |
^ false. |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3669 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3670 |
"Created: 26.4.1996 / 14:36:45 / cg" |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3671 |
! |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
3672 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3673 |
lineIsVisible:line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3674 |
"is line visible?" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3675 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3676 |
(line >= firstLineShown and:[ line < (firstLineShown + nLinesShown) ]) ifTrue:[ ^ true ]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3677 |
^ false. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3678 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3679 |
|
2812 | 3680 |
lineOfCharacterPosition:charPos |
3681 |
"given a character index within the contents-string, |
|
3682 |
return the lineNumber where the character is |
|
4448
2e4bb12f298c
changed: #lineOfCharacterPosition:
Claus Gittinger <cg@exept.de>
parents:
4444
diff
changeset
|
3683 |
- used to find line to hilight from compiler's error-position" |
2812 | 3684 |
|
4303 | 3685 |
|lineNr sum lastLine lineEndCharSize l| |
3314 | 3686 |
|
4280
61a16b0a99d5
changed: #lineOfCharacterPosition:
Claus Gittinger <cg@exept.de>
parents:
4247
diff
changeset
|
3687 |
lineEndCharSize := self lineEndCRLF ifTrue:[2] ifFalse:[1]. |
2812 | 3688 |
|
3689 |
lineNr := 1. |
|
3690 |
sum := 0. |
|
3691 |
lastLine := self size. |
|
3692 |
[(sum < charPos) and:[lineNr <= lastLine]] whileTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3693 |
l := (self at:lineNr) ? ''. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3694 |
sum := sum + (l string "withoutTrailingSeparators" size) + lineEndCharSize. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3695 |
lineNr := lineNr + 1 |
2812 | 3696 |
]. |
3697 |
sum == charPos ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3698 |
^ lineNr |
2812 | 3699 |
]. |
3700 |
||
4448
2e4bb12f298c
changed: #lineOfCharacterPosition:
Claus Gittinger <cg@exept.de>
parents:
4444
diff
changeset
|
3701 |
^ (lineNr - 1) max:1 |
2812 | 3702 |
|
3314 | 3703 |
"Modified: / 04-07-2006 / 19:13:32 / fm" |
4303 | 3704 |
"Modified: / 21-08-2011 / 10:50:12 / cg" |
2812 | 3705 |
! |
3706 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3707 |
numberOfLines |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3708 |
"return the number of lines the text has" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3709 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3710 |
^ self size |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3711 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3712 |
|
4607 | 3713 |
preferredExtentForContents |
3714 |
^ (self widthOfContents @ self heightOfContents) |
|
3715 |
! |
|
3716 |
||
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
670
diff
changeset
|
3717 |
preferredExtentForLines:numLines cols:numCols |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3718 |
^ (((gc font widthOf:'x') * numCols + margin + margin) |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3719 |
@ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3720 |
(fontHeight * numLines + margin + margin + gc font descent + lineSpacing + topMargin)). |
688 | 3721 |
|
3722 |
"Modified: 26.5.1996 / 12:26:41 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
670
diff
changeset
|
3723 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
670
diff
changeset
|
3724 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3725 |
supportsSyntaxElements |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3726 |
"see CodeView2::TextView" |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3727 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3728 |
^ false |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3729 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
3730 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3731 |
widthOfContents |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3732 |
"return the width of the contents in pixels |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3733 |
- used for scrollbar interface" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3734 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3735 |
|font start "{ Class: SmallInteger }" |
4749 | 3736 |
stop "{ Class: SmallInteger }" |
3737 |
lengthOfLongestString "{ Class: SmallInteger }" |
|
3738 |
lengthOfLongestLine "{ Class: SmallInteger }" |
|
3739 |
max "{ Class: SmallInteger }"| |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3740 |
|
4752 | 3741 |
list isEmptyOrNil ifTrue:[^ 0]. |
4751 | 3742 |
widthOfWidestLine notNil ifTrue:[ |
3743 |
"/ already computed (cached); this cache is cleared when the contents is modified |
|
3744 |
^ widthOfWidestLine + (leftMargin * 2) |
|
3745 |
]. |
|
607
67462978fb20
fixed #widthOfContents if no device is known
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
3746 |
|
5818 | 3747 |
font := gc deviceFont. |
4751 | 3748 |
checkedLinesForWidthOfContentsComputation isNil ifTrue:[ |
3749 |
start := 1. |
|
3750 |
stop := list size |
|
3751 |
] ifFalse:[ |
|
5862 | 3752 |
checkedLinesForWidthOfContentsComputation == 0 ifTrue:[ |
3753 |
start := firstLineShown. |
|
5885 | 3754 |
stop := (start + nLinesShown - 1) min:list size. |
3755 |
] ifFalse:[ |
|
5862 | 3756 |
checkedLinesForWidthOfContentsComputation > 0 ifTrue:[ |
3757 |
start := 1. |
|
3758 |
stop := (checkedLinesForWidthOfContentsComputation min:list size) |
|
3759 |
] ifFalse:[ |
|
3760 |
stop := list size. |
|
3761 |
start := (list size + 1 + checkedLinesForWidthOfContentsComputation) max:1. |
|
3762 |
] |
|
4751 | 3763 |
] |
3764 |
]. |
|
4749 | 3765 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3766 |
includesNonStrings ifTrue:[ |
4749 | 3767 |
max := 0. |
3768 |
start to:stop do:[:lineNr | |
|
3769 |
|entry w| |
|
3770 |
||
3771 |
entry := list at:lineNr. |
|
3772 |
entry notNil ifTrue:[ |
|
5111 | 3773 |
(entry isSingleByteString) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
3774 |
w := font widthOf:entry |
4749 | 3775 |
] ifFalse:[ |
3776 |
w := entry widthOn:self |
|
3777 |
]. |
|
3778 |
max := max max:w. |
|
3779 |
]. |
|
3780 |
]. |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3781 |
] ifFalse:[ |
4522 | 3782 |
fontIsFixedWidth ifTrue:[ |
3783 |
max := lengthOfLongestString := 0. |
|
3784 |
list notNil ifTrue:[ |
|
4749 | 3785 |
start to:stop do:[:lineNr | |
3786 |
|line| |
|
3787 |
||
3788 |
line := list at:lineNr. |
|
4522 | 3789 |
line notNil ifTrue:[ |
5111 | 3790 |
(line isSingleByteString) ifTrue:[ |
4522 | 3791 |
line size > lengthOfLongestString ifTrue:[ |
3792 |
lengthOfLongestString := line size |
|
3793 |
]. |
|
3794 |
] ifFalse:[ |
|
3795 |
max := max max:(line widthOn:self) |
|
3796 |
] |
|
3797 |
] |
|
3798 |
]. |
|
3799 |
max := max max:(lengthOfLongestString * fontWidth) |
|
3800 |
]. |
|
3801 |
] ifFalse:[ |
|
4732 | 3802 |
max := lengthOfLongestLine := 0. |
3803 |
list notNil ifTrue:[ |
|
4749 | 3804 |
start to:stop do:[:lineNr | |
3805 |
|line len| |
|
3806 |
||
5090 | 3807 |
line := list at:lineNr ifAbsent:nil. |
4732 | 3808 |
line notNil ifTrue:[ |
3809 |
len := line size. |
|
3810 |
"/ consider this a speed hack (not exact, but fast) |
|
3811 |
lengthOfLongestLine := lengthOfLongestLine max:len. |
|
3812 |
len > (lengthOfLongestLine // 3) ifTrue:[ |
|
3813 |
max := max max:(line widthOn:self) |
|
3814 |
]. |
|
3815 |
] |
|
4522 | 3816 |
]. |
3817 |
]. |
|
3818 |
]. |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3819 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3820 |
widthOfWidestLine := max. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3821 |
^ max + (leftMargin * 2) |
607
67462978fb20
fixed #widthOfContents if no device is known
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
3822 |
|
1700
3538310c2724
fixed widthOfContents with variable fonts (win32);
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3823 |
"Modified: / 24.9.1998 / 18:21:08 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3824 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3825 |
|
1716 | 3826 |
widthOfLine:lineNr |
3827 |
"return the width of a line in pixels" |
|
3828 |
||
5818 | 3829 |
|line| |
1716 | 3830 |
|
3831 |
list isNil ifTrue:[^ 0]. |
|
3832 |
lineNr > list size ifTrue:[^ 0]. |
|
3833 |
line := list at:lineNr. |
|
5863 | 3834 |
line isNil ifTrue:[^ 0]. |
3835 |
^ self widthOfLineString:line |
|
1716 | 3836 |
|
3837 |
"Created: / 10.11.1998 / 23:59:20 / cg" |
|
3838 |
"Modified: / 11.11.1998 / 15:25:07 / cg" |
|
3839 |
! |
|
3840 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3841 |
xOriginOfContents |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3842 |
"return the horizontal origin of the contents in pixels |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3843 |
- used for scrollbar interface" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3844 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3845 |
^ viewOrigin x |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3846 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3847 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3848 |
yOriginOfContents |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3849 |
"return the vertical origin of the contents in pixels |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3850 |
- used for scrollbar interface" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3851 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3852 |
^ (firstLineShown - 1) * fontHeight |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3853 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3854 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3855 |
!ListView methodsFor:'redrawing'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3856 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3857 |
flash |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3858 |
"show contents in reverse colors for a moment - to wakeup the user :-)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3859 |
|
4987 | 3860 |
super flash. |
3861 |
"/ self redrawInverted. |
|
3862 |
"/ Delay waitForSeconds:0.1. |
|
3863 |
"/ self redraw |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3864 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3865 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3866 |
Transcript flash |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3867 |
Transcript redrawInverted |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3868 |
Transcript redraw |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3869 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3870 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3871 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3872 |
redraw |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3873 |
"redraw complete view" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3874 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3875 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3876 |
self redrawFromVisibleLine:1 to:nLinesShown |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3877 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3878 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3879 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3880 |
redrawFromLine:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3881 |
"redraw starting at linrNr" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3882 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3883 |
|visibleLine first| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3884 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3885 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3886 |
"if first line to redraw is above 1st visible line, |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3887 |
start redraw at 1st visible line" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3888 |
(lineNr < firstLineShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3889 |
first := firstLineShown |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3890 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3891 |
first := lineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3892 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3893 |
visibleLine := self listLineToVisibleLine:first. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3894 |
visibleLine notNil ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3895 |
self redrawFromVisibleLine:visibleLine to:nLinesShown |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3896 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3897 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3898 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3899 |
|
2605
4f8c7e50f217
added redrawFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2577
diff
changeset
|
3900 |
redrawFromLine:startLine col:startCol toLine:endLine col:endCol |
4f8c7e50f217
added redrawFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2577
diff
changeset
|
3901 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3902 |
self redrawLine:startLine from:startCol. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3903 |
endLine > (startLine+1) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3904 |
self redrawFromLine:startLine+1 to:endLine-1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3905 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3906 |
self redrawLine:endLine from:1 to:endCol. |
2605
4f8c7e50f217
added redrawFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2577
diff
changeset
|
3907 |
] |
4f8c7e50f217
added redrawFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2577
diff
changeset
|
3908 |
! |
4f8c7e50f217
added redrawFromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents:
2577
diff
changeset
|
3909 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3910 |
redrawFromLine:start to:end |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3911 |
"redraw lines from start to end" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3912 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3913 |
|visibleFirst visibleLast first last lastLineShown| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3914 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3915 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3916 |
lastLineShown := firstLineShown + nLinesShown - 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3917 |
(start <= lastLineShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3918 |
(end >= firstLineShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3919 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3920 |
"if first line to redraw is above 1st visible line, |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3921 |
start redraw at 1st visible line" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3922 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3923 |
(start < firstLineShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3924 |
first := firstLineShown |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3925 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3926 |
first := start |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3927 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3928 |
(end > lastLineShown) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3929 |
last := lastLineShown |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3930 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3931 |
last := end |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3932 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3933 |
visibleFirst := self listLineToVisibleLine:first. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3934 |
visibleLast := self listLineToVisibleLine:last. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3935 |
self redrawFromVisibleLine:visibleFirst to:visibleLast |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3936 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3937 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3938 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3939 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3940 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3941 |
redrawFromVisibleLine:startVisLineNr to:endVisLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3942 |
"redraw a visible line range" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3943 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3944 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3945 |
self drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fgColor and:bgColor |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3946 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3947 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3948 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3949 |
redrawInverted |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3950 |
"show contents in reverse colors" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3951 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3952 |
|savFg savBg| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3953 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3954 |
savFg := fgColor. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3955 |
savBg := bgColor. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3956 |
fgColor := savBg. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3957 |
bgColor := savFg. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3958 |
self redraw. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3959 |
fgColor := savFg. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3960 |
bgColor := savBg. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3961 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3962 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3963 |
redrawLine:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3964 |
"redraw a list line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3965 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3966 |
|visibleLine| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3967 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3968 |
visibleLine := self listLineToVisibleLine:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3969 |
visibleLine notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3970 |
self redrawVisibleLine:visibleLine |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3971 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3972 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3973 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3974 |
redrawLine:lineNr col:col |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3975 |
"redraw a single character" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3976 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3977 |
|visibleLine| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3978 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3979 |
visibleLine := self listLineToVisibleLine:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3980 |
visibleLine notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3981 |
self redrawVisibleLine:visibleLine col:col |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3982 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3983 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3984 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3985 |
redrawLine:lineNr from:startCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3986 |
"redraw a list line from startCol to end of line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3987 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3988 |
|visibleLine| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3989 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3990 |
visibleLine := self listLineToVisibleLine:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3991 |
visibleLine notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
3992 |
self redrawVisibleLine:visibleLine from:startCol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3993 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3994 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3995 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3996 |
redrawLine:lineNr from:startCol to:endCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3997 |
"redraw a list line from startCol to endCol" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3998 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
3999 |
|visibleLine| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4000 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4001 |
visibleLine := self listLineToVisibleLine:lineNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4002 |
visibleLine notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4003 |
self redrawVisibleLine:visibleLine from:startCol to:endCol |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4004 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4005 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4006 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4007 |
redrawVisibleLine:visLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4008 |
"redraw a visible line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4009 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4010 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4011 |
self drawVisibleLine:visLineNr with:fgColor and:bgColor |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4012 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4013 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4014 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4015 |
redrawVisibleLine:visLineNr col:col |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4016 |
"redraw single character at col index of visible line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4017 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4018 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4019 |
self drawVisibleLine:visLineNr col:col with:fgColor and:bgColor |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4020 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4021 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4022 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4023 |
redrawVisibleLine:visLineNr from:startCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4024 |
"redraw right part of a visible line from startCol to end of line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4025 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4026 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4027 |
self drawVisibleLine:visLineNr from:startCol with:fgColor and:bgColor |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4028 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4029 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4030 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4031 |
redrawVisibleLine:visLineNr from:startCol to:endCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4032 |
"redraw part of a visible line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4033 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4034 |
shown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4035 |
startCol == endCol ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4036 |
self redrawVisibleLine:visLineNr col:startCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4037 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4038 |
self drawVisibleLine:visLineNr from:startCol to:endCol with:fgColor and:bgColor |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4039 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4040 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4041 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4042 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4043 |
!ListView methodsFor:'scrolling'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4044 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4045 |
gotoLine:aLineNumber |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4046 |
"position to line aLineNumber; this may be redefined |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4047 |
in subclasses (for example to move the cursor also)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4048 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4049 |
^ self scrollToLine:aLineNumber |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4050 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4051 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4052 |
halfPageDown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4053 |
"scroll down half a page" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4054 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4055 |
self scrollDown:(nFullLinesShown // 2) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4056 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4057 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4058 |
halfPageUp |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4059 |
"scroll up half a page" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4060 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4061 |
self scrollUp:(nFullLinesShown // 2) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4062 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4063 |
|
1910
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4064 |
horizontalScrollStep |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4065 |
"return the amount to scroll when stepping up/down. |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4066 |
Here, the scrolling unit is characters." |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4067 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4068 |
^ gc font width |
1910
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4069 |
|
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4070 |
"Created: / 21.5.1999 / 15:55:06 / cg" |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4071 |
! |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4072 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4073 |
makeColVisible:aCol inLine:aLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4074 |
"if column aCol is not visible, scroll horizontal to make it visible" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4075 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4076 |
|xWant xVis visLnr| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4077 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4078 |
(aCol isNil or:[shown not]) ifTrue:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4079 |
|
2423
8b9c2946a5a7
absoluteLineToVisibleLine: -> listLineToVisibleLine:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
4080 |
visLnr := self listLineToVisibleLine:aLineNr. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4081 |
visLnr isNil ifTrue:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4082 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4083 |
xWant := self xOfCol:aCol inVisibleLine:visLnr. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4084 |
xVis := xWant - viewOrigin x. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4085 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4086 |
" |
5947 | 4087 |
don't scroll, if already visible |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4088 |
(but scroll, if not in inner 20%..80% of visible area) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4089 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4090 |
"/ ((xVis >= (width // 5)) and:[xVis <= (width * 4 // 5)]) ifTrue:[ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4091 |
"/ ^ self |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4092 |
"/ ]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4093 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4094 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4095 |
no, the above does not look good, if you click / select at the |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4096 |
far right - makes selecting so difficult ... |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4097 |
" |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4098 |
(xVis >= 0 and:[xVis < (width - gc font width)]) ifTrue:[^ self]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4099 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4100 |
self scrollHorizontalTo:(xWant - (width // 2)). |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4101 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4102 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4103 |
makeLineVisible:aListLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4104 |
"if aListLineNr is not visible, scroll to make it visible. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4105 |
Numbering starts with 1 for the very first line of the text." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4106 |
|
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4107 |
|bott newTopLine| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4108 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4109 |
(aListLineNr isNil "or:[shown not]") ifTrue:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4110 |
|
895
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4111 |
"/ Old code follows. It is no longer used, because: |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4112 |
"/ 1. we must maintain our viewOrigin (not maintained in this code!!) |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4113 |
"/ 2. we must inform our dependents about originChanges. |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4114 |
"/ |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4115 |
"/ shown ifFalse:[ |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4116 |
"/ firstLineShown := (aListLineNr - 1) max:1. |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4117 |
"/ firstLineShown > (list size - nFullLinesShown) ifTrue:[ |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4118 |
"/ firstLineShown := list size - nFullLinesShown |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4119 |
"/ ]. |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4120 |
"/ list size <= nFullLinesShown ifTrue:[ |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4121 |
"/ firstLineShown := 1 |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4122 |
"/ ]. |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4123 |
"/ ^ self |
02d8e324dca5
Fix #makeLineVisible: to update viewOrigin and dependents.
Stefan Vogel <sv@exept.de>
parents:
890
diff
changeset
|
4124 |
"/ ]. |
691
906e4d67b9cf
fixed makeLineVisible; when not-yet realized
Claus Gittinger <cg@exept.de>
parents:
688
diff
changeset
|
4125 |
|
2216 | 4126 |
(self needScrollToMakeLineVisible:aListLineNr) ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4127 |
^ self |
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4128 |
]. |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4129 |
|
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4130 |
(aListLineNr < nFullLinesShown) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4131 |
"/ at the very top of the list - show from top |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4132 |
newTopLine := 1 |
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4133 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4134 |
(nFullLinesShown < 3) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4135 |
"/ a small view - show from that line |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4136 |
newTopLine := aListLineNr |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4137 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4138 |
bott := self numberOfLines - (nFullLinesShown - 1). |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4139 |
(aListLineNr > bott) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4140 |
"/ at the end of the list - show the bottom of the list |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4141 |
newTopLine := bott |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4142 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4143 |
"/ somewhere else - place selected line into the middle of |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4144 |
"/ the view |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4145 |
newTopLine := (aListLineNr - (nFullLinesShown // 2) + 1) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4146 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4147 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4148 |
]. |
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4149 |
|
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4150 |
self scrollToLine:newTopLine. |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4151 |
|
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4152 |
"Modified: / 18.12.1996 / 17:48:22 / stefan" |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4153 |
"Modified: / 7.8.1998 / 15:14:12 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4154 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4155 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4156 |
makeVisible:someString |
6164 | 4157 |
"if necessary, scroll to make the (first) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4158 |
line containing someString visible." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4159 |
|
1808 | 4160 |
|index list| |
1319 | 4161 |
|
4162 |
(list := self list) notNil ifTrue:[ |
|
6164 | 4163 |
index := list indexOf:someString. |
4164 |
index ~~ 0 ifTrue:[ |
|
4165 |
self makeLineVisible:index |
|
4166 |
] |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4167 |
] |
1319 | 4168 |
|
6164 | 4169 |
"Modified: / 09-09-1997 / 10:10:13 / cg" |
4170 |
"Modified (comment): / 30-05-2017 / 17:34:32 / mawalch" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4171 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4172 |
|
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4173 |
needScrollToMakeLine:aListLineNr |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4174 |
"return true, if a scroll is needd to make a line visible. |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4175 |
Numbering starts with 1 for the very first line of the text." |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4176 |
|
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4177 |
(aListLineNr >= firstLineShown) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4178 |
(aListLineNr < (firstLineShown + nFullLinesShown)) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4179 |
^ false |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4180 |
] |
1637
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4181 |
]. |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4182 |
^ true |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4183 |
|
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4184 |
"Created: / 7.8.1998 / 15:13:51 / cg" |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4185 |
"Modified: / 7.8.1998 / 15:14:44 / cg" |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4186 |
! |
f40b75c349d7
allow redefinition of check-for-scroll needed in subclass.
Claus Gittinger <cg@exept.de>
parents:
1618
diff
changeset
|
4187 |
|
2216 | 4188 |
needScrollToMakeLineVisible:aListLineNr |
4189 |
"return true, if a scroll is needd to make a line visible. |
|
4190 |
Numbering starts with 1 for the very first line of the text." |
|
4191 |
||
4192 |
(aListLineNr >= firstLineShown) ifTrue:[ |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4193 |
(aListLineNr < (firstLineShown + nFullLinesShown)) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4194 |
^ false |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4195 |
] |
2216 | 4196 |
]. |
4197 |
^ true |
|
4198 |
||
4199 |
"Created: / 7.8.1998 / 15:13:51 / cg" |
|
4200 |
"Modified: / 7.8.1998 / 15:14:44 / cg" |
|
4201 |
! |
|
4202 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4203 |
pageDown |
4203 | 4204 |
"change origin to display the next page" |
4205 |
||
4201 | 4206 |
"/ self scrollTo:(viewOrigin + (0 @ height)) |
4203 | 4207 |
self scrollToLine:(self firstLineShown + nFullLinesShown) |
4208 |
||
4209 |
"Modified: / 15-12-2010 / 10:12:37 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4210 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4211 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4212 |
pageUp |
4203 | 4213 |
"change origin to display the previous page" |
4214 |
||
4201 | 4215 |
"/ self scrollTo:(viewOrigin - (0 @ height)) |
4203 | 4216 |
self scrollToLine:(self firstLineShown - nFullLinesShown) |
4217 |
||
4218 |
"Modified: / 15-12-2010 / 10:12:41 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4219 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4220 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4221 |
scrollDown:nLines |
394
795f293f8520
fixed debris-leftover in scrollDown
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
4222 |
"change origin to scroll down some lines (towards the bottom of the text)" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4223 |
|
1911 | 4224 |
nLines ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4225 |
self scrollTo:(viewOrigin + (0 @ (fontHeight * nLines))) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4226 |
redraw:true |
1468 | 4227 |
] |
4228 |
||
1911 | 4229 |
"Modified: / 21.5.1999 / 15:59:52 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4230 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4231 |
|
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4232 |
scrollDownPixels:pix |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4233 |
"change origin to scroll down some pixels |
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4234 |
(towards the bottom of the text) |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4235 |
THIS WILL VANISH!!" |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4236 |
|
1468 | 4237 |
pix > 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4238 |
self scrollTo:(viewOrigin + (0 @ (pix abs))) redraw:true |
1468 | 4239 |
] |
4240 |
||
4241 |
||
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4242 |
! |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4243 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4244 |
scrollHorizontalTo:aPixelOffset |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4245 |
"change origin to make aPixelOffset be the left col" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4246 |
|
1756 | 4247 |
|nPixel| |
4248 |
||
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4249 |
nPixel := aPixelOffset - viewOrigin x. |
1756 | 4250 |
nPixel ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4251 |
self scrollTo:(viewOrigin + (nPixel @ 0)) redraw:true |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4252 |
] |
1756 | 4253 |
|
4254 |
"Modified: / 3.3.1999 / 22:55:20 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4255 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4256 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4257 |
scrollLeft:nPixel |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4258 |
"change origin to scroll left some cols" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4259 |
|
1911 | 4260 |
nPixel ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4261 |
self scrollTo:(viewOrigin - (nPixel @ 0)) redraw:true |
1468 | 4262 |
] |
4263 |
||
1911 | 4264 |
"Modified: / 21.5.1999 / 15:59:16 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4265 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4266 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4267 |
scrollRight:nPixel |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4268 |
"change origin to scroll right some cols" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4269 |
|
1911 | 4270 |
nPixel ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4271 |
self scrollTo:(self viewOrigin + (nPixel @ 0)) redraw:true |
1468 | 4272 |
] |
4273 |
||
1911 | 4274 |
"Modified: / 21.5.1999 / 15:59:21 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4275 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4276 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4277 |
scrollSelectDown |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4278 |
"just a template - I do not know anything about selections" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4279 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4280 |
^ self subclassResponsibility |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4281 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4282 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4283 |
scrollSelectUp |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4284 |
"just a template - I do not know anything about selections" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4285 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4286 |
^ self subclassResponsibility |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4287 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4288 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4289 |
scrollToBottom |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4290 |
"change origin to show end of text" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4291 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4292 |
"scrolling to the end is not really correct (i.e. should scroll to list size - nFullLinesShown), |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4293 |
but scrollDown: will adjust it ..." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4294 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4295 |
self scrollToLine:(self size) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4296 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4297 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4298 |
scrollToCol:aColNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4299 |
"change origin to make aColNr be the left col" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4300 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4301 |
|pxlOffset leftOffset| |
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4302 |
|
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4303 |
leftOffset := viewOrigin x. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4304 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4305 |
aColNr == 1 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4306 |
leftOffset ~~ 0 ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4307 |
self scrollLeft:leftOffset. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4308 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4309 |
^ self |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4310 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4311 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4312 |
pxlOffset := gc font width * (aColNr - 1). |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4313 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4314 |
pxlOffset < leftOffset ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4315 |
self scrollLeft:(leftOffset - pxlOffset) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4316 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4317 |
pxlOffset > leftOffset ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4318 |
self scrollRight:(pxlOffset - leftOffset) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4319 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4320 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4321 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4322 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4323 |
scrollToLeft |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4324 |
"change origin to start (left) of text" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4325 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2427
diff
changeset
|
4326 |
viewOrigin x ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4327 |
self scrollToCol:1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4328 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4329 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4330 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4331 |
scrollToLine:aLineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4332 |
"change origin to make aLineNr be the top line" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4333 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4334 |
aLineNr < firstLineShown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4335 |
self scrollUp:(firstLineShown - aLineNr) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4336 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4337 |
aLineNr > firstLineShown ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4338 |
self scrollDown:(aLineNr - firstLineShown) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4339 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4340 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4341 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4342 |
|
833 | 4343 |
scrollToPercent:percentOrigin |
4344 |
"scroll to a position given in percent of total" |
|
4345 |
||
4346 |
"kludge - ListView thinks in lines" |
|
4347 |
||
4348 |
self scrollHorizontalToPercent:percentOrigin x. |
|
4349 |
self scrollVerticalToPercent:percentOrigin y. |
|
4350 |
! |
|
4351 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4352 |
scrollToTop |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4353 |
"change origin to start of text" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4354 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4355 |
self scrollToLine:1 |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4356 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4357 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4358 |
scrollUp:nLines |
394
795f293f8520
fixed debris-leftover in scrollDown
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
4359 |
"change origin to scroll up some lines (towards the top of the text)" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4360 |
|
1911 | 4361 |
nLines ~~ 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4362 |
self scrollTo:(viewOrigin - (0 @ (fontHeight * nLines))) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4363 |
redraw:true |
1468 | 4364 |
] |
4365 |
||
1911 | 4366 |
"Modified: / 21.5.1999 / 15:59:45 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4367 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4368 |
|
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4369 |
scrollUpPixels:pix |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4370 |
"change origin to scroll up some pixels |
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4371 |
(towards the top of the text) |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4372 |
THIS WILL VANISH!!" |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4373 |
|
1468 | 4374 |
pix > 0 ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4375 |
self scrollTo:(viewOrigin - (0 @ pix)) redraw:true |
1468 | 4376 |
] |
4377 |
||
4378 |
||
808
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4379 |
! |
0fb219efdfa2
Add #scrollUpPixel: and #scrollDownPixel: (needed for TableView).
ah
parents:
798
diff
changeset
|
4380 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4381 |
scrollVerticalToPercent:percent |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4382 |
"scroll to a position given in percent of total" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4383 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4384 |
|nL lineNr| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4385 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4386 |
nL := self numberOfLines. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4387 |
"/ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4388 |
"/ kludge for last partial line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4389 |
"/ |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4390 |
nFullLinesShown ~~ nLinesShown ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4391 |
nL := nL + 1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4392 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4393 |
lineNr := (((nL * percent) asFloat / 100.0) + 0.5) asInteger + 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4394 |
self scrollToLine:lineNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4395 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4396 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4397 |
startAutoScrollDown:yDistance |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4398 |
"setup for auto-scroll down (when button-press-moving below view) |
5096 | 4399 |
- timeDelta for scroll is computed from distance. |
4400 |
Return true, to tell caller that scrolling is allowed (redefined in editField)" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4401 |
|
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4402 |
self |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4403 |
startAutoScrollVertical:yDistance |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4404 |
scrollSelector:#scrollSelectDown. |
5096 | 4405 |
^ true |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4406 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4407 |
|
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4408 |
startAutoScrollHorizontal:xDistance scrollSelector:scrollSelector |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4409 |
"setup for auto-scroll left/right (when button-press-moving to the right of the view) |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4410 |
- timeDelta for scroll is computed from distance" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4411 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4412 |
|deltaT mm| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4413 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4414 |
autoScroll ifFalse:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4415 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4416 |
mm := xDistance // self horizontalIntegerPixelPerMillimeter + 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4417 |
deltaT := 0.5 / mm. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4418 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4419 |
(deltaT = autoScrollDeltaT) ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4420 |
autoScrollDeltaT := deltaT. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4421 |
autoScrollBlock isNil ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4422 |
autoScrollBlock := [self realized ifTrue:[self perform:scrollSelector]]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4423 |
Processor addTimedBlock:autoScrollBlock afterSeconds:deltaT |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4424 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4425 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4426 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4427 |
|
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4428 |
startAutoScrollLeft:xDistance |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4429 |
"setup for auto-scroll up (when button-press-moving to the left of the view) |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4430 |
- timeDelta for scroll is computed from distance" |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4431 |
|
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4432 |
self |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4433 |
startAutoScrollHorizontal:xDistance negated |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4434 |
scrollSelector:#scrollSelectLeft. |
5096 | 4435 |
^ true |
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4436 |
! |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4437 |
|
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4438 |
startAutoScrollRight:xDistance |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4439 |
"setup for auto-scroll down (when button-press-moving to the right of the view) |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4440 |
- timeDelta for scroll is computed from distance" |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4441 |
|
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4442 |
self |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4443 |
startAutoScrollHorizontal:xDistance |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4444 |
scrollSelector:#scrollSelectRight. |
5096 | 4445 |
^ true |
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4446 |
! |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4447 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4448 |
startAutoScrollUp:yDistance |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4449 |
"setup for auto-scroll up (when button-press-moving below view) |
5096 | 4450 |
- timeDelta for scroll is computed from distance. |
4451 |
Return true, to tell caller that scrolling is allowed (redefined in editField)" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4452 |
|
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4453 |
self |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4454 |
startAutoScrollVertical:yDistance negated |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4455 |
scrollSelector:#scrollSelectUp. |
5096 | 4456 |
^ true |
2765
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4457 |
! |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4458 |
|
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4459 |
startAutoScrollVertical:yDistance scrollSelector:scrollSelector |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4460 |
"setup for auto-scroll up (when button-press-moving below view) |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4461 |
- timeDelta for scroll is computed from distance" |
9ff34c678848
scrollSelect stuff refactored
Claus Gittinger <cg@exept.de>
parents:
2752
diff
changeset
|
4462 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4463 |
|deltaT mm| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4464 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4465 |
autoScroll ifFalse:[^ self]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4466 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4467 |
mm := (yDistance abs // self verticalIntegerPixelPerMillimeter) + 1. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4468 |
deltaT := 0.5 / mm. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4469 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4470 |
(deltaT = autoScrollDeltaT) ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4471 |
autoScrollDeltaT := deltaT. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4472 |
autoScrollBlock isNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4473 |
autoScrollBlock := [self realized ifTrue:[self perform:scrollSelector]]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4474 |
Processor addTimedBlock:autoScrollBlock afterSeconds:deltaT |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4475 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4476 |
] |
4159
3032a5a9d8de
comment and warning in documentation
Claus Gittinger <cg@exept.de>
parents:
4070
diff
changeset
|
4477 |
|
3032a5a9d8de
comment and warning in documentation
Claus Gittinger <cg@exept.de>
parents:
4070
diff
changeset
|
4478 |
"Modified: / 08-08-2010 / 11:26:26 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4479 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4480 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4481 |
stopAutoScroll |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4482 |
"stop any auto-scroll" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4483 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4484 |
autoScrollBlock notNil ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4485 |
self compressMotionEvents:true. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4486 |
Processor removeTimedBlock:autoScrollBlock. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4487 |
autoScrollBlock := nil. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4488 |
autoScrollDeltaT := nil |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4489 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4490 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4491 |
|
1910
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4492 |
verticalScrollStep |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4493 |
"return the amount to scroll when stepping up/down. |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4494 |
Here, the scrolling unit is lines." |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4495 |
|
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4496 |
^ 1 |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4497 |
|
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4498 |
"Created: / 21.5.1999 / 14:00:12 / cg" |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4499 |
! |
0d68937d088b
removed unneeded scrollUp, scrollDown, scrollLeft & scrollRight
Claus Gittinger <cg@exept.de>
parents:
1888
diff
changeset
|
4500 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4501 |
viewOrigin |
5877 | 4502 |
"return the viewOrigin; |
4503 |
that's the coordinate of the contents which is shown topLeft in the view |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4504 |
(i.e. the origin of the visible part of the contents)." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4505 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4506 |
^ viewOrigin |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4507 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4508 |
|
2316 | 4509 |
!ListView methodsFor:'scrolling-basic'! |
1468 | 4510 |
|
2331
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4511 |
additionalMarginForHorizontalScroll |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4512 |
"return the number of pixels by which we may scroll more than the actual |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4513 |
width of the document would allow. |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4514 |
This is redefined by editable textViews, to allo for the cursor |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4515 |
to be visible if it is positioned right behind the longest line of text. |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4516 |
The default returned here is the width of a blank (to beautify italic text)" |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4517 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4518 |
^ gc font width |
2331
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4519 |
! |
218a017dc1f3
additional scroll-margin can be redefined
Claus Gittinger <cg@exept.de>
parents:
2325
diff
changeset
|
4520 |
|
1468 | 4521 |
scrollTo:anOrigin redraw:doRedraw |
4522 |
"change origin to have newOrigin be visible at the top-left. |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4523 |
The argument defines the integer device coordinates of the new top-left |
1468 | 4524 |
point. |
4525 |
" |
|
4526 |
|dltOrg |
|
4527 |
noLn "{ Class:SmallInteger }" |
|
4528 |
max "{ Class:SmallInteger }" |
|
4529 |
tmp "{ Class:SmallInteger }" |
|
4530 |
h "{ Class:SmallInteger }" |
|
4531 |
w "{ Class:SmallInteger }" |
|
4532 |
y0 "{ Class:SmallInteger }" |
|
4533 |
y1 "{ Class:SmallInteger }" |
|
4534 |
y "{ Class:SmallInteger }" |
|
1581
71fee652b652
oops - must be careful to not repair damage with
Claus Gittinger <cg@exept.de>
parents:
1579
diff
changeset
|
4535 |
x "{ Class:SmallInteger }" |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4536 |
delta newFirstLine newViewOrigin |
1984 | 4537 |
hBefore wBefore inv wg| |
4538 |
||
4539 |
hBefore := height. |
|
4540 |
wBefore := width. |
|
1468 | 4541 |
|
4542 |
dltOrg := anOrigin - viewOrigin. |
|
4543 |
||
4544 |
"/ compute valid horizontal offset x |
|
4545 |
||
4546 |
(x := dltOrg x) ~~ 0 ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4547 |
tmp := viewOrigin x + x. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4548 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4549 |
x < 0 ifTrue:[ "/ scrolling left |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4550 |
tmp < 0 ifTrue:[x := 0 - viewOrigin x] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4551 |
] ifFalse:[ "/ scrolling right |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4552 |
"/ allows scrolling to the right of widest line |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4553 |
max := self widthOfContents + (self additionalMarginForHorizontalScroll). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4554 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4555 |
tmp + width > max ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4556 |
x := (max - viewOrigin x - width) max:0 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4557 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4558 |
] |
1468 | 4559 |
]. |
4560 |
||
4561 |
"/ compute valid vertical offset measured in lines |
|
4562 |
||
4563 |
(y := dltOrg y // fontHeight) ~~ 0 ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4564 |
tmp := firstLineShown + y. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4565 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4566 |
y < 0 ifTrue:[ "/ scrolling up |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4567 |
tmp < 1 ifTrue:[y := 1 - firstLineShown] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4568 |
] ifFalse:[ "/ scrolling down |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4569 |
max := self size. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4570 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4571 |
tmp + nFullLinesShown > max ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4572 |
y := (max - firstLineShown - nFullLinesShown + 1) max:0 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4573 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4574 |
] |
1468 | 4575 |
]. |
4576 |
||
1578 | 4577 |
(x == 0 and:[y == 0]) ifTrue:[ "/ has viewOrigin changed ? |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4578 |
^ self |
1468 | 4579 |
]. |
4580 |
||
4581 |
(noLn := y) ~~ 0 ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4582 |
y := y * fontHeight |
1468 | 4583 |
]. |
1581
71fee652b652
oops - must be careful to not repair damage with
Claus Gittinger <cg@exept.de>
parents:
1579
diff
changeset
|
4584 |
delta := (x @ y). |
1468 | 4585 |
|
1582 | 4586 |
newFirstLine := firstLineShown + noLn. |
4587 |
newViewOrigin := viewOrigin + delta. |
|
4588 |
||
1468 | 4589 |
(shown and:[doRedraw]) ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4590 |
self originWillChange. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4591 |
firstLineShown := newFirstLine. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4592 |
viewOrigin := newViewOrigin. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4593 |
self assert:(viewOrigin x >= 0). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4594 |
^ self originChanged:delta |
1468 | 4595 |
]. |
4596 |
||
1578 | 4597 |
"/ (self sensor notNil and: [self sensor hasExposeEventFor:self]) ifTrue:[ "/ outstanding expose events |
4598 |
"/ self invalidate. "/ redraw all |
|
4599 |
"/ self originWillChange. |
|
4600 |
"/ ^ self originChanged:(x @ y ) |
|
4601 |
"/ ]. |
|
1468 | 4602 |
|
1984 | 4603 |
( (y ~~ 0 and:[x ~~ 0]) "/ both x and y changed |
4604 |
or:[(noLn abs) >= nLinesShown "/ at least one area is |
|
4605 |
or:[(x abs) > (width // 4 * 3)]] "/ big enough to redraw all |
|
1468 | 4606 |
) ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4607 |
self originWillChange. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4608 |
firstLineShown := newFirstLine. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4609 |
viewOrigin := newViewOrigin. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4610 |
self invalidate. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4611 |
^ self originChanged:delta |
1468 | 4612 |
]. |
4613 |
||
1726 | 4614 |
"/ OLD: |
4615 |
"/ self repairDamage. |
|
1969
69d9c43db5e9
scrolling - again (added a device sync)
Claus Gittinger <cg@exept.de>
parents:
1964
diff
changeset
|
4616 |
|
1730 | 4617 |
(wg := self windowGroup) notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4618 |
wg processRealExposeEventsFor:self. |
1730 | 4619 |
]. |
1578 | 4620 |
|
4621 |
self originWillChange. |
|
1970 | 4622 |
|
4623 |
"/ make certain, that all drawing is complete |
|
1984 | 4624 |
"/ device sync. |
4625 |
||
1975
0eda51a6d48e
uff - scroll bug (must catch BEFORE changing viewOrigin)
Claus Gittinger <cg@exept.de>
parents:
1972
diff
changeset
|
4626 |
self catchExpose. |
1970 | 4627 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4628 |
x == 0 ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4629 |
"/ scrolling vertical |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4630 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4631 |
y0 := textStartTop + (y abs). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4632 |
h := hBefore - margin - y0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4633 |
w := wBefore - margin. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4634 |
y > 0 ifTrue:[ "/ copy down |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4635 |
"/ kludge: if the selection highlighting draws into the textStartTop area, |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4636 |
"/ the copy below leaves some selection depris in the top area. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4637 |
"/ Therefore, clear the top area. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4638 |
"/ (should avoid this, in case we know there cannot be anything |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4639 |
"/ there - selection is nil or >= firstLineShown). |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4640 |
self clearDeviceRectangleX:margin y:margin width:width-margin-margin height:(textStartTop-margin). |
1983 | 4641 |
"/ self invalidateDeviceRectangle:((margin@margin) corner:(width-margin@textStartTop)) repairNow:false. |
1977 | 4642 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4643 |
self copyFrom:self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4644 |
x:0 y:y0 toX:0 y:textStartTop |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4645 |
width:w height:h async:true. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4646 |
y1 := h - 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4647 |
y0 := y0 + 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4648 |
] ifFalse:[ "/ copy up |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4649 |
self copyFrom:self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4650 |
x:margin y:textStartTop toX:margin y:y0 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4651 |
width:w height:h async:true. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4652 |
y1 := 0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4653 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4654 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4655 |
inv := (margin@y1) extent:(w@y0+margin). |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4656 |
] ifFalse:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4657 |
"/ scrolling horizontal |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4658 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4659 |
x > 0 ifTrue:[ "/ scrolling right |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4660 |
y0 := margin + x. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4661 |
y1 := wBefore - y0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4662 |
] ifFalse:[ "/ scrolling left |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4663 |
y0 := margin - x. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4664 |
y1 := 0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4665 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4666 |
h := hBefore - margin - margin. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4667 |
w := wBefore - margin - y0. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4668 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4669 |
x > 0 ifTrue:[ "/ copy right |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4670 |
self copyFrom:self x:y0 y:margin toX:margin y:margin |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4671 |
width:w height:h async:true. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4672 |
] ifFalse:[ "/ copy left |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4673 |
"/ self copyFrom:self x:textStartLeft y:margin toX:y0 y:margin |
4603 | 4674 |
"/ viewOrigin x > margin ifTrue:[ |
4675 |
"/ self copyFrom:self x:0 y:margin toX:y0-margin y:margin |
|
4676 |
"/ width:w height:h async:true. |
|
4677 |
"/ ] ifFalse:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4678 |
self copyFrom:self x:margin y:margin toX:y0 y:margin |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4679 |
width:w height:h async:true. |
4603 | 4680 |
"/ ]. |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4681 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4682 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4683 |
inv := (y1@margin) extent:(y0@h). |
1468 | 4684 |
]. |
4685 |
||
1984 | 4686 |
firstLineShown := newFirstLine. |
4687 |
viewOrigin := newViewOrigin. |
|
1969
69d9c43db5e9
scrolling - again (added a device sync)
Claus Gittinger <cg@exept.de>
parents:
1964
diff
changeset
|
4688 |
|
1885 | 4689 |
self invalidateDeviceRectangle:inv repairNow:false. |
4603 | 4690 |
viewOrigin x <= margin ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4691 |
self invalidateDeviceRectangle:((0@margin) extent:(margin@h)) repairNow:false. |
4603 | 4692 |
]. |
1712
cb753ba02fb4
remember old width/height before doing a repairDamage
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
4693 |
|
1975
0eda51a6d48e
uff - scroll bug (must catch BEFORE changing viewOrigin)
Claus Gittinger <cg@exept.de>
parents:
1972
diff
changeset
|
4694 |
self originChanged:delta. |
1969
69d9c43db5e9
scrolling - again (added a device sync)
Claus Gittinger <cg@exept.de>
parents:
1964
diff
changeset
|
4695 |
self waitForExpose. |
1726 | 4696 |
|
2202
edf8821d56a1
synchronous redraw after a scroll
Claus Gittinger <cg@exept.de>
parents:
2199
diff
changeset
|
4697 |
(wg := self windowGroup) notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4698 |
wg processRealExposeEventsFor:self. |
2202
edf8821d56a1
synchronous redraw after a scroll
Claus Gittinger <cg@exept.de>
parents:
2199
diff
changeset
|
4699 |
]. |
edf8821d56a1
synchronous redraw after a scroll
Claus Gittinger <cg@exept.de>
parents:
2199
diff
changeset
|
4700 |
|
1984 | 4701 |
"/ (hBefore ~= height or:[wBefore ~= width]) ifTrue:[ |
4702 |
"/ self halt. |
|
4703 |
"/ ]. |
|
4704 |
||
4159
3032a5a9d8de
comment and warning in documentation
Claus Gittinger <cg@exept.de>
parents:
4070
diff
changeset
|
4705 |
"Modified: / 08-08-2010 / 11:14:09 / cg" |
1468 | 4706 |
! ! |
4707 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4708 |
!ListView methodsFor:'searching'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4709 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4710 |
findBeginOfWordAtLine:selectLine col:selectCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4711 |
"return the col of first character of the word at given line/col. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4712 |
If the character under the initial col is a space character, return |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4713 |
the first col of the blank-block." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4714 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4715 |
|beginCol thisCharacter| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4716 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4717 |
beginCol := selectCol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4718 |
thisCharacter := self characterAtLine:selectLine col:beginCol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4719 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4720 |
"is this acharacter within a word ?" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4721 |
(wordCheck value:thisCharacter) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4722 |
[wordCheck value:thisCharacter] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4723 |
beginCol := beginCol - 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4724 |
beginCol < 1 ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4725 |
^ 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4726 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4727 |
thisCharacter := self characterAtLine:selectLine col:beginCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4728 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4729 |
beginCol := beginCol + 1. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4730 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4731 |
"nope - maybe its a space" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4732 |
thisCharacter == Character space ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4733 |
[beginCol > 1 and:[thisCharacter == Character space]] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4734 |
beginCol := beginCol - 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4735 |
thisCharacter := self characterAtLine:selectLine col:beginCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4736 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4737 |
thisCharacter ~~ Character space ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4738 |
beginCol := beginCol + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4739 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4740 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4741 |
"select single character" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4742 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4743 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4744 |
^ beginCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4745 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4746 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4747 |
findEndOfWordAtLine:selectLine col:selectCol |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4748 |
"return the col of last character of the word at given line/col. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4749 |
If the character under the initial col is a space character, return |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4750 |
the last col of the blank-block. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4751 |
Return 0 if we should wrap to next line (for spaces)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4752 |
|
770
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4753 |
|endCol "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4754 |
len "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4755 |
thisCharacter| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4756 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4757 |
endCol := selectCol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4758 |
endCol == 0 ifTrue:[endCol := 1]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4759 |
thisCharacter := self characterAtLine:selectLine col:endCol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4760 |
|
2900 | 4761 |
len := (self listAt:selectLine) size. |
4762 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4763 |
"is this acharacter within a word ?" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4764 |
(wordCheck value:thisCharacter) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4765 |
[wordCheck value:thisCharacter] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4766 |
endCol := endCol + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4767 |
endCol > len ifTrue:[ ^ len ]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4768 |
thisCharacter := self characterAtLine:selectLine col:endCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4769 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4770 |
endCol := endCol - 1. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4771 |
] ifFalse:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4772 |
"nope - maybe its a space" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4773 |
thisCharacter == Character space ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4774 |
endCol > len ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4775 |
"select rest to end" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4776 |
endCol := 0 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4777 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4778 |
thisCharacter := self characterAtLine:selectLine col:endCol. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4779 |
[endCol <= len and:[thisCharacter == Character space]] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4780 |
endCol := endCol + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4781 |
thisCharacter := self characterAtLine:selectLine col:endCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4782 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4783 |
endCol := endCol - 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4784 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4785 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4786 |
"select single character" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4787 |
] |
125 | 4788 |
]. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4789 |
^ endCol. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4790 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4791 |
|
1325 | 4792 |
searchBackwardFor:pattern ignoreCase:ignCase startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4793 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4794 |
found evaluate block2. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4795 |
Sorry, but pattern is no regular expression pattern (yet)" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4796 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4797 |
^ self |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4798 |
searchBackwardUsingSpec:(SearchSpec new |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4799 |
pattern:pattern |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4800 |
ignoreCase:ignCase |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4801 |
match:false) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4802 |
startingAtLine:startLine col:startCol |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4803 |
ifFound:block1 ifAbsent:block2 |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4804 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4805 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4806 |
searchBackwardFor:pattern startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4807 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4808 |
found evaluate block2. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4809 |
Sorry, but pattern is no regular expression pattern (yet)" |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4810 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4811 |
^ self |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4812 |
searchBackwardFor:pattern |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4813 |
ignoreCase:false |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4814 |
startingAtLine:startLine col:startCol |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4815 |
ifFound:block1 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4816 |
ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4817 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4818 |
"Modified: 13.9.1997 / 01:07:36 / cg" |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4819 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4820 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4821 |
searchBackwardUsingSpec:searchSpec startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4822 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4823 |
found evaluate block2. |
5546 | 4824 |
Sorry, but pattern is no regular expression pattern (yet). |
4825 |
Also, wraps are not done when searching backward." |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4826 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4827 |
|lineString |
5076 | 4828 |
pattern ignCase match fullWord atBeginOfLineOnly |
4444 | 4829 |
found firstChar1 firstChar2 c pc col1 |
770
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4830 |
col "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4831 |
cc "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4832 |
patternSize "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4833 |
line1 "{ Class: SmallInteger }" |
a41466e3dfaa
use integer typed variables for compact code
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
4834 |
lineSize "{ Class: SmallInteger }" | |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4835 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4836 |
pattern := searchSpec pattern. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4837 |
ignCase := searchSpec ignoreCase. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4838 |
match := searchSpec match. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4839 |
match ifTrue:[ Transcript showCR:'backward matchsearch is (still) not implemented' ]. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4840 |
fullWord := searchSpec fullWord. |
5076 | 4841 |
atBeginOfLineOnly := searchSpec atBeginOfLineOnly. |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4842 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4843 |
patternSize := pattern size. |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4844 |
(list notNil |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4845 |
and:[startLine > 0 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4846 |
and:[patternSize ~~ 0]]) |
2508
5bf86df079c9
backward search without inital line
Claus Gittinger <cg@exept.de>
parents:
2455
diff
changeset
|
4847 |
ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4848 |
self withCursor:Cursor questionMark do:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4849 |
col := startCol - 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4850 |
firstChar1 := pattern at:1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4851 |
ignCase ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4852 |
firstChar1 := firstChar1 asLowercase. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4853 |
firstChar2 := firstChar1 asUppercase. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4854 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4855 |
firstChar2 := firstChar1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4856 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4857 |
|
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4858 |
line1 := startLine. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4859 |
line1 > list size ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4860 |
line1 := list size. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4861 |
col := -999 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4862 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4863 |
col > (list at:line1) size ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4864 |
col := -999 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4865 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4866 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4867 |
line1 to:1 by:-1 do:[:lnr | |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4868 |
lineString := list at:lnr. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4869 |
lineString notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4870 |
lineString := lineString asString. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4871 |
lineString isString ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4872 |
"/ quick check if pattern is present |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4873 |
col1 := lineString |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4874 |
findString:pattern startingAt:1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4875 |
ifAbsent:0 caseSensitive: ignCase not. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4876 |
col1 ~~ 0 ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4877 |
lineSize := lineString size. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4878 |
col == -999 ifTrue:[col := lineSize - patternSize + 1]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4879 |
[(col > 0) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4880 |
and:[(c := lineString at:col) ~= firstChar1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4881 |
and:[c ~= firstChar2]]] whileTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4882 |
col := col - 1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4883 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4884 |
[col > 0] whileTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4885 |
cc := col. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4886 |
found := true. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4887 |
1 to:patternSize do:[:cnr | |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4888 |
cc > lineSize ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4889 |
found := false |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4890 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4891 |
pc := pattern at:cnr. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4892 |
c := lineString at:cc. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4893 |
pc ~= c ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4894 |
(ignCase not or:[pc asLowercase ~= c asLowercase]) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4895 |
found := false |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4896 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4897 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4898 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4899 |
cc := cc + 1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4900 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4901 |
found ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4902 |
(fullWord not |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4903 |
or:[ (self findBeginOfWordAtLine:lnr col:col) == col |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4904 |
and:[ (self findEndOfWordAtLine:lnr col:col) == (col + patternSize - 1) ]] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4905 |
) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4906 |
(atBeginOfLineOnly not or:[col == 1]) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4907 |
^ block1 value:lnr value:col optionalArgument:nil. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4908 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4909 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4910 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4911 |
col := col - 1. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4912 |
[(col > 0) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4913 |
and:[(c := lineString at:col) ~= firstChar1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4914 |
and:[c ~= firstChar2]]] whileTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4915 |
col := col - 1 |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4916 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4917 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4918 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4919 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4920 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4921 |
col := -999. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4922 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4923 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4924 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4925 |
"not found" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4926 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4927 |
^ block2 value |
386
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
4928 |
|
4444 | 4929 |
"Created: / 13-09-1997 / 01:06:19 / cg" |
4930 |
"Modified: / 05-08-2012 / 12:16:31 / cg" |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4931 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4932 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4933 |
searchForwardFor:pattern ignoreCase:ignCase match:match startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
1325 | 4934 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4935 |
found evaluate block2." |
1325 | 4936 |
|
4937 |
^ self |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4938 |
searchForwardUsingSpec:(SearchSpec new |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4939 |
pattern:pattern |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4940 |
ignoreCase:ignCase |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4941 |
match:match) |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4942 |
startingAtLine:startLine col:startCol |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4943 |
ifFound:block1 ifAbsent:block2 |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4944 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4945 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4946 |
searchForwardFor:pattern ignoreCase:ignCase startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4947 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4948 |
found evaluate block2." |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4949 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4950 |
^ self searchForwardFor:pattern ignoreCase:ignCase match: true startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4951 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4952 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4953 |
searchForwardFor:pattern startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4954 |
"search for a pattern, if found evaluate block1 with row/col as arguments, if not |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4955 |
found evaluate block2." |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4956 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4957 |
^ self |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4958 |
searchForwardFor:pattern |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4959 |
ignoreCase:false |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4960 |
startingAtLine:startLine col:startCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4961 |
ifFound:block1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
4962 |
ifAbsent:block2 |
1325 | 4963 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4964 |
"Modified: 13.9.1997 / 01:07:11 / cg" |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4965 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4966 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4967 |
searchForwardUsingSpec:searchSpec startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2 |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4968 |
"search for a pattern, if found evaluate block1 with row/col as arguments, |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4969 |
if not found evaluate block2. |
5715 | 4970 |
If the block is a three-arg block, it gets the end-col (or nil, if not known)" |
5546 | 4971 |
|
4972 |
|lineString col pattern match regexMatch ignCase fullWord atBeginOfLineOnly |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4973 |
wrapAtEndOfText patternSize matcher lnr "{Class: SmallInteger}" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4974 |
line1 "{Class: SmallInteger}" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4975 |
line2 "{Class: SmallInteger}" |
5546 | 4976 |
p realPattern runner foundCol endCol| |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4977 |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4978 |
pattern := searchSpec pattern. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4979 |
match := searchSpec match. |
5546 | 4980 |
regexMatch := searchSpec regexMatch. |
5715 | 4981 |
(match and:[regexMatch not]) ifTrue:[ |
6214 | 4982 |
pattern := pattern globPatternAsRegexPattern. |
4983 |
regexMatch := true. |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
4984 |
]. |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4985 |
ignCase := searchSpec ignoreCase. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4986 |
fullWord := searchSpec fullWord. |
5076 | 4987 |
atBeginOfLineOnly := searchSpec atBeginOfLineOnly. |
5546 | 4988 |
wrapAtEndOfText := searchSpec wrapAtEndOfText. |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
4989 |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4990 |
patternSize := pattern size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
4991 |
(list notNil and:[patternSize ~~ 0]) ifTrue:[ |
6214 | 4992 |
self withCursor:Cursor questionMark do:[ |
4993 |
||
4994 |
col := startCol + 1. |
|
4995 |
line1 := startLine. |
|
4996 |
line2 := list size. |
|
4997 |
||
4998 |
"/ call searchBlock with lnr, col, and line. Cares for wrap |
|
4999 |
runner := |
|
5000 |
[:searchBlock | |
|
5001 |
|didWrap| |
|
5002 |
||
5003 |
lnr := line1. |
|
5004 |
didWrap := false. |
|
5005 |
[lnr <= line2] whileTrue:[ |
|
5006 |
lineString := list at:lnr. |
|
5007 |
lineString notNil ifTrue:[ |
|
5008 |
lineString := lineString asString string. |
|
5009 |
lineString isString ifTrue:[ |
|
5010 |
searchBlock value:lnr value:col value:lineString |
|
5011 |
] |
|
5012 |
]. |
|
5013 |
col := 1. |
|
5014 |
lnr := lnr + 1. |
|
5015 |
lnr > line2 ifTrue:[ |
|
5016 |
(wrapAtEndOfText and:[didWrap not]) ifTrue:[ |
|
5017 |
didWrap := true. |
|
5018 |
lnr := 1. |
|
5019 |
line2 := line1-1. |
|
5020 |
]. |
|
5021 |
]. |
|
5022 |
]. |
|
5023 |
||
5024 |
]. |
|
5025 |
||
5026 |
(match and:[regexMatch]) ifTrue:[ |
|
5027 |
"perform a findMatchString (regex matching)" |
|
5028 |
Regex::RxParser isNil ifTrue:[ |
|
5029 |
Smalltalk loadPackage:'stx:goodies/regex' |
|
5030 |
]. |
|
5031 |
matcher := ignCase ifTrue:[pattern asRegexIgnoringCase] ifFalse:[pattern asRegex]. |
|
5032 |
runner value:[:lnr :col :lineString | |
|
5033 |
|lineStream| |
|
5034 |
||
5035 |
lineStream := lineString readStream position:col-1; yourself. |
|
5036 |
"/ find which match to show |
|
5037 |
(matcher searchStream:lineStream) ifTrue:[ |
|
5038 |
foundCol := matcher subBeginning:1. |
|
5039 |
endCol := matcher subEnd:1. |
|
5040 |
(foundCol notNil and: [endCol notNil]) ifTrue: [ |
|
5041 |
foundCol := foundCol + 1. "/ regex uses 0-based indexes (sigh) |
|
5042 |
(atBeginOfLineOnly not or:[foundCol == 1]) ifTrue:[ |
|
5043 |
^ block1 value:lnr value:foundCol optionalArgument:endCol. |
|
5044 |
] |
|
5045 |
] |
|
5046 |
] |
|
5047 |
]. |
|
5048 |
] ifFalse:[ |
|
5049 |
(match and:[pattern includesUnescapedMatchCharacters]) ifTrue:[ |
|
5050 |
"perform a findMatchString (glob matching)" |
|
5051 |
p := pattern species new:0. |
|
5052 |
(pattern startsWith:$*) ifFalse:[p := p , '*']. |
|
5053 |
p := p , pattern. |
|
5054 |
(pattern endsWith:$*) ifFalse:[p := p , '*']. |
|
5055 |
realPattern := pattern. |
|
5056 |
(realPattern startsWith:$*) ifTrue:[ |
|
5057 |
realPattern := realPattern copyFrom:2 |
|
5058 |
]. |
|
5059 |
runner value:[:lnr :col :lineString | |
|
5060 |
(p match:lineString caseSensitive:ignCase not) ifTrue:[ |
|
5061 |
"/ ok, there it is; look at which position |
|
5062 |
foundCol := lineString |
|
5063 |
findMatchString:realPattern startingAt:col |
|
5064 |
caseSensitive:ignCase not ifAbsent:0. |
|
5065 |
foundCol ~~ 0 ifTrue:[ |
|
5066 |
(atBeginOfLineOnly not or:[foundCol == 1]) ifTrue:[ |
|
5067 |
^ block1 value:lnr value:foundCol optionalArgument:nil. |
|
5068 |
]]] |
|
5069 |
]. |
|
5070 |
] ifFalse:[ |
|
5071 |
"perform a findString (no matching)" |
|
5072 |
p := pattern. |
|
5073 |
(match and:[pattern includesMatchCharacters]) ifTrue:[ |
|
5074 |
p := pattern withoutMatchEscapes |
|
5075 |
]. |
|
5076 |
runner |
|
5077 |
value:[:lnr :col :lineString | |
|
5078 |
foundCol := lineString |
|
5079 |
findString:p startingAt:col ifAbsent:0 caseSensitive: ignCase not. |
|
5080 |
foundCol ~~ 0 ifTrue:[ |
|
5081 |
(fullWord not |
|
5082 |
or:[ (self findBeginOfWordAtLine:lnr col:foundCol) == foundCol |
|
5083 |
and:[ (self findEndOfWordAtLine:lnr col:foundCol) == (foundCol + patternSize - 1) ]] |
|
5084 |
) ifTrue:[ |
|
5085 |
(atBeginOfLineOnly not or:[foundCol == 1]) ifTrue:[ |
|
5086 |
^ block1 value:lnr value:foundCol optionalArgument:nil. |
|
5087 |
] |
|
5088 |
] |
|
5089 |
] |
|
5090 |
]. |
|
5091 |
]. |
|
5092 |
]. |
|
5093 |
] |
|
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5094 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5095 |
"not found" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5096 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5097 |
^ block2 value |
403
ee8f6d080077
preserve cursor (error while searching)
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
5098 |
|
4444 | 5099 |
"Created: / 13-09-1997 / 01:06:31 / cg" |
5100 |
"Modified: / 05-08-2012 / 12:22:42 / cg" |
|
6214 | 5101 |
"Modified (format): / 12-10-2017 / 18:35:55 / stefan" |
1325 | 5102 |
! |
5103 |
||
3564 | 5104 |
standardWordCheck:char |
4403 | 5105 |
"the wordCheck is a predicate which returns true if the given character |
5106 |
belongs to the (textual) word. Used with double click to select a word. |
|
5107 |
When editing code, typically characters which are part of an identifier |
|
5108 |
are part of a word (underline, dollar, but no other non-letters). |
|
5109 |
The standardWordCheck aks the current userPreferences for details." |
|
5110 |
||
5111 |
|prefs| |
|
5112 |
||
5113 |
(prefs := UserPreferences current) whitespaceWordSelectMode ifTrue:[ |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5114 |
"an extremely simple mode, where every non-space is treated as part of the word" |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5115 |
^ char isSeparator not |
3564 | 5116 |
]. |
4403 | 5117 |
prefs extendedWordSelectMode ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5118 |
"the typical mode, useful for text and code" |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5119 |
^ char isNationalAlphaNumeric or:[char == $_] |
3564 | 5120 |
]. |
4403 | 5121 |
"another typical mode, also useful for text and code" |
3564 | 5122 |
^ char isNationalAlphaNumeric |
4403 | 5123 |
|
5124 |
"Modified (comment): / 17-03-2012 / 19:04:13 / cg" |
|
0 | 5125 |
! ! |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5126 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5127 |
!ListView methodsFor:'tabulators'! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5128 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5129 |
expandTabs |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5130 |
"go through whole text expanding tabs into spaces. |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5131 |
This is meant to be called for text being imported from a file. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5132 |
Therefore, 8-col tabs are assumed - independent of any private tab setting." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5133 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5134 |
|line newLine nLines "{ Class: SmallInteger }"| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5135 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5136 |
includesNonStrings := false. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5137 |
list notNil ifTrue:[ |
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5138 |
nLines := self size. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5139 |
1 to:nLines do:[:index | |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5140 |
line := self at:index. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5141 |
line notNil ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5142 |
(line isString) ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5143 |
newLine := line withTabsExpanded. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5144 |
newLine ~~ line ifTrue:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5145 |
list at:index put:newLine |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5146 |
]. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5147 |
] ifFalse:[ |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5148 |
includesNonStrings := true. |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5149 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5150 |
] |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5151 |
] |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5152 |
] |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5153 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5154 |
"Modified: 30.8.1995 / 19:06:37 / claus" |
627 | 5155 |
"Modified: 12.5.1996 / 12:48:03 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5156 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5157 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5158 |
nextTabAfter:colNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5159 |
"return the next tab position after col" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5160 |
|
3151
fc183d8ff88c
next-tab: fallback to mod-8 tabs if beyond tab-list
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
5161 |
^ self nextTabAfter:colNr in:tabPositions. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5162 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5163 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5164 |
nextTabAfter:colNr in:tabPositions |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5165 |
"return the next tab position after col. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5166 |
The second arg, tabPositions is a collection of tabStops." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5167 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5168 |
|col "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5169 |
tabIndex "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5170 |
thisTab "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5171 |
nTabs "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5172 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5173 |
tabIndex := 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5174 |
col := colNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5175 |
thisTab := tabPositions at:tabIndex. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5176 |
nTabs := tabPositions size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5177 |
[thisTab <= col] whileTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5178 |
(tabIndex == nTabs) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5179 |
"/ fallback to mod-8 tabs if beyond tab-list. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5180 |
thisTab := col + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5181 |
thisTab := thisTab + (8 - (thisTab \\ 8)). |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5182 |
^ thisTab |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5183 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5184 |
tabIndex := tabIndex + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5185 |
thisTab := tabPositions at:tabIndex |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5186 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5187 |
^ thisTab |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5188 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5189 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5190 |
prevTabBefore:colNr |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5191 |
"return the prev tab position before col" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5192 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5193 |
|col "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5194 |
tabIndex "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5195 |
thisTab "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5196 |
nTabs "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5197 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5198 |
tabIndex := 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5199 |
col := colNr. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5200 |
thisTab := tabPositions at:tabIndex. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5201 |
nTabs := tabPositions size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5202 |
[thisTab < col] whileTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5203 |
(tabIndex == nTabs) ifTrue:[^ thisTab]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5204 |
tabIndex := tabIndex + 1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5205 |
thisTab := tabPositions at:tabIndex |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5206 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5207 |
(tabIndex == 1) ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5208 |
^ 1 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5209 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5210 |
^ tabPositions at:(tabIndex - 1) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5211 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5212 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5213 |
setTab4 |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5214 |
"set 4-character tab stops" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5215 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5216 |
tabPositions := self class tab4Positions. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5217 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5218 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5219 |
setTab8 |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5220 |
"set 8-character tab stops" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5221 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5222 |
tabPositions := self class tab8Positions. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5223 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5224 |
|
2378 | 5225 |
setTabPositions:aVector |
5226 |
"set tab stops" |
|
5227 |
||
5228 |
tabPositions := aVector. |
|
5229 |
! |
|
5230 |
||
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5231 |
withTabs:line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5232 |
"Assuming an 8-character tab, |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5233 |
compress multiple leading spaces to tabs, return a new line string |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5234 |
or the original line, if no tabs where created. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5235 |
good idea, to make this one a primitive, since its called |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5236 |
many times when a big text is saved to a file." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5237 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5238 |
|newLine eightSpaces nTabs| |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5239 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5240 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5241 |
the code below is a hack, producing many garbage strings for lines |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5242 |
which compress multiple tabs ... needs rewrite: saving big files |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5243 |
stresses the garbage collector a bit ... |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5244 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5245 |
line isNil ifTrue:[^ line]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5246 |
eightSpaces := ' '. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5247 |
(line startsWith:eightSpaces) ifFalse:[^ line]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5248 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5249 |
nTabs := 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5250 |
newLine := line copyFrom:9. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5251 |
[newLine startsWith:eightSpaces] whileTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5252 |
newLine := newLine copyFrom:9. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5253 |
nTabs := nTabs + 1. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5254 |
]. |
386
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5255 |
^ (line species new:nTabs withAll:Character tab) asString , newLine. |
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5256 |
|
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5257 |
"Modified: 23.2.1996 / 19:10:36 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5258 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5259 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5260 |
withTabs:tabulatorTable expand:line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5261 |
"expand tabs into spaces, return a new line string, |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5262 |
or original line, if no tabs are included. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5263 |
good idea, to make this one a primitive, since it is called |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5264 |
many times if a big text is read from a file." |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5265 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5266 |
|tmpString nString nTabs |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5267 |
currentMax "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5268 |
dstIndex "{ Class: SmallInteger }" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5269 |
nextTab "{ Class: SmallInteger }" | |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5270 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5271 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5272 |
the code below tries to avoid creating too much garbage; |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5273 |
therefore, the string is scanned first for the number of |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5274 |
tabs to get a rough idea of the final strings size. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5275 |
(it could be done better, by computing the exact size |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5276 |
required here ...) |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5277 |
" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5278 |
line isNil ifTrue:[^ line]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5279 |
nTabs := line occurrencesOf:(Character tab). |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5280 |
nTabs == 0 ifTrue:[^ line]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5281 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5282 |
currentMax := line size + (nTabs * 7). |
386
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5283 |
tmpString := line species new:currentMax. |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5284 |
dstIndex := 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5285 |
line do:[:character | |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5286 |
(character == (Character tab)) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5287 |
nextTab := self nextTabAfter:dstIndex in:tabulatorTable. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5288 |
[dstIndex < nextTab] whileTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5289 |
tmpString at:dstIndex put:(Character space). |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5290 |
dstIndex := dstIndex + 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5291 |
] |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5292 |
] ifFalse:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5293 |
tmpString at:dstIndex put:character. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5294 |
dstIndex := dstIndex + 1 |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5295 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5296 |
(dstIndex > currentMax) ifTrue:[ |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5297 |
" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5298 |
this cannot happen with <= 8 tabs |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5299 |
" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5300 |
currentMax := currentMax + currentMax. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5301 |
nString := line species new:currentMax. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5302 |
nString replaceFrom:1 to:(dstIndex - 1) |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5303 |
with:tmpString startingAt:1. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5304 |
tmpString := nString. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5305 |
nString := nil |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5306 |
]. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5307 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5308 |
"make stc-optimizer happy |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5309 |
- no need to return value of ifTrue:/ifFalse above" |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5310 |
0 |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5311 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5312 |
dstIndex := dstIndex - 1. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5313 |
dstIndex == currentMax ifTrue:[ |
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5314 |
^ tmpString |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5315 |
]. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5316 |
^ tmpString copyTo:dstIndex |
386
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5317 |
|
514f73e07c2d
more 16bit fixes (compare chars using = / ~= instead of == / ~=)
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
5318 |
"Modified: 23.2.1996 / 19:11:01 / cg" |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5319 |
! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5320 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5321 |
withTabsExpanded:line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5322 |
"expand tabs into spaces, return a new line string, |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5323 |
or original line, if no tabs are included. |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5324 |
good idea, to make this one a primitive" |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5325 |
|
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5326 |
^ self withTabs:tabPositions expand:line |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5327 |
! ! |
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5328 |
|
3869
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5329 |
!ListView::HighlightArea methodsFor:'accessing'! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5330 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5331 |
endCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5332 |
^ endCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5333 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5334 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5335 |
endCol:something |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5336 |
endCol := something. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5337 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5338 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5339 |
endLine |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5340 |
^ endLine |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5341 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5342 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5343 |
endLine:something |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5344 |
endLine := something. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5345 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5346 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5347 |
startCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5348 |
^ startCol |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5349 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5350 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5351 |
startCol:something |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5352 |
startCol := something. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5353 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5354 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5355 |
startLine |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5356 |
^ startLine |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5357 |
! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5358 |
|
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5359 |
startLine:something |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5360 |
startLine := something. |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5361 |
! ! |
82b87c5ae995
preps for multiple highlightAreas
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
5362 |
|
6239 | 5363 |
!ListView::HighlightArea methodsFor:'accessing-color & font'! |
5364 |
||
5365 |
bgColor |
|
5366 |
^ bgColor |
|
5367 |
! |
|
5368 |
||
5369 |
bgColor:something |
|
5370 |
bgColor := something. |
|
5371 |
! |
|
5372 |
||
5373 |
fgColor |
|
5374 |
^ fgColor |
|
5375 |
! |
|
5376 |
||
5377 |
fgColor:something |
|
5378 |
fgColor := something. |
|
5379 |
! ! |
|
5380 |
||
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5381 |
!ListView::SearchSpec methodsFor:'accessing'! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5382 |
|
5076 | 5383 |
atBeginOfLineOnly |
5079 | 5384 |
^ atBeginOfLineOnly ? false |
5076 | 5385 |
! |
5386 |
||
5715 | 5387 |
atBeginOfLineOnly:aBoolean |
5388 |
atBeginOfLineOnly := aBoolean. |
|
5076 | 5389 |
! |
5390 |
||
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5391 |
forward |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5392 |
^ forward ? true |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5393 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5394 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5395 |
fullWord |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5396 |
^ fullWord ? false |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5397 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5398 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5399 |
ignoreCase |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5400 |
^ ignoreCase ? false |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5401 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5402 |
|
5217 | 5403 |
ignoreDiacritics |
6281 | 5404 |
^ ignoreDiacritics ? false |
5217 | 5405 |
! |
5406 |
||
5407 |
ignoreDiacritics:something |
|
5408 |
ignoreDiacritics := something. |
|
5409 |
! |
|
5410 |
||
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5411 |
match |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5412 |
^ match ? false |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5413 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5414 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5415 |
pattern |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5416 |
^ pattern |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5417 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5418 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5419 |
pattern:patternString |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5420 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5421 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5422 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5423 |
pattern:patternString ignoreCase:ignoredCaseBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5424 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5425 |
ignoreCase := ignoredCaseBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5426 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5427 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5428 |
pattern:patternString ignoreCase:ignoredCaseBoolean match:matchBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5429 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5430 |
ignoreCase := ignoredCaseBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5431 |
match := matchBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5432 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5433 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5434 |
pattern:patternString ignoreCase:ignoredCaseBoolean match:matchBoolean forward:forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5435 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5436 |
ignoreCase := ignoredCaseBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5437 |
match := matchBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5438 |
forward := forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5439 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5440 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5441 |
pattern:patternString ignoreCase:ignoredCaseBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5442 |
match:matchBoolean regexMatch:regexMatchBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5443 |
variable:variableBoolen |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5444 |
fullWord:fullWordBoolen forward:forwardBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5445 |
atBeginOfLineOnly:atBeginOfLineOnlyArg |
5533 | 5446 |
pattern := patternString. |
5447 |
ignoreCase := ignoredCaseBoolean. |
|
5448 |
match := matchBoolean. |
|
5449 |
regexMatch := regexMatchBoolean. |
|
5450 |
variable := variableBoolen. |
|
5451 |
fullWord := fullWordBoolen. |
|
5452 |
forward := forwardBoolean. |
|
5453 |
atBeginOfLineOnly := atBeginOfLineOnlyArg |
|
5454 |
! |
|
5455 |
||
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5456 |
pattern:patternString ignoreCase:ignoredCaseBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5457 |
match:matchBoolean regexMatch:regexMatchBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5458 |
variable:variableBoolen |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5459 |
fullWord:fullWordBoolen forward:forwardBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5460 |
atBeginOfLineOnly:atBeginOfLineOnlyArg |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5461 |
wrapAtEnd:wrapAtEndOfTextArg |
5533 | 5462 |
pattern := patternString. |
5463 |
ignoreCase := ignoredCaseBoolean. |
|
5464 |
match := matchBoolean. |
|
5465 |
regexMatch := regexMatchBoolean. |
|
5466 |
variable := variableBoolen. |
|
5467 |
fullWord := fullWordBoolen. |
|
5468 |
forward := forwardBoolean. |
|
5469 |
atBeginOfLineOnly := atBeginOfLineOnlyArg. |
|
5544 | 5470 |
wrapAtEndOfText := wrapAtEndOfTextArg. |
5533 | 5471 |
! |
5472 |
||
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5473 |
pattern:patternString ignoreCase:ignoredCaseBoolean match:matchBoolean variable:variableBoolen forward:forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5474 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5475 |
ignoreCase := ignoredCaseBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5476 |
match := matchBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5477 |
variable := variableBoolen. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5478 |
forward := forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5479 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5480 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5481 |
pattern:patternString ignoreCase:ignoredCaseBoolean match:matchBoolean variable:variableBoolen fullWord:fullWordBoolen forward:forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5482 |
pattern := patternString. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5483 |
ignoreCase := ignoredCaseBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5484 |
match := matchBoolean. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5485 |
variable := variableBoolen. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5486 |
fullWord := fullWordBoolen. |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5487 |
forward := forwardBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5488 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5489 |
|
5789
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5490 |
pattern:patternString ignoreCase:ignoredCaseBoolean match:matchBoolean variable:variableBoolen |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5491 |
fullWord:fullWordBoolen forward:forwardBoolean |
a6db617369e9
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
5780
diff
changeset
|
5492 |
atBeginOfLineOnly:atBeginOfLineOnlyArg |
5076 | 5493 |
pattern := patternString. |
5494 |
ignoreCase := ignoredCaseBoolean. |
|
5495 |
match := matchBoolean. |
|
5496 |
variable := variableBoolen. |
|
5497 |
fullWord := fullWordBoolen. |
|
5498 |
forward := forwardBoolean. |
|
5499 |
atBeginOfLineOnly := atBeginOfLineOnlyArg |
|
5500 |
! |
|
5501 |
||
5533 | 5502 |
regexMatch |
5715 | 5503 |
^ regexMatch ? false |
5504 |
! |
|
5505 |
||
5506 |
regexMatch:aBoolean |
|
5507 |
regexMatch := aBoolean. |
|
5533 | 5508 |
! |
5509 |
||
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5510 |
variable |
6281 | 5511 |
^ variable ? false |
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5512 |
! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5513 |
|
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5514 |
variable:variableBoolean |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5515 |
variable := variableBoolean |
5533 | 5516 |
! |
5517 |
||
5544 | 5518 |
wrapAtEndOfText |
6281 | 5519 |
^ wrapAtEndOfText ? false |
5544 | 5520 |
! |
5521 |
||
5522 |
wrapAtEndOfText:aBoolean |
|
5523 |
wrapAtEndOfText := aBoolean. |
|
4463
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5524 |
! ! |
8bfe40af7940
search protocol changed to pass down a searchSpec instead
Claus Gittinger <cg@exept.de>
parents:
4448
diff
changeset
|
5525 |
|
851
b9d71ccdefaa
care for new fontParameters, if changing from a non-string-list
Claus Gittinger <cg@exept.de>
parents:
837
diff
changeset
|
5526 |
!ListView class methodsFor:'documentation'! |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5527 |
|
4523 | 5528 |
version |
5369 | 5529 |
^ '$Header$' |
4523 | 5530 |
! |
5531 |
||
4015
8647dad37cb0
comment/format in: #on:aspect:change:list:menu:
Claus Gittinger <cg@exept.de>
parents:
3869
diff
changeset
|
5532 |
version_CVS |
5369 | 5533 |
^ '$Header$' |
249
75b8fb924904
draw strings as opaque strings - OS/2 server has a bug with non-image strings
Claus Gittinger <cg@exept.de>
parents:
236
diff
changeset
|
5534 |
! ! |
4495 | 5535 |