-void ComplexTransientPopup::OnKeyDown( wxKeyEvent &event )
-{
- if (GetChild() && GetChild()->ProcessEvent(event))
- event.Skip(false);
- else
- event.Skip(true);
-}
-
-void ComplexTransientPopup::Popup(wxWindow *focus)
-{
- SimpleTransientPopup::Popup(focus);
-
-#if USE_TIMER_TO_PUSHPOP
- // start the timer to track the mouse position
- // note: idle function not used in this case
- StartTimer();
-#else
- // note: all timer related functions aren't used in this case
- Connect(wxID_ANY, wxEVT_IDLE,
- (wxObjectEventFunction)(wxEventFunction)(wxIdleEventFunction)
- &ComplexTransientPopup::OnIdle, 0, this);
-#endif // USE_TIMER_TO_PUSHPOP
-}
-
-void ComplexTransientPopup::Dismiss()
-{
-#if USE_TIMER_TO_PUSHPOP
- StopTimer();
-#else // USE_TIMER_TO_PUSHPOP
- Disconnect(wxID_ANY, wxEVT_IDLE,
- (wxObjectEventFunction)(wxEventFunction)(wxIdleEventFunction)
- &ComplexTransientPopup::OnIdle, 0, this);
-#endif // USE_TIMER_TO_PUSHPOP
-
- // restore the event handler if necessary for the base class Dismiss
- wxWindow *child = GetChild();
- if (child) PushPopupHandler(child);
-
- m_popped_handler = false;
-
- SimpleTransientPopup::Dismiss();
-}
-
-bool ComplexTransientPopup::ProcessLeftDown( wxMouseEvent &event )
-{
- m_mouse = event.GetPosition();
- //wxPrintf(wxT("DropDownPopup::ProcessLeftDown %d %d\n"), m_mouse.x, m_mouse.y); fflush(stdout);
-
- if (m_popped_handler) return true; // shouldn't ever get here, but just in case
-
-#if USE_TIMER_TO_PUSHPOP
- StopTimer();
-#endif // USE_TIMER_TO_PUSHPOP
-
- // don't let the click on the dropdown button actually press it
- // *** Here's where we stick code to ensure that if we click on a combobox
- // dropdown box we don't try to reshow this dialog because they intend
- // hide it.
-
- if (wxRect(wxPoint(0,0), GetSize()).Inside(m_mouse))
- return false;
-
- Dismiss();
- return true;
-}
-