]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug in setting/getting value for wxComboBox. Read-only status
authorJulian Smart <julian@anthemion.co.uk>
Mon, 1 Nov 2004 15:58:56 +0000 (15:58 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 1 Nov 2004 15:58:56 +0000 (15:58 +0000)
is taken into account.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/valgen.cpp

index f6dc6d5202a9f6323160d74672ddef84b20e4758..7119e95c4a864bb8c7b215639d6c5caeb4cc1d70 100644 (file)
@@ -225,7 +225,7 @@ bool wxGenericValidator::TransferToWindow(void)
             {
                 pControl->SetStringSelection(* m_pString);
             }
-            else
+            if ((m_validatorWindow->GetWindowStyle() & wxCB_READONLY) == 0)
             {
                 pControl->SetValue(* m_pString);
             }
@@ -450,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