Replace wxControlContainer-related macros with wxNavigationEnabled<>.

Simply inherit classes which need to provide TAB navigation among their
children from wxNavigationEnabled<> and remove the now unnecessary
WX_DECLARE_CONTROL_CONTAINER() macros.

Also remove WX_INIT_CONTROL_CONTAINER(), WX_DELEGATE_TO_CONTROL_CONTAINER()
and WX_EVENT_TABLE_CONTROL_CONTAINER() which are not needed neither any more.

And remove the event tables which became empty after removing the last macro.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-07-24 22:19:33 +00:00
parent 7e0a200b08
commit 9023040798
17 changed files with 31 additions and 122 deletions

View File

@@ -502,18 +502,22 @@ protected:
class WXDLLIMPEXP_AUI wxAuiNotebook : public wxControl
class WXDLLIMPEXP_AUI wxAuiNotebook : public wxNavigationEnabled<wxControl>
{
public:
wxAuiNotebook();
wxAuiNotebook() { Init(); }
wxAuiNotebook(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_NB_DEFAULT_STYLE);
long style = wxAUI_NB_DEFAULT_STYLE)
{
Init();
Create(parent, id, pos, size, style);
}
virtual ~wxAuiNotebook();
@@ -595,6 +599,9 @@ public:
virtual void Thaw();
protected:
// Common part of all ctors.
void Init();
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
@@ -665,9 +672,6 @@ protected:
DECLARE_CLASS(wxAuiNotebook)
DECLARE_EVENT_TABLE()
#endif
WX_DECLARE_CONTROL_CONTAINER();
};

View File

@@ -25,7 +25,8 @@ class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle;
// wxGenericCollapsiblePane
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane : public wxCollapsiblePaneBase
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane :
public wxNavigationEnabled<wxCollapsiblePaneBase>
{
public:
wxGenericCollapsiblePane() { Init(); }
@@ -103,7 +104,6 @@ private:
void OnButton(wxCommandEvent &ev);
void OnSize(wxSizeEvent &ev);
WX_DECLARE_CONTROL_CONTAINER();
DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane)
DECLARE_EVENT_TABLE()
};

View File

@@ -49,7 +49,7 @@ enum
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
// standard).
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxWindow
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxNavigationEnabled<wxWindow>
{
public:
@@ -300,8 +300,6 @@ protected:
bool m_checkRequestedSashPosition:1;
private:
WX_DECLARE_CONTROL_CONTAINER();
DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxSplitterWindow);

View File

@@ -25,7 +25,13 @@ class wxComboBoxChoice;
class wxComboWidgetImpl;
// Combobox item
class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
class WXDLLIMPEXP_CORE wxComboBox :
#if wxOSX_USE_CARBON
public wxNavigationEnabled<wxControl>,
#else
public wxControl,
#endif
public wxComboBoxBase
{
DECLARE_DYNAMIC_CLASS(wxComboBox)
@@ -42,7 +48,7 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
virtual void DelegateTextChanged( const wxString& value );
virtual void DelegateChoice( const wxString& value );
wxComboBox() { Init(); }
wxComboBox() { }
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
@@ -53,7 +59,6 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Init();
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
@@ -66,7 +71,6 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Init();
Create(parent, id, value, pos, size, choices, style, validator, name);
}
@@ -142,17 +146,12 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
#if wxOSX_USE_CARBON
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
WX_DECLARE_CONTROL_CONTAINER();
#endif
#if wxOSX_USE_COCOA
wxComboWidgetImpl* GetComboPeer() const;
#endif
protected:
// common part of all ctors
void Init();
// List functions
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoClear();
@@ -187,10 +186,6 @@ protected:
wxComboBoxChoice* m_choice;
wxComboBoxDataArray m_datas;
#if wxOSX_USE_CARBON
DECLARE_EVENT_TABLE()
#endif
};
#endif // _WX_COMBOBOX_H_

View File

@@ -33,7 +33,7 @@ class WXDLLIMPEXP_FWD_CORE wxSpinCtrlButton;
// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxControl
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxNavigationEnabled<wxControl>
{
public:
wxSpinCtrl() { Init(); }
@@ -93,8 +93,6 @@ public:
// number is out of range
bool GetTextValue(int *val) const;
WX_DECLARE_CONTROL_CONTAINER();
protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestSize() const;
@@ -113,7 +111,6 @@ private:
int m_oldValue;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
};

View File

@@ -28,10 +28,10 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[];
// wxPanel contains other controls and implements TAB traversal between them
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPanelBase : public wxWindow
class WXDLLIMPEXP_CORE wxPanelBase : public wxNavigationEnabled<wxWindow>
{
public:
wxPanelBase();
wxPanelBase() { }
// Derived classes should also provide this constructor:
/*
@@ -69,14 +69,10 @@ public:
virtual void InitDialog();
WX_DECLARE_CONTROL_CONTAINER();
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxPanelBase);
};

View File

@@ -32,12 +32,12 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[];
#define wxPB_USE_TEXTCTRL 0x0002
class WXDLLIMPEXP_CORE wxPickerBase : public wxControl
class WXDLLIMPEXP_CORE wxPickerBase : public wxNavigationEnabled<wxControl>
{
public:
// ctor: text is the associated text control
wxPickerBase() : m_text(NULL), m_picker(NULL), m_sizer(NULL)
{ WX_INIT_CONTROL_CONTAINER(); }
{ }
virtual ~wxPickerBase() {}
@@ -179,9 +179,6 @@ protected:
private:
DECLARE_ABSTRACT_CLASS(wxPickerBase)
DECLARE_EVENT_TABLE()
// This class must be something just like a panel...
WX_DECLARE_CONTROL_CONTAINER();
};

View File

@@ -157,7 +157,8 @@ enum
// wxTopLevelWindow: a top level (as opposed to child) window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTopLevelWindowBase : public wxNonOwnedWindow
class WXDLLIMPEXP_CORE wxTopLevelWindowBase :
public wxNavigationEnabled<wxNonOwnedWindow>
{
public:
// construction
@@ -352,7 +353,6 @@ protected:
wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase);
DECLARE_EVENT_TABLE()
WX_DECLARE_CONTROL_CONTAINER();
};