Fix wrongly recreating wxComboBox in disabled state in wxMSW

When recreating a wxComboBox, as sometimes needs to be done when adding
a new bitmap to wxBitmapComboBox, for example, we should only disable it
if the old combobox itself was disabled, not if (any of) its parent(s)
were disabled, but IsEnabled() returned true even in this case.

Use IsThisEnabled() instead to ensure that we only disable the new
combobox if necessary.

See #23132.

(cherry picked from commit 8e604926c3a726c93b2df2c162be57b94a10cb61)
This commit is contained in:
Oleksandra Yushchenko 2023-01-12 11:15:46 +01:00 committed by Vadim Zeitlin
parent 1d32868d36
commit ac29c30b8a
2 changed files with 2 additions and 1 deletions

View File

@ -285,6 +285,7 @@ wxMSW:
- Fix building samples with clang under MSYS (Maarten Bent, #23057).
- Fix memory leak when allocating command line arguments (#23081).
- Include wxrc.exe in 64-bit wxMSW MSVC dev archive too (Danny Scott, #23122).
- Don't disable wxComboBox after recreating it (Oleksandra Yushchenko, #23132).
wxOSX:

View File

@ -537,7 +537,7 @@ void wxComboBox::MSWRecreate()
SetSelection(selection);
// If disabled we'll have to disable it again after re-creating
if ( !IsEnabled() )
if ( !IsThisEnabled() )
DoEnable(false);
}