I don't have access to a 6.01 installation, but I don't expect changes
since then.
If you have trouble I'll check this on an old version, too.
I attached one very simple, no thought on performance, sense, GCs and so
on...
I assume your problem is the non responding change on setting the
foreground: , anyway... it's the widget you have to access.
Have fun,
Sebastian
> --
> You received this message because you are subscribed to the Google
> Groups "VA Smalltalk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/va-smalltalk/-/f5SR1CA6I7QJ.
> To post to this group, send email to va-sma...@googlegroups.com.
> To unsubscribe from this group, send email to
> va-smalltalk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/va-smalltalk?hl=en.
You mean two colors within one TextView?
Okay,... that's not it,...
I'll have alook, but, never tried it.
From a first thought, you might need a new Part.
Sebastian
Am 18.11.2011 16:42, schrieb Mario Carrera:
With AbtTextView you won't be able to have two Colors within your widget.
AbtTextView uses OSEditWidget and this widget sets the whole text at a time.
What you might have to consider. is searching an other widgetclass under
VAST 6.0.1 which uses the method
OSWidget>>#drawText: aString x: anX y: aY width: aWidth height: aHeight
flags: flags
You may then try to override this method like this.
drawText: aString x: anX y: aY width: aWidth height: aHeight flags: flags
"Private - Draw aString using the platform dependant flags within
the rectangle described by the anX, aY, aWidth and aHeight
parameters. "
| text rect border nLeft nTop nRight nBottom |
aString isNil ifTrue:[^self].
self dcDo: [:hDC |
"Create the drawing rectangle for the text."
border := self borderWidth.
nLeft := anX - border.
nTop := aY - border.
nRight := (nLeft + aWidth min: width - (border * 2)).
nBottom := (nTop + aHeight min: height - (border * 2)).
(rect := OSRect new)
setRect: nLeft
nTop: nTop
nRight: nRight
nBottom: nBottom.
"Convert to a platform string before drawing."
text := PlatformString fromString: aString.
hDC
drawText: (text copyFrom: 1 to: (text size min: 10))
cb: (text size min: 10)
lprc: rect
fuFormat: flags.
text size > 10
ifTrue:[ hDC setTextColor: 16r000000 .
hDC
drawText: (text copyFrom: 10 to: text size)
cb: text size
lprc: rect
fuFormat: flags].
hDC setTextColor: 16rFFFFFF.
].
Im not 100% sure if this will work properly, but it should.
This means in the end that you will end up with a new
Abt/Cw/OSTextWidget-kombination.
Or you search for senders of setTextColor: ,.. maybe you find another
solution or existing class.
Cheers!
Sebastian
Am 18.11.2011 16:42, schrieb Mario Carrera:
You may want to add new attributes to all layers,... position of color
change and colors,...
If this is too much work for you, you could also use a MulitlineEditWidget.
There's codecoloring in VAST,.... StsPowertools include the coding. I'm not
to sure if you have those implementatiosn inyou VAST 6.0.1
Or, it is simply time to upgrade ;-)
John will love to assist you!
Sebastian
--
View this message in context: http://forum.world.st/Change-foreground-color-a-piece-of-fieldText-tp4083701p4091910.html
Sent from the Instantiations mailing list archive at Nabble.com.