Applied patch [ 873021 ] Bug fix for MSW wxComboBox
wxComboBox::GetValue within a wxEVT_COMMAND_TEXT_UPDATED event should now pass the correct value even if the handler for wxEVT_COMMAND_COMBOBOX_SELECTED changed the selection git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -311,6 +311,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
|||||||
}
|
}
|
||||||
else // we're synthesizing text updated event from sel change
|
else // we're synthesizing text updated event from sel change
|
||||||
{
|
{
|
||||||
|
// We need to retrieve the current selection because the user
|
||||||
|
// may have changed it in the previous handler (for CBN_SELCHANGE
|
||||||
|
// above).
|
||||||
|
sel = GetSelection();
|
||||||
|
if ( sel > -1 )
|
||||||
|
{
|
||||||
|
value = GetString(sel);
|
||||||
|
}
|
||||||
// we need to do this because the user code expects
|
// we need to do this because the user code expects
|
||||||
// wxComboBox::GetValue() to return the new value from
|
// wxComboBox::GetValue() to return the new value from
|
||||||
// "text updated" handler but it hadn't been updated yet
|
// "text updated" handler but it hadn't been updated yet
|
||||||
|
Reference in New Issue
Block a user