From 29604c85d6ff8f4cd1eaa19adf41862372ea4c54 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Nov 2012 12:49:29 +0000 Subject: [PATCH] Make wxSpinCtrlGenericBase a wxCompositeWindow. This takes care of propagating methods setting fonts and colours to the subwindows automatically, so that setting font for the generic wxSpinCtrl now works, unlike before. Closes #14839. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/spinctlg.h | 8 +++++++- src/generic/spinctlg.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 61c38b6a56..8ceedf767a 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -22,6 +22,8 @@ #if wxUSE_SPINBTN +#include "wx/compositewin.h" + class WXDLLIMPEXP_FWD_CORE wxSpinButton; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; @@ -40,7 +42,8 @@ class wxSpinCtrlTextGeneric; // wxTextCtrl used for the wxSpinCtrlGenericBase // function ambiguity. // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase : public wxSpinCtrlBase +class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase + : public wxCompositeWindow { public: wxSpinCtrlGenericBase() { Init(); } @@ -156,6 +159,9 @@ private: // common part of all ctors void Init(); + // Implement pure virtual function inherited from wxCompositeWindow. + virtual wxWindowList GetCompositeWindowParts() const; + DECLARE_EVENT_TABLE() }; diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 64d00b43ff..0041895fd3 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -269,6 +269,14 @@ wxSpinCtrlGenericBase::~wxSpinCtrlGenericBase() wxDELETE(m_spinButton); } +wxWindowList wxSpinCtrlGenericBase::GetCompositeWindowParts() const +{ + wxWindowList parts; + parts.push_back(m_textCtrl); + parts.push_back(m_spinButton); + return parts; +} + // ---------------------------------------------------------------------------- // geometry // ----------------------------------------------------------------------------