I have a function that I use to display "Please Wait" bitmaps when I am
retrieving large lists from my database. I like this function because I have
a good amount of control over when it gets displayed and erased, and I don't
need any user input.

The problem I have is that when an alert displays over top of it I get an
emulator message "Windows can't be under forms because they can't be
redrawn". I understand what the message is telling me and why I am getting
it. So is there an "accepted" way to display the type of wait dialog that I
am displaying? The function I use is as follows:

void PopUpWindowV20(int bmp, int toggle,int left,int top,int width,int
height)
{
        RectangleType   rect;
        Word            err;
        Err                     error;
        WinHandle formWin;
        static Handle           resH;
        static BitmapPtr        resP;
        static WinHandle        win;

        if(toggle == ON){
                RctSetRectangle(&rect,left,top,width,height);
                resH = DmGetResource( bitmapRsc, bmp);
                ErrFatalDisplayIf( !resH, "Missing bitmap" );
                resP = (BitmapPtr)MemHandleLock(resH);

                win=WinCreateWindow(&rect,dialogFrame,true,true,&err);

                if(!err){
                        //WinEnableWindow(win);
                        WinSetActiveWindow(win);
                        WinSetDrawWindow(win);
                        WinDrawWindowFrame();
                        WinDrawBitmap (resP, 0,0);
                }
        }

        if(toggle == OFF){
                WinDeleteWindow(win,true);
                error=MemHandleUnlock(resH);
                //if(error) FrmCustomAlert(CustomAlert,"Unlock problem in
PopUpWindow.",NULL,NULL);

                formWin=FrmGetWindowHandle(FrmGetActiveForm());
                //WinEnableWindow(formWin);
                WinSetActiveWindow(formWin);
                FrmUpdateForm(FrmGetActiveFormID(),frmRedrawUpdateCode);
        }
}

Thanks,
Phil Lachmann



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

Reply via email to