From 780fb83cb0d665baec66e651d58d91f6c0af66b0 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 1 Nov 2004 15:58:56 +0000 Subject: [PATCH] Fixed bug in setting/getting value for wxComboBox. Read-only status 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp index f6dc6d5202..7119e95c4a 100644 --- a/src/common/valgen.cpp +++ b/src/common/valgen.cpp @@ -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