cleanup - reformat; minor code tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -847,7 +847,8 @@ void wxWindowMac::MacInstallEventHandler( WXWidget control )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
bool wxWindowMac::Create(wxWindowMac *parent,
|
||||||
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
@@ -873,19 +874,19 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
|||||||
| kControlHandlesTracking
|
| kControlHandlesTracking
|
||||||
| kControlSupportsFocus
|
| kControlSupportsFocus
|
||||||
| kControlWantsActivate
|
| kControlWantsActivate
|
||||||
| kControlWantsIdle
|
| kControlWantsIdle ;
|
||||||
;
|
|
||||||
|
|
||||||
m_peer = new wxMacControl(this) ;
|
m_peer = new wxMacControl(this) ;
|
||||||
::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features , m_peer->GetControlRefAddr() );
|
OSStatus err =::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features , m_peer->GetControlRefAddr() );
|
||||||
|
verify_noerr( err );
|
||||||
|
|
||||||
MacPostControlCreate(pos, size) ;
|
MacPostControlCreate(pos, size) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __WXUNIVERSAL__
|
#ifndef __WXUNIVERSAL__
|
||||||
// Don't give scrollbars to wxControls unless they ask for them
|
// Don't give scrollbars to wxControls unless they ask for them
|
||||||
if ( (! IsKindOf(CLASSINFO(wxControl)) && ! IsKindOf(CLASSINFO(wxStatusBar))) ||
|
if ( (! IsKindOf(CLASSINFO(wxControl)) && ! IsKindOf(CLASSINFO(wxStatusBar)))
|
||||||
(IsKindOf(CLASSINFO(wxControl)) && ( style & wxHSCROLL || style & wxVSCROLL)))
|
|| (IsKindOf(CLASSINFO(wxControl)) && ((style & wxHSCROLL) || (style & wxVSCROLL))))
|
||||||
{
|
{
|
||||||
MacCreateScrollBars( style ) ;
|
MacCreateScrollBars( style ) ;
|
||||||
}
|
}
|
||||||
@@ -1023,6 +1024,7 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col )
|
|||||||
|
|
||||||
wxBrush brush ;
|
wxBrush brush ;
|
||||||
wxColour newCol(GetBackgroundColour());
|
wxColour newCol(GetBackgroundColour());
|
||||||
|
|
||||||
if ( newCol == wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) )
|
if ( newCol == wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) )
|
||||||
brush.MacSetTheme( kThemeBrushDocumentWindowBackground ) ;
|
brush.MacSetTheme( kThemeBrushDocumentWindowBackground ) ;
|
||||||
else if ( newCol == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) )
|
else if ( newCol == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) )
|
||||||
@@ -1031,7 +1033,6 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col )
|
|||||||
brush.SetColour( newCol ) ;
|
brush.SetColour( newCol ) ;
|
||||||
|
|
||||||
MacSetBackgroundBrush( brush ) ;
|
MacSetBackgroundBrush( brush ) ;
|
||||||
|
|
||||||
MacUpdateControlFont() ;
|
MacUpdateControlFont() ;
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
@@ -1077,8 +1078,11 @@ void wxWindowMac::SetFocus()
|
|||||||
if ( former )
|
if ( former )
|
||||||
{
|
{
|
||||||
EventRef evRef = NULL ;
|
EventRef evRef = NULL ;
|
||||||
verify_noerr( MacCreateEvent( NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) , kEventAttributeUserEvent ,
|
|
||||||
&evRef ) );
|
err = MacCreateEvent(
|
||||||
|
NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) ,
|
||||||
|
kEventAttributeUserEvent , &evRef );
|
||||||
|
verify_noerr( err );
|
||||||
|
|
||||||
wxMacCarbonEvent cEvent( evRef ) ;
|
wxMacCarbonEvent cEvent( evRef ) ;
|
||||||
cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) former->GetHandle() ) ;
|
cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) former->GetHandle() ) ;
|
||||||
@@ -1091,8 +1095,11 @@ void wxWindowMac::SetFocus()
|
|||||||
// send new focus event
|
// send new focus event
|
||||||
{
|
{
|
||||||
EventRef evRef = NULL ;
|
EventRef evRef = NULL ;
|
||||||
verify_noerr( MacCreateEvent( NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) , kEventAttributeUserEvent ,
|
|
||||||
&evRef ) );
|
err = MacCreateEvent(
|
||||||
|
NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) ,
|
||||||
|
kEventAttributeUserEvent , &evRef );
|
||||||
|
verify_noerr( err );
|
||||||
|
|
||||||
wxMacCarbonEvent cEvent( evRef ) ;
|
wxMacCarbonEvent cEvent( evRef ) ;
|
||||||
cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) GetHandle() ) ;
|
cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) GetHandle() ) ;
|
||||||
@@ -1129,7 +1136,7 @@ void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget)
|
|||||||
m_dropTarget = pDropTarget;
|
m_dropTarget = pDropTarget;
|
||||||
if ( m_dropTarget != NULL )
|
if ( m_dropTarget != NULL )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1138,7 +1145,7 @@ void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget)
|
|||||||
// Old style file-manager drag&drop
|
// Old style file-manager drag&drop
|
||||||
void wxWindowMac::DragAcceptFiles(bool accept)
|
void wxWindowMac::DragAcceptFiles(bool accept)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the size of the native control. In the case of the toplevel window
|
// Returns the size of the native control. In the case of the toplevel window
|
||||||
@@ -1164,7 +1171,8 @@ bool wxWindowMac::MacGetBoundsForControl(
|
|||||||
|
|
||||||
x = (int)pos.x;
|
x = (int)pos.x;
|
||||||
y = (int)pos.y;
|
y = (int)pos.y;
|
||||||
// todo the default calls may be used as soon as PostCreateControl Is moved here
|
|
||||||
|
// TODO: the default calls may be used as soon as PostCreateControl Is moved here
|
||||||
w = wxMax(size.x, 0) ; // WidthDefault( size.x );
|
w = wxMax(size.x, 0) ; // WidthDefault( size.x );
|
||||||
h = wxMax(size.y, 0) ; // HeightDefault( size.y ) ;
|
h = wxMax(size.y, 0) ; // HeightDefault( size.y ) ;
|
||||||
|
|
||||||
@@ -1240,10 +1248,8 @@ void wxWindowMac::DoGetPosition(int *x, int *y) const
|
|||||||
void wxWindowMac::DoScreenToClient(int *x, int *y) const
|
void wxWindowMac::DoScreenToClient(int *x, int *y) const
|
||||||
{
|
{
|
||||||
WindowRef window = (WindowRef) MacGetTopLevelWindowRef() ;
|
WindowRef window = (WindowRef) MacGetTopLevelWindowRef() ;
|
||||||
|
wxCHECK_RET( window , wxT("TopLevel Window missing") ) ;
|
||||||
|
|
||||||
wxCHECK_RET( window , wxT("TopLevel Window Missing") ) ;
|
|
||||||
|
|
||||||
{
|
|
||||||
Point localwhere = { 0, 0 } ;
|
Point localwhere = { 0, 0 } ;
|
||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
@@ -1257,7 +1263,6 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const
|
|||||||
*x = localwhere.h ;
|
*x = localwhere.h ;
|
||||||
if (y)
|
if (y)
|
||||||
*y = localwhere.v ;
|
*y = localwhere.v ;
|
||||||
}
|
|
||||||
|
|
||||||
MacRootWindowToWindow( x , y ) ;
|
MacRootWindowToWindow( x , y ) ;
|
||||||
|
|
||||||
@@ -1281,7 +1286,6 @@ void wxWindowMac::DoClientToScreen(int *x, int *y) const
|
|||||||
|
|
||||||
MacWindowToRootWindow( x , y ) ;
|
MacWindowToRootWindow( x , y ) ;
|
||||||
|
|
||||||
{
|
|
||||||
Point localwhere = { 0, 0 };
|
Point localwhere = { 0, 0 };
|
||||||
if (x)
|
if (x)
|
||||||
localwhere.h = *x ;
|
localwhere.h = *x ;
|
||||||
@@ -1295,7 +1299,6 @@ void wxWindowMac::DoClientToScreen(int *x, int *y) const
|
|||||||
if (y)
|
if (y)
|
||||||
*y = localwhere.v ;
|
*y = localwhere.v ;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindowMac::MacClientToRootWindow( int *x , int *y ) const
|
void wxWindowMac::MacClientToRootWindow( int *x , int *y ) const
|
||||||
{
|
{
|
||||||
@@ -1322,6 +1325,7 @@ void wxWindowMac::MacRootWindowToClient( int *x , int *y ) const
|
|||||||
void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const
|
void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const
|
||||||
{
|
{
|
||||||
wxPoint pt ;
|
wxPoint pt ;
|
||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
pt.x = *x ;
|
pt.x = *x ;
|
||||||
if (y)
|
if (y)
|
||||||
@@ -1508,13 +1512,14 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
|||||||
CGrafPtr savePort ;
|
CGrafPtr savePort ;
|
||||||
Boolean swapped = QDSwapPort( GetWindowPort( window ) , &savePort ) ;
|
Boolean swapped = QDSwapPort( GetWindowPort( window ) , &savePort ) ;
|
||||||
|
|
||||||
// TODO If we ever get a GetCurrentEvent.. replacement for the mouse
|
// TODO: If we ever get a GetCurrentEvent... replacement
|
||||||
// position, use it...
|
// for the mouse position, use it...
|
||||||
|
|
||||||
Point pt ;
|
Point pt ;
|
||||||
GetMouse( &pt ) ;
|
|
||||||
ControlPartCode part ;
|
ControlPartCode part ;
|
||||||
ControlRef control ;
|
ControlRef control ;
|
||||||
|
|
||||||
|
GetMouse( &pt ) ;
|
||||||
control = wxMacFindControlUnderMouse( tlw , pt , window , &part ) ;
|
control = wxMacFindControlUnderMouse( tlw , pt , window , &part ) ;
|
||||||
if ( control )
|
if ( control )
|
||||||
mouseWin = wxFindControlFromMacControl( control ) ;
|
mouseWin = wxFindControlFromMacControl( control ) ;
|
||||||
@@ -1603,11 +1608,13 @@ void wxWindowMac::MacInvalidateBorders()
|
|||||||
// now we know that we have something to do at all
|
// now we know that we have something to do at all
|
||||||
|
|
||||||
// as the borders are drawn on the parent we have to properly invalidate all these areas
|
// as the borders are drawn on the parent we have to properly invalidate all these areas
|
||||||
RgnHandle updateInner = NewRgn() ,
|
RgnHandle updateInner , updateOuter;
|
||||||
updateOuter = NewRgn() ;
|
Rect rect ;
|
||||||
|
|
||||||
// this rectangle is in HIViewCoordinates under OSX and in Window Coordinates under Carbon
|
// this rectangle is in HIViewCoordinates under OSX and in Window Coordinates under Carbon
|
||||||
Rect rect ;
|
updateInner = NewRgn() ;
|
||||||
|
updateOuter = NewRgn() ;
|
||||||
|
|
||||||
m_peer->GetRect( &rect ) ;
|
m_peer->GetRect( &rect ) ;
|
||||||
RectRgn( updateInner, &rect ) ;
|
RectRgn( updateInner, &rect ) ;
|
||||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
||||||
@@ -1624,105 +1631,6 @@ void wxWindowMac::MacInvalidateBorders()
|
|||||||
|
|
||||||
DisposeRgn( updateOuter ) ;
|
DisposeRgn( updateOuter ) ;
|
||||||
DisposeRgn( updateInner ) ;
|
DisposeRgn( updateInner ) ;
|
||||||
|
|
||||||
#if 0
|
|
||||||
RgnHandle updateInner = NewRgn() , updateOuter = NewRgn() ;
|
|
||||||
RectRgn( updateInner , &rect ) ;
|
|
||||||
InsetRect( &rect , -4 , -4 ) ;
|
|
||||||
RectRgn( updateOuter , &rect ) ;
|
|
||||||
DiffRgn( updateOuter , updateInner , updateOuter ) ;
|
|
||||||
wxPoint parent(0, 0);
|
|
||||||
GetParent()->MacWindowToRootWindow( &parent.x , &parent.y ) ;
|
|
||||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
|
||||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
|
||||||
GetParent()->m_peer->SetNeedsDisplay( true , updateOuter ) ;
|
|
||||||
DisposeRgn(updateOuter) ;
|
|
||||||
DisposeRgn(updateInner) ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if ( m_peer )
|
|
||||||
{
|
|
||||||
// deleting a window while it is shown invalidates
|
|
||||||
// the region occupied by border or focus
|
|
||||||
|
|
||||||
if ( IsShown() && ( outerBorder > 0 ) )
|
|
||||||
{
|
|
||||||
// as the borders are drawn on the parent we have to properly invalidate all these areas
|
|
||||||
RgnHandle updateInner = NewRgn() , updateOuter = NewRgn() , updateTotal = NewRgn() ;
|
|
||||||
|
|
||||||
Rect rect ;
|
|
||||||
|
|
||||||
m_peer->GetRect( &rect ) ;
|
|
||||||
RectRgn( updateInner , &rect ) ;
|
|
||||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
|
||||||
RectRgn( updateOuter , &rect ) ;
|
|
||||||
DiffRgn( updateOuter , updateInner ,updateOuter ) ;
|
|
||||||
wxPoint parent(0, 0);
|
|
||||||
GetParent()->MacWindowToRootWindow( &parent.x , &parent.y ) ;
|
|
||||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
|
||||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
|
||||||
CopyRgn( updateOuter , updateTotal ) ;
|
|
||||||
|
|
||||||
GetParent()->m_peer->SetNeedsDisplay( true , updateTotal ) ;
|
|
||||||
DisposeRgn(updateOuter) ;
|
|
||||||
DisposeRgn(updateInner) ;
|
|
||||||
DisposeRgn(updateTotal) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
Rect r = wxMacGetBoundsForControl(this , wxPoint( actualX,actualY), wxSize( actualWidth, actualHeight ) , false ) ;
|
|
||||||
|
|
||||||
int outerBorder = MacGetLeftBorderSize() ;
|
|
||||||
if ( m_peer->NeedsFocusRect() && m_peer->HasFocus() )
|
|
||||||
outerBorder += 4 ;
|
|
||||||
|
|
||||||
if ( vis && ( outerBorder > 0 ) )
|
|
||||||
{
|
|
||||||
// as the borders are drawn on the parent we have to properly invalidate all these areas
|
|
||||||
RgnHandle updateInner = NewRgn() , updateOuter = NewRgn() , updateTotal = NewRgn() ;
|
|
||||||
|
|
||||||
Rect rect ;
|
|
||||||
|
|
||||||
m_peer->GetRect( &rect ) ;
|
|
||||||
RectRgn( updateInner , &rect ) ;
|
|
||||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
|
||||||
RectRgn( updateOuter , &rect ) ;
|
|
||||||
DiffRgn( updateOuter , updateInner ,updateOuter ) ;
|
|
||||||
|
|
||||||
/*
|
|
||||||
wxPoint parent(0, 0);
|
|
||||||
#if TARGET_API_MAC_OSX
|
|
||||||
// no offsetting needed when compositing
|
|
||||||
#else
|
|
||||||
GetParent()->MacWindowToRootWindow( &parent.x , &parent.y ) ;
|
|
||||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
|
||||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
CopyRgn( updateOuter , updateTotal ) ;
|
|
||||||
|
|
||||||
rect = r ;
|
|
||||||
RectRgn( updateInner , &rect ) ;
|
|
||||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
|
||||||
RectRgn( updateOuter , &rect ) ;
|
|
||||||
DiffRgn( updateOuter , updateInner , updateOuter ) ;
|
|
||||||
|
|
||||||
/*
|
|
||||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
|
||||||
*/
|
|
||||||
|
|
||||||
UnionRgn( updateOuter , updateTotal , updateTotal ) ;
|
|
||||||
|
|
||||||
GetParent()->m_peer->SetNeedsDisplay( updateTotal ) ;
|
|
||||||
DisposeRgn( updateOuter ) ;
|
|
||||||
DisposeRgn( updateInner ) ;
|
|
||||||
DisposeRgn( updateTotal ) ;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||||
@@ -1874,10 +1782,13 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
if ( !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||||
|
{
|
||||||
|
if ( x == wxDefaultCoord )
|
||||||
x = currentX;
|
x = currentX;
|
||||||
if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
if ( y == wxDefaultCoord )
|
||||||
y = currentY;
|
y = currentY;
|
||||||
|
}
|
||||||
|
|
||||||
AdjustForParentClientOrigin( x, y, sizeFlags );
|
AdjustForParentClientOrigin( x, y, sizeFlags );
|
||||||
|
|
||||||
@@ -1971,20 +1882,13 @@ bool wxWindowMac::Show(bool show)
|
|||||||
if ( !wxWindowBase::Show(show) )
|
if ( !wxWindowBase::Show(show) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO use visibilityChanged Carbon Event for OSX
|
// TODO: use visibilityChanged Carbon Event for OSX
|
||||||
if ( m_peer )
|
if ( m_peer )
|
||||||
m_peer->SetVisibility( show , true ) ;
|
m_peer->SetVisibility( show , true ) ;
|
||||||
|
|
||||||
if ( former != MacIsReallyShown() )
|
if ( former != MacIsReallyShown() )
|
||||||
MacPropagateVisibilityChanged() ;
|
MacPropagateVisibilityChanged() ;
|
||||||
|
|
||||||
#if 1
|
|
||||||
// patch from Sailesh Agrawal
|
|
||||||
wxShowEvent eventShow(GetId(), show);
|
|
||||||
eventShow.SetEventObject(this);
|
|
||||||
GetEventHandler()->ProcessEvent(eventShow);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2322,8 +2226,8 @@ void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin )
|
|||||||
bool hasFocus = m_peer->NeedsFocusRect() && m_peer->HasFocus() ;
|
bool hasFocus = m_peer->NeedsFocusRect() && m_peer->HasFocus() ;
|
||||||
bool hasBothScrollbars = (m_hScrollBar && m_hScrollBar->IsShown()) && (m_vScrollBar && m_vScrollBar->IsShown()) ;
|
bool hasBothScrollbars = (m_hScrollBar && m_hScrollBar->IsShown()) && (m_vScrollBar && m_vScrollBar->IsShown()) ;
|
||||||
|
|
||||||
m_peer->GetRect( &rect ) ;
|
|
||||||
// back to the surrounding frame rectangle
|
// back to the surrounding frame rectangle
|
||||||
|
m_peer->GetRect( &rect ) ;
|
||||||
InsetRect( &rect, -1 , -1 ) ;
|
InsetRect( &rect, -1 , -1 ) ;
|
||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
|
||||||
@@ -2415,20 +2319,15 @@ void wxWindowMac::RemoveChild( wxWindowBase *child )
|
|||||||
void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
|
void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh)
|
int range, bool refresh)
|
||||||
{
|
{
|
||||||
|
bool showScroller;
|
||||||
|
|
||||||
if ( orient == wxHORIZONTAL )
|
if ( orient == wxHORIZONTAL )
|
||||||
{
|
{
|
||||||
if ( m_hScrollBar )
|
if ( m_hScrollBar )
|
||||||
{
|
{
|
||||||
if ( range == 0 || thumbVisible >= range )
|
showScroller = ((range != 0) && (range > thumbVisible));
|
||||||
{
|
if ( m_hScrollBar->IsShown() != showScroller )
|
||||||
if ( m_hScrollBar->IsShown() )
|
m_hScrollBar->Show( showScroller ) ;
|
||||||
m_hScrollBar->Show(false) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( !m_hScrollBar->IsShown() )
|
|
||||||
m_hScrollBar->Show(true) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
|
m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
|
||||||
}
|
}
|
||||||
@@ -2437,16 +2336,9 @@ void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible,
|
|||||||
{
|
{
|
||||||
if ( m_vScrollBar )
|
if ( m_vScrollBar )
|
||||||
{
|
{
|
||||||
if ( range == 0 || thumbVisible >= range )
|
showScroller = ((range != 0) && (range > thumbVisible));
|
||||||
{
|
if ( m_vScrollBar->IsShown() != showScroller )
|
||||||
if ( m_vScrollBar->IsShown() )
|
m_vScrollBar->Show( showScroller ) ;
|
||||||
m_vScrollBar->Show(false) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( !m_vScrollBar->IsShown() )
|
|
||||||
m_vScrollBar->Show(true) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
|
m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ;
|
||||||
}
|
}
|
||||||
@@ -2469,14 +2361,14 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
{
|
{
|
||||||
// note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
|
// 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,
|
// area is scrolled, this does not occur if width and height are 2 pixels less,
|
||||||
// TODO write optimal workaround
|
// TODO: write optimal workaround
|
||||||
wxRect scrollrect( MacGetLeftBorderSize() , MacGetTopBorderSize() , width , height ) ;
|
wxRect scrollrect( MacGetLeftBorderSize() , MacGetTopBorderSize() , width , height ) ;
|
||||||
if ( rect )
|
if ( rect )
|
||||||
scrollrect.Intersect( *rect ) ;
|
scrollrect.Intersect( *rect ) ;
|
||||||
|
|
||||||
if ( m_peer->GetNeedsDisplay() )
|
if ( m_peer->GetNeedsDisplay() )
|
||||||
{
|
{
|
||||||
// becuase HIViewScrollRect does not scroll the already invalidated area we have two options
|
// because HIViewScrollRect does not scroll the already invalidated area we have two options:
|
||||||
// either immediate redraw or full invalidate
|
// either immediate redraw or full invalidate
|
||||||
#if 1
|
#if 1
|
||||||
// is the better overall solution, as it does not slow down scrolling
|
// is the better overall solution, as it does not slow down scrolling
|
||||||
@@ -3308,7 +3200,6 @@ wxInt32 wxWindowMac::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENT
|
|||||||
bool wxWindowMac::Reparent(wxWindowBase *newParentBase)
|
bool wxWindowMac::Reparent(wxWindowBase *newParentBase)
|
||||||
{
|
{
|
||||||
wxWindowMac *newParent = (wxWindowMac *)newParentBase;
|
wxWindowMac *newParent = (wxWindowMac *)newParentBase;
|
||||||
|
|
||||||
if ( !wxWindowBase::Reparent(newParent) )
|
if ( !wxWindowBase::Reparent(newParent) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user