git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40135
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// soon after a call to SetTmpDefaultItem(window)
void SetTmpDefaultItem(wxWindow *win) { m_winTmpDefault = win; }
// soon after a call to SetTmpDefaultItem(window)
void SetTmpDefaultItem(wxWindow *win) { m_winTmpDefault = win; }
+ // return the temporary default item, can be NULL
+ wxWindow *GetTmpDefaultItem() const { return m_winTmpDefault; }
+
+
// the methods to be called from the window event handlers
void HandleOnNavigationKey(wxNavigationKeyEvent& event);
void HandleOnFocus(wxFocusEvent& event);
// the methods to be called from the window event handlers
void HandleOnNavigationKey(wxNavigationKeyEvent& event);
void HandleOnFocus(wxFocusEvent& event);
virtual wxWindow *GetDefaultItem() const; \
virtual wxWindow *SetDefaultItem(wxWindow *child); \
virtual void SetTmpDefaultItem(wxWindow *win); \
virtual wxWindow *GetDefaultItem() const; \
virtual wxWindow *SetDefaultItem(wxWindow *child); \
virtual void SetTmpDefaultItem(wxWindow *win); \
+ virtual wxWindow *GetTmpDefaultItem() const; \
virtual bool AcceptsFocus() const; \
\
protected: \
virtual bool AcceptsFocus() const; \
\
protected: \
return m_container.GetDefaultItem(); \
} \
\
return m_container.GetDefaultItem(); \
} \
\
+wxWindow *classname::GetTmpDefaultItem() const \
+{ \
+ return m_container.GetTmpDefaultItem(); \
+} \
+ \
void classname::OnNavigationKey( wxNavigationKeyEvent& event ) \
{ \
m_container.HandleOnNavigationKey(event); \
void classname::OnNavigationKey( wxNavigationKeyEvent& event ) \
{ \
m_container.HandleOnNavigationKey(event); \
// set this child as temporary default
virtual void SetTmpDefaultItem(wxWindow * WXUNUSED(win)) { }
// set this child as temporary default
virtual void SetTmpDefaultItem(wxWindow * WXUNUSED(win)) { }
+ // return the temporary default item, can be NULL
+ virtual wxWindow *GetTmpDefaultItem() const { return NULL; }
+
// navigates in the specified direction by sending a wxNavigationKeyEvent
virtual bool Navigate(int flags = wxNavigationKeyEvent::IsForward);
// navigates in the specified direction by sending a wxNavigationKeyEvent
virtual bool Navigate(int flags = wxNavigationKeyEvent::IsForward);
+ wxWindow *parent = GetParent();
+ if ( parent && parent->GetTmpDefaultItem() == this )
+ {
+ UnsetTmpDefault();
+ }
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------