In article <84559@palm-dev-forum>, [EMAIL PROTECTED] 
says...
> 
> I was wondering if anyone could shed some light on how to restore the clip 
> properly.
> 
> I have a gadget and I set the clip to the bounds of the gadget before 
> drawing the gadget, then reset the clip (WinResetClip). All works fine 
> except for the case where I get a modal dialog followed by another modal 
> dialog. (In case it matters the two dialogs are the "Receive into Address" 
> and "The data was not accepted" in the Exchange Manager.) The second modal 
> dialog is missing some of its background and title where it intersects with 
> the gadget on the main form. However, the alert icon and message are 
> displayed even though they cover my gadget.
> 
> The app receives a FrmUpdateForm between the two modal forms. If I comment 
> out the FrmDrawForm here, the second dialog draws OK.
> 
> Or, if I comment out the WinSetClip and WinResetClip in the gadget drawing 
> function, the second modal dialog draws OK (although the gadget draws 
> outside its bounds).

Rather than use WinResetClip, you should use WinGetClip to get your 
current clipping area, then create an intersection of that with your 
clipping rectangle using RctGetIntersection, and then call WinSetClip 
for the new clipping rectangle and use that when drawing your gadget.  
When you finish, call WinSetClip with the original clipping rectangle.  
Using WinResetClip during a frmUpdateEvent interferes with how the OS 
redraws stacked windows.


-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Get help at http://palmoswerks.com/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to