]> git.saurik.com Git - wxWidgets.git/commitdiff
set/get validator for wxTextCtrl part of wxComboCtrl and not the combo itself (patch...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Nov 2006 14:44:30 +0000 (14:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Nov 2006 14:44:30 +0000 (14:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/combo.h
src/common/combocmn.cpp

index 886ea13a659a6fe867747d1123fc43d987eaa75c..3d730528766baf9862aadac23444d6d6f69b8a6c 100644 (file)
@@ -184,6 +184,10 @@ public:
     virtual bool Enable(bool enable = true);
     virtual bool Show(bool show = true);
     virtual bool SetFont(const wxFont& font);
+#if wxUSE_VALIDATORS
+    virtual void SetValidator(const wxValidator &validator);
+    virtual wxValidator *GetValidator();
+#endif // wxUSE_VALIDATORS
 
     // wxTextCtrl methods - for readonly combo they should return
     // without errors.
index a633163d30719a911163b9f504190a44e03edbdd..637c30952bd1d6815ae8ef3bdde503f581c004cf 100644 (file)
@@ -1149,6 +1149,26 @@ void wxComboCtrlBase::DoSetToolTip(wxToolTip *tooltip)
 }
 #endif // wxUSE_TOOLTIPS
 
+#if wxUSE_VALIDATORS
+void wxComboCtrlBase::SetValidator(const wxValidator& validator)
+{
+    wxTextCtrl* textCtrl = GetTextCtrl();
+
+    if ( textCtrl )
+        textCtrl->SetValidator( validator );
+}
+
+wxValidator* wxComboCtrlBase::GetValidator()
+{
+    wxTextCtrl* textCtrl = GetTextCtrl();
+
+    if ( textCtrl )
+        return textCtrl->GetValidator();
+
+    return wxControl::GetValidator();
+}
+#endif // wxUSE_VALIDATORS
+
 // ----------------------------------------------------------------------------
 // painting
 // ----------------------------------------------------------------------------