If you only need a string message / bitmap then drawing manually is by far the simplest solution.

If you want to use a real form and the progress manager does not suit you, then you can display it from the resource yourself... call FrmSaveActiveState, FrmInitForm, FrmSetActiveForm, FrmDrawForm to show, then FrmEraseForm, FrmDeleteForm and FrmRestoreActiveState to hide.

To check for a "Cancel" button I periodically poll the queue with EvtGetEvent, FrmHandleEvent (or better FrmDispatchEvent if you set the event handler to your form). Then check for a ctlSelectEvent on your button and get out of your processing loop.

Jerome



Robert Moynihan wrote:
Logan Shaw wrote:

Scott Erickson wrote:

Im looking to just pop up a box over the form that says please wait, or connection to server, or something like that. Its for a task that will take 3-6 seconds if there is a good connection to the internet. Or the netsocket functions will timeout after 20 secs. I simply want to put a please wait box over the current form. I dont need to update this text in anyway, and I dont need user input (but adding a cancel button there might be a good idea, but its not needed since the network lib fucntions have a pretty low timeout value).



You can always just do it manually:

Before you start whatever it is, pick a rectangle on the screen that
you want to draw your Please Wait thingy into.  Then, save its
contents with WinSaveBits(), draw a rectangle frame around it
with WinDrawRectangleFrame(), using a frame type of dialogFrame or
something along those lines (experiment), then draw the string
"Please Wait" centered in the middle of this rectangle with
WinDrawChars().

Then, do your processing, then finally do WinRestoreBits() to
put the screen back like it was before you messed with it.


That is the way that I have done it on many occasions. You'll have full control over what get drawn when, and you don't have to worry about which forms you are switching around. Remember that when you draw the frame that it gets drawn to the outside of the rectangle, so it won't be fixed after the simple WinRestoreBits() command using the same rect. What I do is to define a rect, save bits, offset the rectangle to be a little smaller, erase rect, draw the frame, do processing while drawing whatever you want in the rect (could be a progress bar, count,...), offset back to original size, WinRestore using restored rect coords. This way I only define one rect, so it's fairly easy to keep things straight. Bob


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

Reply via email to