support for freeze and thaw under cocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -89,6 +89,8 @@ public :
|
||||
virtual void SetNeedsDisplay( const wxRect* where = NULL );
|
||||
virtual bool GetNeedsDisplay() const;
|
||||
|
||||
virtual void SetDrawingEnabled(bool enabled);
|
||||
|
||||
virtual bool CanFocus() const;
|
||||
// return true if successful
|
||||
virtual bool SetFocus();
|
||||
|
@@ -283,6 +283,8 @@ public :
|
||||
virtual bool NeedsFrame() const;
|
||||
virtual void SetNeedsFrame( bool needs );
|
||||
|
||||
virtual void SetDrawingEnabled(bool enabled);
|
||||
|
||||
virtual bool CanFocus() const = 0;
|
||||
// return true if successful
|
||||
virtual bool SetFocus() = 0;
|
||||
|
@@ -1404,7 +1404,15 @@ void wxMacControl::Enable( bool enable )
|
||||
|
||||
void wxMacControl::SetDrawingEnabled( bool enable )
|
||||
{
|
||||
HIViewSetDrawingEnabled( m_controlRef , enable );
|
||||
if ( enable )
|
||||
{
|
||||
HIViewSetDrawingEnabled( m_controlRef , true );
|
||||
HIViewSetNeedsDisplay( m_controlRef, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
HIViewSetDrawingEnabled( m_controlRef , false );
|
||||
}
|
||||
}
|
||||
|
||||
void wxMacControl::GetRectInWindowCoords( Rect *r )
|
||||
|
@@ -2586,6 +2586,18 @@ void wxWidgetCocoaImpl::SetFlipped(bool flipped)
|
||||
m_isFlipped = flipped;
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::SetDrawingEnabled(bool enabled)
|
||||
{
|
||||
if ( enabled )
|
||||
{
|
||||
[[m_osxView window] enableFlushWindow];
|
||||
[m_osxView setNeedsDisplay:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[m_osxView window] disableFlushWindow];
|
||||
}
|
||||
}
|
||||
//
|
||||
// Factory methods
|
||||
//
|
||||
|
@@ -1363,26 +1363,22 @@ void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect)
|
||||
if ( !IsShownOnScreen() )
|
||||
return ;
|
||||
|
||||
if ( IsFrozen() )
|
||||
return;
|
||||
|
||||
GetPeer()->SetNeedsDisplay( rect ) ;
|
||||
}
|
||||
|
||||
void wxWindowMac::DoFreeze()
|
||||
{
|
||||
#if wxOSX_USE_CARBON
|
||||
if ( GetPeer() && GetPeer()->IsOk() )
|
||||
GetPeer()->SetDrawingEnabled( false ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxWindowMac::DoThaw()
|
||||
{
|
||||
#if wxOSX_USE_CARBON
|
||||
if ( GetPeer() && GetPeer()->IsOk() )
|
||||
{
|
||||
GetPeer()->SetDrawingEnabled( true ) ;
|
||||
GetPeer()->InvalidateWithChildren() ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
wxWindow *wxGetActiveWindow()
|
||||
@@ -2854,3 +2850,7 @@ bool wxWidgetImpl::NeedsFrame() const
|
||||
{
|
||||
return m_needsFrame;
|
||||
}
|
||||
|
||||
void wxWidgetImpl::SetDrawingEnabled(bool WXUNUSED(enabled))
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user