X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b941f2d3143c1205fc7c5b01bd254781db728b3..301e257baf3a227beb587749134bbc40786f761f:/src/common/valgen.cpp?ds=inline 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