- virtual void Popup(wxWindow *focus = NULL);
- virtual void Dismiss();
- virtual bool ProcessLeftDown(wxMouseEvent& event);
-
-protected:
-
- // safely push and pop the event handler of the child
- void PushPopupHandler(wxWindow* child);
- void PopPopupHandler(wxWindow* child);
-
- void OnMouse( wxMouseEvent& event );
- void OnKeyDown( wxKeyEvent &event );
-
-#if USE_TIMER_TO_PUSHPOP
- // start/stop timer that pushes and pops handler when the mouse goes over
- // the scrollbars (if any) of the child window
- void StartTimer();
- void StopTimer();
- void OnTimer( wxTimerEvent& event );
- wxTimer *m_timer; // timer for tracking mouse position
-#else // !USE_TIMER_TO_PUSHPOP
- void OnIdle( wxIdleEvent& event );
-#endif // USE_TIMER_TO_PUSHPOP
-
- wxPoint m_mouse; // last/current mouse position
- bool m_popped_handler; // state of the event handler
-
-private:
- void Init();
- DECLARE_EVENT_TABLE()
-};
-
-//----------------------------------------------------------------------------
-// ComplexTransientPopup
-//----------------------------------------------------------------------------
-BEGIN_EVENT_TABLE(ComplexTransientPopup, SimpleTransientPopup)
- EVT_KEY_DOWN(ComplexTransientPopup::OnKeyDown)
- EVT_MOUSE_EVENTS(ComplexTransientPopup::OnMouse)
-#if USE_TIMER_TO_PUSHPOP
- EVT_TIMER( wxID_ANY, ComplexTransientPopup::OnTimer )
-#endif // USE_TIMER_TO_PUSHPOP
-END_EVENT_TABLE()
-
-void ComplexTransientPopup::Init()
-{
-#if USE_TIMER_TO_PUSHPOP
- m_timer = NULL;
-#endif // USE_TIMER_TO_PUSHPOP
- m_popped_handler = false;
-}
-
-ComplexTransientPopup::~ComplexTransientPopup()
-{
-#if USE_TIMER_TO_PUSHPOP
- StopTimer();
-#endif // USE_TIMER_TO_PUSHPOP
-}
-
-void ComplexTransientPopup::PushPopupHandler(wxWindow* child)
-{
- if (child && m_handlerPopup && m_popped_handler)
- {
- m_popped_handler = false;
-
- if (child->GetEventHandler() != (wxEvtHandler*)m_handlerPopup)
- child->PushEventHandler((wxEvtHandler*)m_handlerPopup);
- if (!child->HasCapture())
- child->CaptureMouse();
-
- child->SetFocus();
- }
-}
-void ComplexTransientPopup::PopPopupHandler(wxWindow* child)
-{
- if (child && m_handlerPopup && !m_popped_handler)