default painting back to OnPaint handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-02-13 14:28:11 +00:00
parent 2b43d5885d
commit ff3795eeaf
2 changed files with 19 additions and 13 deletions

View File

@@ -144,6 +144,7 @@ public:
// event handlers // event handlers
// -------------- // --------------
void OnSetFocus(wxFocusEvent& event) ; void OnSetFocus(wxFocusEvent& event) ;
void OnPaint(wxPaintEvent& event);
void OnNcPaint(wxNcPaintEvent& event); void OnNcPaint(wxNcPaintEvent& event);
void OnEraseBackground(wxEraseEvent& event); void OnEraseBackground(wxEraseEvent& event);
void OnMouseEvent( wxMouseEvent &event ) ; void OnMouseEvent( wxMouseEvent &event ) ;

View File

@@ -81,7 +81,9 @@ extern wxList wxPendingDelete;
BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase) BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
EVT_NC_PAINT(wxWindowMac::OnNcPaint) EVT_NC_PAINT(wxWindowMac::OnNcPaint)
EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground) EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
// TODO EVT_PAINT(wxWindowMac::OnPaint) #if TARGET_API_MAC_OSX
EVT_PAINT(wxWindowMac::OnPaint)
#endif
EVT_SET_FOCUS(wxWindowMac::OnSetFocus) EVT_SET_FOCUS(wxWindowMac::OnSetFocus)
EVT_KILL_FOCUS(wxWindowMac::OnSetFocus) EVT_KILL_FOCUS(wxWindowMac::OnSetFocus)
EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent) EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent)
@@ -2582,6 +2584,7 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
if ( MacGetTopLevelWindow() && m_peer->NeedsFocusRect() ) if ( MacGetTopLevelWindow() && m_peer->NeedsFocusRect() )
{ {
#if !wxMAC_USE_CORE_GRAPHICS
wxMacWindowStateSaver sv( this ) ; wxMacWindowStateSaver sv( this ) ;
int w , h ; int w , h ;
@@ -2613,6 +2616,9 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
DisposeRgn(updateOuter) ; DisposeRgn(updateOuter) ;
DisposeRgn(updateInner) ; DisposeRgn(updateInner) ;
} }
#else
GetParent()->Refresh() ;
#endif
} }
event.Skip(); event.Skip();
@@ -2870,21 +2876,12 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
if ( !m_updateRegion.Empty() ) if ( !m_updateRegion.Empty() )
{ {
// paint the window itself // paint the window itself
wxPaintEvent event; wxPaintEvent event;
event.SetTimestamp(time); event.SetTimestamp(time);
event.SetEventObject(this); event.SetEventObject(this);
handled = GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
handled = true ;
// we have to call the default built-in handler, as otherwise our frames will be drawn and immediately erased afterwards
if ( !handled )
{
if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL )
{
CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ;
handled = true ;
}
}
} }
// now we cannot rely on having its borders drawn by a window itself, as it does not // now we cannot rely on having its borders drawn by a window itself, as it does not
@@ -3233,6 +3230,14 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
} }
} }
void wxWindowMac::OnPaint( wxPaintEvent & event )
{
if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL )
{
CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ;
}
}
void wxWindowMac::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) void wxWindowMac::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) )
{ {
} }