projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git]
/
src
/
common
/
lboxcmn.cpp
diff --git
a/src/common/lboxcmn.cpp
b/src/common/lboxcmn.cpp
index 7e8b2be8e4d689d2e6411e44780997e8326ec9be..2afe3f1b7bb5d044dd6073bec64a4ddfb304bd18 100644
(file)
--- a/
src/common/lboxcmn.cpp
+++ b/
src/common/lboxcmn.cpp
@@
-4,7
+4,6
@@
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.10.99
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.10.99
-// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@
-31,9
+30,10
@@
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
#include "wx/arrstr.h"
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
#include "wx/arrstr.h"
+ #include "wx/log.h"
#endif
#endif
-#include "wx/log.h"
+extern WXDLLEXPORT_DATA(const char) wxListBoxNameStr[] = "listBox";
// ============================================================================
// implementation
// ============================================================================
// implementation
@@
-86,11
+86,11
@@
wxFLAGS_MEMBER(wxLB_NEEDED_SB)
wxFLAGS_MEMBER(wxLB_SORT)
wxEND_FLAGS( wxListBoxStyle )
wxFLAGS_MEMBER(wxLB_SORT)
wxEND_FLAGS( wxListBoxStyle )
-wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxListBox, wxControl
WithItems
, "wx/listbox.h")
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxListBox, wxControl, "wx/listbox.h")
wxBEGIN_PROPERTIES_TABLE(wxListBox)
wxBEGIN_PROPERTIES_TABLE(wxListBox)
-wxEVENT_PROPERTY( Select, wxEVT_
COMMAND_LISTBOX_SELECTED
, wxCommandEvent )
-wxEVENT_PROPERTY( DoubleClick, wxEVT_
COMMAND_LISTBOX_DOUBLECLICKED
, wxCommandEvent )
+wxEVENT_PROPERTY( Select, wxEVT_
LISTBOX
, wxCommandEvent )
+wxEVENT_PROPERTY( DoubleClick, wxEVT_
LISTBOX_DCLICK
, wxCommandEvent )
wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \
wxT("Helpstring"), wxT("group"))
wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \
wxT("Helpstring"), wxT("group"))
@@
-166,6
+166,14
@@
void wxListBoxBase::DeselectAll(int itemToLeaveSelected)
void wxListBoxBase::UpdateOldSelections()
{
void wxListBoxBase::UpdateOldSelections()
{
+ // When the control becomes empty, any previously remembered selections are
+ // invalid anyhow, so just forget them.
+ if ( IsEmpty() )
+ {
+ m_oldSelections.clear();
+ return;
+ }
+
// We need to remember the selection even in single-selection case on
// Windows, so that we don't send an event when the user clicks on an
// already selected item.
// We need to remember the selection even in single-selection case on
// Windows, so that we don't send an event when the user clicks on an
// already selected item.
@@
-294,7
+302,7
@@
bool wxListBoxBase::CalcAndSendEvent()
m_oldSelections = selections;
m_oldSelections = selections;
- return SendEvent(wxEVT_
COMMAND_LISTBOX_SELECTED
, item, selected);
+ return SendEvent(wxEVT_
LISTBOX
, item, selected);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------