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).

I am getting this problem on a 3.5 dr4 en color dbg ROM on POSE 3.4, but 
haven't been able to recreate the two modal dialogs on other ROMs.

I have also tried using WinGetClip and WinSetClip instead of WinResetClip, 
but it didn't help.

Any thoughts are welcome.

Matt


Here is the gadget draw code:

         WinPushDrawState();
         oldFont = FntSetFont(newFont);
         WinSetTextColor(UIColorGetTableEntryIndex(UIFieldText));
         WinSetForeColor(UIColorGetTableEntryIndex(UIFieldTextLines));
         WinSetBackColor(UIColorGetTableEntryIndex(UIFieldBackground));

         GuiGetFormObjectBounds(FrmGetActiveForm(), MessageViewContentGadget,
                 &bounds);
         WinSetClip(&bounds);
         WinEraseRectangle(&bounds, 0);

// Draw some stuff here.

         WinResetClip();
         FntSetFont(oldFont);
         WinPopDrawState();


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

Reply via email to