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:
@@ -1989,9 +1989,8 @@ bool wxWindowMac::MacDoRedraw( long time )
|
||||
{
|
||||
// paint the window itself
|
||||
|
||||
wxPaintEvent event(GetId());
|
||||
wxPaintEvent event(this);
|
||||
event.SetTimestamp(time);
|
||||
event.SetEventObject(this);
|
||||
handled = HandleWindowEvent(event);
|
||||
}
|
||||
|
||||
@@ -2040,8 +2039,7 @@ void wxWindowMac::MacPaintChildrenBorders()
|
||||
if ( m_updateRegion.Contains(clientOrigin.x+x-10, clientOrigin.y+y-10, w+20, h+20) )
|
||||
{
|
||||
// paint custom borders
|
||||
wxNcPaintEvent eventNc( child->GetId() );
|
||||
eventNc.SetEventObject( child );
|
||||
wxNcPaintEvent eventNc( child );
|
||||
if ( !child->HandleWindowEvent( eventNc ) )
|
||||
{
|
||||
child->MacPaintBorders(0, 0) ;
|
||||
|
Reference in New Issue
Block a user