]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/pickerbase.cpp
MaskedEdit patch from Will Sadkin:
[wxWidgets.git] / src / common / pickerbase.cpp
index 68ff4a88ee0e9754c9e00772524b87bf20315fb0..ce5c4a2d5546ea4791b1e7bb8e3fb3bd9fc67f86 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        common/pickerbase.cpp
+// Name:        src/common/pickerbase.cpp
 // Purpose:     wxPickerBase class implementation
 // Author:      Francesco Montorsi
 // Modified by:
     #pragma hdrstop
 #endif
 
+#if wxUSE_COLOURPICKERCTRL || \
+    wxUSE_DIRPICKERCTRL    || \
+    wxUSE_FILEPICKERCTRL   || \
+    wxUSE_FONTPICKERCTRL
+
 #include "wx/pickerbase.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/textctrl.h"
+#endif
 
 // ============================================================================
 // implementation
@@ -59,7 +67,7 @@ bool wxPickerBase::CreateBase(wxWindow *parent,
     // remove any border style from our style as wxPickerBase's window must be
     // invisible (user styles must be set on the textctrl or the platform-dependent picker)
     style &= ~wxBORDER_MASK;
-    if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL, 
+    if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL,
                             validator, name))
         return false;
 
@@ -106,7 +114,7 @@ void wxPickerBase::OnTextCtrlKillFocus(wxFocusEvent &)
     wxASSERT(m_text);
 
     // don't leave the textctrl empty
-    if (m_text->GetValue().IsEmpty())
+    if (m_text->GetValue().empty())
         UpdateTextCtrlFromPicker();
 }
 
@@ -192,3 +200,10 @@ wxSize wxPickerBase::DoGetBestSize() const
 
     return ret;
 }
+
+void wxPickerBase::SetInternalMargin(int newmargin)
+{
+    m_margin = newmargin;
+}
+
+#endif // Any picker in use