Forbid creation of wxPaintEvent objects from user code
This doesn't work anyhow, so it's better to prevent the code doing this from compiling instead of getting run-time asserts or worse. Also simplify construction of these events inside wxWidgets by passing the window itself to the ctor instead of passing just its ID and calling SetEventObject() separately later. For consistency, do the same thing for wxNcPaintEvent too.
This commit is contained in:
@@ -1282,8 +1282,7 @@ void wxWindowX11::SendPaintEvents()
|
||||
|
||||
m_clipPaintRegion = true;
|
||||
|
||||
wxPaintEvent paint_event( GetId() );
|
||||
paint_event.SetEventObject( this );
|
||||
wxPaintEvent paint_event( this );
|
||||
HandleWindowEvent( paint_event );
|
||||
|
||||
m_updateRegion.Clear();
|
||||
@@ -1324,8 +1323,7 @@ void wxWindowX11::SendNcPaintEvents()
|
||||
}
|
||||
}
|
||||
|
||||
wxNcPaintEvent nc_paint_event( GetId() );
|
||||
nc_paint_event.SetEventObject( this );
|
||||
wxNcPaintEvent nc_paint_event( this );
|
||||
HandleWindowEvent( nc_paint_event );
|
||||
|
||||
m_updateNcArea = false;
|
||||
|
Reference in New Issue
Block a user