Color? I'm still using the 3.1 SDK
Maybe someday I'll move up.
-----Original Message-----
From: David Fedor <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Thursday, May 11, 2000 12:47 PM
Subject: Re: frameless listbox
>>for anyone who might be interested...
>>If you call WinEraseRectangleFrame(rectangleFrame,&(pListPtr->bounds));
>>after each time the list is drawn, the list's frame doesn't display
>
>That'll probably work fine, as long as the background color is set
>correctly. But, that could well have ugly results if the user has
>nonstandard colors for the UI elements (i.e. not black and white) or if
>you've been doing some color drawing and haven't reset the pen colors to
>the right thing.
>
>What you'd need to do, to make sure it looked right on a color screen where
>the user has changed the defaults (for instance through some 3rd party
>software like Chrome) is to call UIColorGetTableEntryIndex to get the form
>(or dialog) background color and pass that to WinSetBackColor. Then when
>you call WinEraseRectangleFrame, it'll draw the rectangle using the
>background color you set.
>
>Or you could make things conceptually simpler and set the foreground color
>to the form or dialog background color and call WinDrawRectangleFrame.
>Same result in either case.
>
>I suppose going the "erase" route would be easier so that less code needs
>to be in a "3.5 only" condition.
>
>In short:
> IndexedColorType oldBack;
> if (weAreOnPalmOS35OrHigher)
> oldBack = WinSetBackColor(UIColorGetTableEntryIndex(UIFormFill or
>UIDialogFill));
> WinEraseRectangleFrame (rectangleFrame,&(pListPtr->bounds));
> if (weAreOnPalmOS35OrHigher) // reset the background color if you need
to
> WinSetBackColor(oldBack);
>
>
>>Attempting to erase the
>>frame from within the list draw callback doesn't work.
>
>That's because the clipping region has been set to prevent accidental
>drawing outside of the list item's bounds. You could reset the clipping
>region if you wanted, and do the drawing in there. A "gotcha" in there is
>that under 3.5 the list draw callback is called with different foreground
>and background colors, to get your callback to highlight the selected item.
>Prior to 3.5, it used to just invert the list item for you, but in a
>colorful world inverting might not do the right thing. So you can get
>called in different circumstances with different pen colors chosen.
>
>-David Fedor
>Palm Developer Support
>
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/