I need to detect when the user (after tapping on a popup trigger to pop 
up a list) does not select an item from the list but rather taps 
outside the list or, if using the 5-way control, presses Left or Right 
to escape from the list.

There does not appear to be any event related to popSelectEvent.  The 
API docs for LstHandleEvent merely say "If a penDownEvent is received 
while the list's popup window is displayed and the pen position is 
outside the bounds of the popup window, the window is dismissed."

The next obvious candidate is a winExit or winEnter event, going from 
the list popup window to the form window.  The window pointer for the 
form is easy enough to obtain, but winEnter with enterWindow equal to 
the form window pointer happens in many other circumstances, including 
menu commands.   I cannot find any "approved" API for getting the 
window pointer for the list popup window.  The popupWin field of 
ListType contains the "handle of the window created when a list is 
displayed by calling LstPopupList()", but I'm not seeing a match 
between this and the exitWindow field of winExit or winEnter.   
Possibly it is no longer valid if the window has already been disposed 
of.   The switch stament in my MainFormHandleEvent includes:

                        case winEnterEvent:
                                if (eventP->data.winEnter.enterWindow == 
(WinPtr)g.mainFormP) {
                                        ListPtr listP;
                                        
                                        listP = FrmGetObjectPtr(g.mainFormP, 
FrmGetObjectIndex(g.mainFormP, PresetList));
                                        if (eventP->data.winEnter.exitWindow == 
(WinPtr)(listP->popupWin)) 
{
                                                TurnPreviewOrOverlayOnIfOk();
                                        }
                                }
                                break;
                                
                        case winExitEvent:
                                listP = FrmGetObjectPtr(g.mainFormP, 
FrmGetObjectIndex(g.mainFormP, 
PresetList));
                                if (eventP->data.winExit.exitWindow == 
(WinPtr)(listP->popupWin)) {
                                        TurnPreviewOrOverlayOnIfOk();
                                }
                                break;


... where g.mainFormP is a pointer to the form and PresetList is the 
resource ID of the popup list.  (Yes, one listP variable shadows the 
other, but that doesn't matter.)   Also, it would be nice not to access 
popupWin directly, as ListType is supposed to be an opaque type.

Any suggestions?

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to