X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2ca995fa32c9195e547b1e0967e9b17ea890a55..5a618a14c627c87a2ea642bd8395b74d72e614ba:/src/msw/checklst.cpp diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 9c688afc3b..2a7e01108e 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -6,7 +6,7 @@ // Created: 16.11.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -90,6 +90,8 @@ public: void SendEvent(); private: + + DECLARE_NO_COPY_CLASS(wxCheckListBoxItem) bool m_bChecked; wxCheckListBox *m_pParent; size_t m_nIndex; @@ -393,7 +395,7 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event) Clear } oper; - switch ( event.KeyCode() ) + switch ( event.GetKeyCode() ) { case WXK_SPACE: oper = Toggle; @@ -416,15 +418,19 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event) if ( oper != None ) { wxArrayInt selections; - int count; + int count = 0; if ( HasMultipleSelection() ) { count = GetSelections(selections); } else { - count = 1; - selections.Add(GetSelection()); + int sel = GetSelection(); + if (sel != -1) + { + count = 1; + selections.Add(sel); + } } for ( int i = 0; i < count; i++ )