+// this macro must be used in the derived class ctor
+#define WX_INIT_CONTROL_CONTAINER() \
+ m_container.SetContainerWindow(this)
+
+// common part of WX_DELEGATE_TO_CONTROL_CONTAINER in the native and generic
+// cases, must be used in the wxWindow-derived class implementation
+#define WX_DELEGATE_TO_CONTROL_CONTAINER_BASE(classname, basename) \
+ void classname::AddChild(wxWindowBase *child) \
+ { \
+ basename::AddChild(child); \
+ \
+ m_container.UpdateCanFocus(); \
+ } \
+ \
+ bool classname::AcceptsFocus() const \
+ { \
+ return m_container.AcceptsFocus(); \
+ }
+
+
+#ifdef wxHAS_NATIVE_TAB_TRAVERSAL
+
+// ----------------------------------------------------------------------------
+// wxControlContainer for native TAB navigation
+// ----------------------------------------------------------------------------
+
+// this must be a real class as we forward-declare it elsewhere
+class WXDLLEXPORT wxControlContainer : public wxControlContainerBase
+{
+};
+
+#define WX_EVENT_TABLE_CONTROL_CONTAINER(classname)
+
+#define WX_DECLARE_CONTROL_CONTAINER WX_DECLARE_CONTROL_CONTAINER_BASE
+
+#define WX_DELEGATE_TO_CONTROL_CONTAINER(classname, basename) \
+ WX_DELEGATE_TO_CONTROL_CONTAINER_BASE(classname, basename) \
+ \
+ void classname::RemoveChild(wxWindowBase *child) \
+ { \
+ basename::RemoveChild(child); \
+ \
+ m_container.UpdateCanFocus(); \
+ } \
+ \
+ void classname::SetFocusIgnoringChildren() \
+ { \
+ SetFocus(); \
+ }
+
+#else // !wxHAS_NATIVE_TAB_TRAVERSAL
+
+class WXDLLEXPORT wxFocusEvent;
+class WXDLLEXPORT wxNavigationKeyEvent;
+
+// ----------------------------------------------------------------------------
+// wxControlContainer for TAB navigation implemented in wx itself
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxControlContainer : public wxControlContainerBase
+{
+public:
+ // default ctor, SetContainerWindow() must be called later
+ wxControlContainer();