Re: How to stop fields from writing over a menu?

2004-01-31 Thread Robert Moynihan
I think I found this in one of the white papers.  I had the same kind of 
problem, and it has proven to be a good solution.  Use the winExit and 
winEnter events to detect if you have exited from the current window.  
If so, stop drawing.

 case winExitEvent:   
   if (eptr->data.winExit.exitWindow == (WinHandle) 
FrmGetFormPtr(parentForm)) {
   menuIsOpen=true; // stop drawing.
   }
   break;
 case winEnterEvent:
   if (eptr->data.winExit.enterWindow == (WinHandle) 
FrmGetFormPtr(parentForm)
   && eptr->data.winExit.enterWindow == (WinHandle) 
FrmGetFirstForm()) {
   menuIsOpen=false; // start drawing.
   }
   break;

Bob.

Luc Le Blanc wrote:

Matt Graham a écrit :

 

Jim White wrote:
   

I have noted that when I bring up a menu over some fields that are
being re-written at regular intervals, the data in the field
over-writes the menu.
I have tried triggering on various things (like MenuOpenEvent to hide
the fields and MenuEvent to re-enable them) but I can't seem to get
consistency in the events (I get 3 MenuOpenEvents, followed by a
winExitEvent, followed by two MenuOpenEvents when I open the menu,
for example).
Is there a clean and easy way to stop displayed fields, buttons, etc.
from overwriting an open menu?
 

You could try hiding the offending fields when the menu opens and
showing them again when it closes.
   

How do you know the menu closes? The API Reference states the menuCloseEvent is
not implemented :(
--
Luc Le Blanc


 



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


Re: How to stop fields from writing over a menu?

2004-01-31 Thread Laurie Davis
I solved the problem in my application in the following way.

I use the nilEvent to update some fields dynamically. This was
causing a problem when the menu was opened on top of
the fields. I simply changed the code in the nilEvent to only
update the fields when the main form was the active form:

if (FormPtr(WinGetActiveWindow()) == frmPtr)
{
}


Laurie




"Luc Le Blanc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Matt Graham a écrit :

> Jim White wrote:
> > I have noted that when I bring up a menu over some fields that are
> > being re-written at regular intervals, the data in the field
> > over-writes the menu.
> >
> > I have tried triggering on various things (like MenuOpenEvent to hide
> > the fields and MenuEvent to re-enable them) but I can't seem to get
> > consistency in the events (I get 3 MenuOpenEvents, followed by a
> > winExitEvent, followed by two MenuOpenEvents when I open the menu,
> > for example).
> >
> > Is there a clean and easy way to stop displayed fields, buttons, etc.
> > from overwriting an open menu?
>
> You could try hiding the offending fields when the menu opens and
> showing them again when it closes.

How do you know the menu closes? The API Reference states the menuCloseEvent
is
not implemented :(


--
Luc Le Blanc





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


Re: How to stop fields from writing over a menu?

2004-01-31 Thread Luc Le Blanc
Matt Graham a écrit :

> Jim White wrote:
> > I have noted that when I bring up a menu over some fields that are
> > being re-written at regular intervals, the data in the field
> > over-writes the menu.
> >
> > I have tried triggering on various things (like MenuOpenEvent to hide
> > the fields and MenuEvent to re-enable them) but I can't seem to get
> > consistency in the events (I get 3 MenuOpenEvents, followed by a
> > winExitEvent, followed by two MenuOpenEvents when I open the menu,
> > for example).
> >
> > Is there a clean and easy way to stop displayed fields, buttons, etc.
> > from overwriting an open menu?
>
> You could try hiding the offending fields when the menu opens and
> showing them again when it closes.

How do you know the menu closes? The API Reference states the menuCloseEvent is
not implemented :(


--
Luc Le Blanc



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


Re: How to stop fields from writing over a menu?

2004-01-30 Thread Matt Graham
Jim White wrote:
I have noted that when I bring up a menu over some fields that are
being re-written at regular intervals, the data in the field
over-writes the menu.
I have tried triggering on various things (like MenuOpenEvent to hide
the fields and MenuEvent to re-enable them) but I can't seem to get
consistency in the events (I get 3 MenuOpenEvents, followed by a
winExitEvent, followed by two MenuOpenEvents when I open the menu,
for example).
Is there a clean and easy way to stop displayed fields, buttons, etc.
from overwriting an open menu?
You could try hiding the offending fields when the menu opens and
showing them again when it closes.
Maybe calling MenuDrawMenu() right after setting the fields would help too.
Not sure about this, but I think you have to call FldDrawField()
explicitly to update a field after updating its text.  If you're using a
function to hide this call, you might want to try setting these fields
w/o redrawing.
matt

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