]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valgen.cpp
DoGetSize implementation corrected
[wxWidgets.git] / src / common / valgen.cpp
index ee65e02c47fd54022d5b4d4ddaa30c5ce3c1ea16..6b8e98e061529cc915b8690576f0fd45008dd160 100644 (file)
   #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();
@@ -81,6 +83,7 @@ wxGenericValidator::wxGenericValidator(wxArrayInt *val)
 }
 
 wxGenericValidator::wxGenericValidator(const wxGenericValidator& val)
+    : wxValidator()
 {
     Copy(val);
 }
@@ -224,6 +227,10 @@ bool wxGenericValidator::TransferToWindow(void)
             {
                 pControl->SetStringSelection(* m_pString);
             }
+            else
+            {
+                pControl->SetValue(* m_pString);
+            }
             return TRUE;
         }
     } else
@@ -442,7 +449,7 @@ bool wxGenericValidator::TransferFromWindow(void)
     }
     else if (m_pString)
     {
-        *m_pString = pControl->GetStringSelection();
+        *m_pString = pControl->GetValue();
         return TRUE;
     }
   } else