Generate wxEVT_SPINCTRL of the correct wxSpinEvent type.
Handlers for this event expect to get wxSpinEvent but wxMSW and wxGTK1 sent an object of base wxCommandEvent class which resulted in invalid memory access in the handlers when using the derived class methods such as Veto(). See #16948.
This commit is contained in:
@@ -615,6 +615,7 @@ wxMSW:
|
||||
- Fix wxEVT_TREE_STATE_IMAGE_CLICK generation (Antal).
|
||||
- Fix wxDV_ROW_LINES in horizontally scrolled wxDataViewCtrl.
|
||||
- Fix RegisterHotKey() with negative IDs (troelsk).
|
||||
- Fix event object type for wxEVT_SPINCTRL events.
|
||||
|
||||
wxOSX:
|
||||
|
||||
|
@@ -179,8 +179,6 @@ wxDEFINE_EVENT( wxEVT_VLBOX, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_COMBOBOX, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_TOOL_RCLICKED, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_TOOL_ENTER, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_SPINCTRL, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_SPINCTRLDOUBLE, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_TOOL_DROPDOWN, wxCommandEvent );
|
||||
wxDEFINE_EVENT( wxEVT_COMBOBOX_DROPDOWN, wxCommandEvent);
|
||||
wxDEFINE_EVENT( wxEVT_COMBOBOX_CLOSEUP, wxCommandEvent);
|
||||
|
@@ -82,7 +82,7 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
if (!win->m_hasVMT) return;
|
||||
if (g_blockEventsOnDrag) return;
|
||||
|
||||
wxCommandEvent event( wxEVT_SPINCTRL, win->GetId());
|
||||
wxSpinEvent event( wxEVT_SPINCTRL, win->GetId());
|
||||
event.SetEventObject( win );
|
||||
|
||||
// note that we don't use wxSpinCtrl::GetValue() here because it would
|
||||
|
@@ -670,7 +670,7 @@ void wxSpinCtrl::DoSetToolTip(wxToolTip *tip)
|
||||
|
||||
void wxSpinCtrl::SendSpinUpdate(int value)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_SPINCTRL, GetId());
|
||||
wxSpinEvent event(wxEVT_SPINCTRL, GetId());
|
||||
event.SetEventObject(this);
|
||||
event.SetInt(value);
|
||||
|
||||
|
Reference in New Issue
Block a user