IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
#endif // __WXUNIVERSAL__/__WXMAC__
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
#endif // __WXUNIVERSAL__/__WXMAC__
BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
EVT_NC_PAINT(wxWindowMac::OnNcPaint)
EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase)
EVT_NC_PAINT(wxWindowMac::OnNcPaint)
EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground)
#define wxMAC_DEBUG_REDRAW 0
#ifndef wxMAC_DEBUG_REDRAW
#define wxMAC_DEBUG_REDRAW 0
#define wxMAC_DEBUG_REDRAW 0
#ifndef wxMAC_DEBUG_REDRAW
#define wxMAC_DEBUG_REDRAW 0
if ( cEvent.GetParameter<RgnHandle>(kEventParamRgnHandle, &updateRgn) != noErr )
{
updateRgn = (RgnHandle) visRegion.GetWXHRGN() ;
if ( cEvent.GetParameter<RgnHandle>(kEventParamRgnHandle, &updateRgn) != noErr )
{
updateRgn = (RgnHandle) visRegion.GetWXHRGN() ;
allocatedRgn = NewRgn() ;
CopyRgn( updateRgn , allocatedRgn ) ;
OffsetRgn( allocatedRgn , -controlBounds.left , -controlBounds.top ) ;
// hide the given region by the new region that must be shifted
wxMacNativeToWindow( thisWindow , allocatedRgn ) ;
allocatedRgn = NewRgn() ;
CopyRgn( updateRgn , allocatedRgn ) ;
OffsetRgn( allocatedRgn , -controlBounds.left , -controlBounds.top ) ;
// hide the given region by the new region that must be shifted
wxMacNativeToWindow( thisWindow , allocatedRgn ) ;
if ( cEvent.GetParameter<CGContextRef>(kEventParamCGContextRef, &cgContext) != noErr )
{
wxASSERT( thisWindow->GetPeer()->IsCompositing() == false ) ;
if ( cEvent.GetParameter<CGContextRef>(kEventParamCGContextRef, &cgContext) != noErr )
{
wxASSERT( thisWindow->GetPeer()->IsCompositing() == false ) ;
CGrafPtr port = GetWindowPort( (WindowRef) thisWindow->MacGetTopLevelWindowRef() ) ;
Rect bounds ;
GetPortBounds( port , &bounds ) ;
CGrafPtr port = GetWindowPort( (WindowRef) thisWindow->MacGetTopLevelWindowRef() ) ;
Rect bounds ;
GetPortBounds( port , &bounds ) ;
CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ;
CGContextScaleCTM( cgContext , 1 , -1 ) ;
CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ;
CGContextScaleCTM( cgContext , 1 , -1 ) ;
/*
CGContextSetRGBFillColor( cgContext , 1.0 , 1.0 , 1.0 , 1.0 ) ;
/*
CGContextSetRGBFillColor( cgContext , 1.0 , 1.0 , 1.0 , 1.0 ) ;
- CGContextFillRect(cgContext , CGRectMake( 0 , 0 ,
- controlBounds.right - controlBounds.left ,
+ CGContextFillRect(cgContext , CGRectMake( 0 , 0 ,
+ controlBounds.right - controlBounds.left ,
break ;
case kEventClassService :
result = wxMacWindowServiceEventHandler( handler, event , data ) ;
break ;
case kEventClassService :
result = wxMacWindowServiceEventHandler( handler, event , data ) ;
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
int& w, int& h , bool adjustOrigin ) const
{
bool isCompositing = MacGetTopLevelWindow()->MacUsesCompositing() ;
int& w, int& h , bool adjustOrigin ) const
{
bool isCompositing = MacGetTopLevelWindow()->MacUsesCompositing() ;
GetRegionBounds( rgn , &content ) ;
m_peer->GetRect( &structure ) ;
OffsetRect( &structure, -structure.left , -structure.top ) ;
GetRegionBounds( rgn , &content ) ;
m_peer->GetRect( &structure ) ;
OffsetRect( &structure, -structure.left , -structure.top ) ;
left = content.left - structure.left ;
top = content.top - structure.top ;
right = structure.right - content.right ;
left = content.left - structure.left ;
top = content.top - structure.top ;
right = structure.right - content.right ;
if ((m_maxWidth != -1) && (actualWidth > m_maxWidth))
actualWidth = m_maxWidth;
if ((m_maxHeight != -1) && (actualHeight > m_maxHeight))
if ((m_maxWidth != -1) && (actualWidth > m_maxWidth))
actualWidth = m_maxWidth;
if ((m_maxHeight != -1) && (actualHeight > m_maxHeight))
- wxRect bounds( wxPoint( actualX + MacGetLeftBorderSize() ,actualY + MacGetTopBorderSize() ),
- wxSize( actualWidth - (MacGetLeftBorderSize() + MacGetRightBorderSize()) ,
+ wxRect bounds( wxPoint( actualX + MacGetLeftBorderSize() ,actualY + MacGetTopBorderSize() ),
+ wxSize( actualWidth - (MacGetLeftBorderSize() + MacGetRightBorderSize()) ,
wxASSERT( m_peer->Ok() ) ;
bool former = MacIsReallyEnabled() ;
if ( !wxWindowBase::Enable(enable) )
wxASSERT( m_peer->Ok() ) ;
bool former = MacIsReallyEnabled() ;
if ( !wxWindowBase::Enable(enable) )
m_peer->Enable( enable ) ;
if ( former != MacIsReallyEnabled() )
MacPropagateEnabledStateChanged() ;
m_peer->Enable( enable ) ;
if ( former != MacIsReallyEnabled() )
MacPropagateEnabledStateChanged() ;
HIThemeFrameDrawInfo info ;
memset( &info, 0 , sizeof( info ) ) ;
HIThemeFrameDrawInfo info ;
memset( &info, 0 , sizeof( info ) ) ;
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
{
info.kind = kHIThemeFrameTextFieldSquare ;
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
{
info.kind = kHIThemeFrameTextFieldSquare ;
{
HIThemeDrawFocusRect( &cgrect , true , cgContext , kHIThemeOrientationNormal ) ;
}
{
HIThemeDrawFocusRect( &cgrect , true , cgContext , kHIThemeOrientationNormal ) ;
}
m_peer->GetRect( &rect ) ;
if ( hasBothScrollbars )
{
int size = m_hScrollBar->GetWindowVariant() == wxWINDOW_VARIANT_NORMAL ? 16 : 12 ;
CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ;
CGPoint cgpoint = CGPointMake( rect.right - size , rect.bottom - size ) ;
m_peer->GetRect( &rect ) ;
if ( hasBothScrollbars )
{
int size = m_hScrollBar->GetWindowVariant() == wxWINDOW_VARIANT_NORMAL ? 16 : 12 ;
CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ;
CGPoint cgpoint = CGPointMake( rect.right - size , rect.bottom - size ) ;
memset( &info, 0 , sizeof( info ) ) ;
info.version = 0 ;
info.state = IsEnabled() ? kThemeStateActive : kThemeStateInactive ;
memset( &info, 0 , sizeof( info ) ) ;
info.version = 0 ;
info.state = IsEnabled() ? kThemeStateActive : kThemeStateInactive ;
// note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
// area is scrolled, this does not occur if width and height are 2 pixels less,
// TODO write optimal workaround
// note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
// area is scrolled, this does not occur if width and height are 2 pixels less,
// TODO write optimal workaround
// is the better overall solution, as it does not slow down scrolling
m_peer->SetNeedsDisplay() ;
#else
// is the better overall solution, as it does not slow down scrolling
m_peer->SetNeedsDisplay() ;
#else
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
if( UMAGetSystemVersion() >= 0x1030 && m_peer->IsCompositing() )
HIViewRender(m_peer->GetControlRef()) ;
else
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
if( UMAGetSystemVersion() >= 0x1030 && m_peer->IsCompositing() )
HIViewRender(m_peer->GetControlRef()) ;
else
#endif
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
// now scroll the former update region as well and add the new update region
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
// now scroll the former update region as well and add the new update region
WindowRef rootWindow = (WindowRef) MacGetTopLevelWindowRef() ;
RgnHandle formerUpdateRgn = NewRgn() ;
RgnHandle scrollRgn = NewRgn() ;
WindowRef rootWindow = (WindowRef) MacGetTopLevelWindowRef() ;
RgnHandle formerUpdateRgn = NewRgn() ;
RgnHandle scrollRgn = NewRgn() ;
rIncludingOuterStructures = r ;
InsetRect( &rIncludingOuterStructures , -4 , -4 ) ;
rIncludingOuterStructures = r ;
InsetRect( &rIncludingOuterStructures , -4 , -4 ) ;
wxRect cl = GetClientRect() ;
Rect rClient = { cl.y , cl.x , cl.y + cl.height , cl.x + cl.width } ;
wxRect cl = GetClientRect() ;
Rect rClient = { cl.y , cl.x , cl.y + cl.height , cl.x + cl.width } ;
const wxWindow* child = this ;
const wxWindow* parent = NULL ;
while( !child->IsTopLevel() && ( parent = child->GetParent() ) != NULL )
const wxWindow* child = this ;
const wxWindow* parent = NULL ;
while( !child->IsTopLevel() && ( parent = child->GetParent() ) != NULL )
m_cachedClippedRect = wxRect( r.left , r.top , r.right - r.left , r.bottom - r.top ) ;
m_cachedClippedRect = wxRect( r.left , r.top , r.right - r.left , r.bottom - r.top ) ;
- m_cachedClippedRectWithOuterStructure = wxRect(
- rIncludingOuterStructures.left , rIncludingOuterStructures.top ,
- rIncludingOuterStructures.right - rIncludingOuterStructures.left ,
+ m_cachedClippedRectWithOuterStructure = wxRect(
+ rIncludingOuterStructures.left , rIncludingOuterStructures.top ,
+ rIncludingOuterStructures.right - rIncludingOuterStructures.left ,
m_cachedClippedRegionWithOuterStructure = wxRegion( m_cachedClippedRectWithOuterStructure ) ;
m_cachedClippedRegion = wxRegion( m_cachedClippedRect ) ;
m_cachedClippedClientRegion = wxRegion( m_cachedClippedClientRect ) ;
m_cachedClippedRegionWithOuterStructure = wxRegion( m_cachedClippedRectWithOuterStructure ) ;
m_cachedClippedRegion = wxRegion( m_cachedClippedRect ) ;
m_cachedClippedClientRegion = wxRegion( m_cachedClippedClientRect ) ;
// wxLogDebug(wxT("update for %s bounds %d , %d , %d , %d"),wxString(GetClassInfo()->GetClassName()).c_str(), updatebounds.left , updatebounds.top , updatebounds.right , updatebounds.bottom ) ;
// wxLogDebug(wxT("update for %s bounds %d , %d , %d , %d"),wxString(GetClassInfo()->GetClassName()).c_str(), updatebounds.left , updatebounds.top , updatebounds.right , updatebounds.bottom ) ;
wxEraseEvent eevent( GetId(), dc );
eevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( eevent );
wxEraseEvent eevent( GetId(), dc );
eevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( eevent );
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
{
GetThemeMetric( kThemeMetricEditTextFrameOutset , &border ) ;
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
{
GetThemeMetric( kThemeMetricEditTextFrameOutset , &border ) ;