]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxSpinCtrlGenericBase a wxCompositeWindow.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Nov 2012 12:49:29 +0000 (12:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Nov 2012 12:49:29 +0000 (12:49 +0000)
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
src/generic/spinctlg.cpp

index 61c38b6a56f7fdf116ec887494906fe48656c71e..8ceedf767ac267a3672ac4d73edc9523950503f0 100644 (file)
@@ -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<wxSpinCtrlBase>
 {
 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()
 };
 
index 64d00b43ffa7e05542077dae0d069d2998d18ef5..0041895fd34547dc8fa00dda4f9273d916d2cebf 100644 (file)
@@ -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
 // ----------------------------------------------------------------------------