[WASTE-list] Re: RGBBackColor() support in WASTE 3.0

Marco Piovanelli marco.piovanelli at pobox.com
Wed Aug 30 05:31:27 EDT 2006


On Mon, 28 Aug 2006 22:31:14 -0400,
Jay Koutavas (jay at heynow.com) wrote:



>Marco,

>

>It appears as though RGBBackColor() support has broke with WASTE

>3.0d1. Only the text displayed gets the background color, not the

>entire pane being painted to. This worked okay with WTextView and

>WASTE 2.1b1. Do I need to take an additional step to get it to work

>with 3.0?


Yes. In WASTE 3.0, you need to set the background color of the
view using WESetViewInfo() with the weBackgroundColor selector.
If you created your WASTE instance using WENew(), you can obtain
a pointer to its only associated view using WEGetCurrentView().

The background color must be expressed as an ATSURGBAlphaColor
record, which, unlike RGBColor, includes an alpha channel.
You can probably set this to 1.0 (fully opaque).

Here's some code that should do what you want -- I'm assuming
you're trying to update the WTextView::ApplyForeAndBackColors()
method in the WText wrapper:

void
WTextView::ApplyForeAndBackColors() const
{
// ... code to apply colors in previous versions of WASTE ...

WEViewReference view = WEGetCurrentView(GetWEHandle());
ATSURGBAlphaColor atsuColor;

atsuColor.red = static_cast<float>(mBackColor.red) / 65535.0f;
atsuColor.green = static_cast<float>(mBackColor.green) / 65535.0f;
atsuColor.blue = static_cast<float>(mBackColor.blue) / 65535.0f;
atsuColor.alpha = 1.0f;

ThrowIfOSErr_(WESetViewInfo(weBackgroundColor, &atsuColor, view));
}

Hope this helps,


-- marco

--
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.



More information about the WASTE-list mailing list