]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valgen.cpp
Unused warning fix.
[wxWidgets.git] / src / common / valgen.cpp
index f7daf5556d3c09526aa4e83c7a6d79dd01a60f29..7119e95c4a864bb8c7b215639d6c5caeb4cc1d70 100644 (file)
@@ -100,10 +100,6 @@ bool wxGenericValidator::Copy(const wxGenericValidator& val)
     return true;
 }
 
-wxGenericValidator::~wxGenericValidator()
-{
-}
-
 // Called to transfer data to the window
 bool wxGenericValidator::TransferToWindow(void)
 {
@@ -229,7 +225,7 @@ bool wxGenericValidator::TransferToWindow(void)
             {
                 pControl->SetStringSelection(* m_pString);
             }
-            else
+            if ((m_validatorWindow->GetWindowStyle() & wxCB_READONLY) == 0)
             {
                 pControl->SetValue(* m_pString);
             }
@@ -454,7 +450,10 @@ bool wxGenericValidator::TransferFromWindow(void)
     }
     else if (m_pString)
     {
-        *m_pString = pControl->GetValue();
+        if (m_validatorWindow->GetWindowStyle() & wxCB_READONLY)
+            *m_pString = pControl->GetStringSelection();
+        else
+            *m_pString = pControl->GetValue();
         return true;
     }
   } else