return handled
What is actually happening when you say"handled = true"? Sometimes I get "Form already loaded" issues if I use it incorrectly. My latest issue involves setting a global variable in my closeEvent. If I use handled = true, it works OK the first time though, but the next time I come to this form, I get the error that the form was already loaded. Ex: case frmCloseEvent:Refresh2 = true;break; thanks, ~Tony -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: return handled
Tony Janke wrote: What is actually happening when you say handled = true? Sometimes I get Form already loaded issues if I use it incorrectly. My latest issue involves setting a global variable in my closeEvent. If I use handled = true, it works OK the first time though, but the next time I come to this form, I get the error that the form was already loaded. When you return with a value of true, you are basically telling the system that you have fully handled the event, and that the system must not do any of its own processing to handle it. By returning true you can do things like block penDown and keyDown events from getting to the system. You can also block such things as SysHandleEvent(), MenuHandleEvent() or FrmDispatchEvent() from handling their events, and it sounds like this is what might be happening. You really only return true when you actually handle the event in your code, and the default return value should always be false, in my experience. Bob -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
A novice question - When do I need to return handled = true?
I thought that we need to return handled = true whenever we have handled the event properly, but I found that if I return true for frmCloseEvent, I need to do FrmEraseForm or the form will not be erase. However, I don't need to erase the form if I return false. Also for ctlRepeatEvent, it doesn't work if I return true. So when do I have to return true? Sorry for asking a simple question. Jacky -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: A novice question - When do I need to return handled = true?
"Jacky Cheung" [EMAIL PROTECTED] wrote: I thought that we need to return handled = true whenever we have handled the event properly, but I found that if I return true for frmCloseEvent, I need to do FrmEraseForm or the form will not be erase. However, I don't need to erase the form if I return false. Also for ctlRepeatEvent, it doesn't work if I return true. So when do I have to return true? In general, return true if you don't want the system to perform the default action for the event. Return false if you do. The PalmOS Reference usually documents the behavior. For instance: If you return true in response to a ctlRepeatEvent, it stops the ctlRepeatEvent loop. No further ctlRepeatEvents are sent. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
RE: A novice question - When do I need to return handled = true?
Thanks. I get it now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mark Smith Sent: Friday, February 02, 2001 12:10 PM To: Palm Developer Forum Subject: Re: A novice question - When do I need to return handled = true? "Jacky Cheung" [EMAIL PROTECTED] wrote: I thought that we need to return handled = true whenever we have handled the event properly, but I found that if I return true for frmCloseEvent, I need to do FrmEraseForm or the form will not be erase. However, I don't need to erase the form if I return false. Also for ctlRepeatEvent, it doesn't work if I return true. So when do I have to return true? In general, return true if you don't want the system to perform the default action for the event. Return false if you do. The PalmOS Reference usually documents the behavior. For instance: If you return true in response to a ctlRepeatEvent, it stops the ctlRepeatEvent loop. No further ctlRepeatEvents are sent. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/