X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d99be5f5381dad56492da02c2df1c3ec0750926..58c837a4e67c0996134cc0947691dc09c5f26687:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index cf49b661e8..0593b9342e 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -38,11 +38,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { if (param == CBN_SELCHANGE) { - wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId); - event.SetInt(GetSelection()); - event.SetEventObject(this); - event.SetString(GetStringSelection()); - ProcessCommand(event); + if (GetSelection() > -1) + { + wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId); + event.SetInt(GetSelection()); + event.SetEventObject(this); + event.SetString(GetStringSelection()); + ProcessCommand(event); + } return TRUE; } @@ -86,7 +89,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, int width = size.x; int height = size.y; - long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | CBS_NOINTEGRALHEIGHT; + long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | + CBS_NOINTEGRALHEIGHT; if (m_windowStyle & wxCB_READONLY) msStyle |= CBS_DROPDOWNLIST; @@ -106,12 +110,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if ( want3D || wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("COMBOBOX"), NULL, + m_hWnd = (WXHWND)::CreateWindowEx(exStyle, wxT("COMBOBOX"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create combobox") ); + wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create combobox") ); /* #if wxUSE_CTL3D