#include "wx/slider.h"
#endif
-#if wxUSE_SPINCTRL && !defined(__WIN16__)
+
#include "wx/spinctrl.h"
-#endif
-#if wxUSE_SPINBTN && !defined(__WIN16__)
+
+#if wxUSE_SPINBTN
#include "wx/spinbutt.h"
#endif
-#if wxUSE_CHECKLISTBOX && !defined(__WIN16__)
+#if wxUSE_CHECKLISTBOX
#include "wx/checklst.h"
#endif
#include "wx/valgen.h"
+IMPLEMENT_CLASS(wxGenericValidator, wxValidator)
+
wxGenericValidator::wxGenericValidator(bool *val)
{
Initialize();
#endif
// string controls
+#if wxUSE_BUTTON
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
return TRUE;
}
} else
+#endif
#if wxUSE_COMBOBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
{
{
pControl->SetStringSelection(* m_pString);
}
+ else
+ {
+ pControl->SetValue(* m_pString);
+ }
return TRUE;
}
} else
return TRUE;
}
} else
+#if wxUSE_TEXTCTRL
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
{
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
return TRUE;
}
} else
+#endif
// array controls
#if wxUSE_CHECKLISTBOX && !defined(__WIN16__)
// NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first:
} else
#endif
// string controls
+#if wxUSE_BUTTON
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
*m_pString = pControl->GetLabel() ;
return TRUE;
}
- }
- else
+ } else
+#endif
#if wxUSE_COMBOBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
{
return TRUE;
}
} else
+#if wxUSE_TEXTCTRL
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
{
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
return TRUE;
}
} else
+#endif
// array controls
#if wxUSE_CHECKLISTBOX
#ifndef __WIN16__