On Thu, Apr 27, 2000 at 11:30:15AM -0700, Peter Epstein wrote:
> If you want to be extra-safe, instead of using ResetClip, used WinSetClip
> again to set it back to what it was before (which you get using WinGetClip).
> This allows your code to be used within another routine which itself sets
> the clipping rectangle.
And to extra-extra-safe, you may want to clip the initial rect used in
the first WinSetClip to the clipping region that is in effect at the
time you call WinSetClip, eg:
// save current clipping region
WinGetClip(&saveRect);
// set new clipping region to the intersection of
// the current clipping region and the rect
WinClipRectangle(&rect) ;
// optionally check if x or y extents on rect are zero, and return
// early if so (since this means all drawing will lie outside the
// clipping region, and so won't be drawn)
WinSetClip(&rect);
// draw the string
WinDrawChars(myString, count, rect.topLeft.x, rect.topLeft.y);
// restore the original clipping region
WinSetClip(&saveRect);
This will, eg, protect any forms which overlay your list form (such as
a dialog box) from being overwritten whenever your list form receives
a frmUpdateEvent.
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html