X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b433fceec30daf5d4b975e41ad0de926e75d9ce..1b14412585d582acde42d422c8cd5d23d4daef14:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 0bd353a41a..38ec288a72 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -304,11 +304,13 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) int sel = -1; switch ( param ) { + case CBN_SELENDOK: case CBN_SELCHANGE: sel = GetSelection(); - // somehow we get 2 CBN_SELCHANGE events with the same index when - // the user selects an item in the combobox -- ignore duplicates + // we may sometimes get 2 CBN_SELCHANGE events or a CBN_SELENDOK + // before CBN_SELCHANGE with the same index when the user selects + // an item in the combobox -- ignore duplicates if ( sel > -1 && sel != m_selectionOld ) { m_selectionOld = sel; @@ -456,6 +458,11 @@ WXDWORD wxComboBox::MSWGetStyle(long style, WXDWORD *exstyle) const (style & ~wxBORDER_MASK) | wxBORDER_NONE, exstyle ); + // usually WS_TABSTOP is added by wxControl::MSWGetStyle() but as we're + // created hidden (see Create() above), it is not done for us but we still + // want to have this style + msStyle |= WS_TABSTOP; + // remove the style always added by wxChoice msStyle &= ~CBS_DROPDOWNLIST;