Fix clipping which resulted in not showing wxGrid editor in wxOSX
Fix clipping for the windows not showing scrollbars. This commit is best viewed ignoring whitespace-only changes. Closes #24201. Closes #24342.
This commit is contained in:
parent
5ca49dc56c
commit
6e7bbfd17c
2 changed files with 46 additions and 39 deletions
|
|
@ -4079,16 +4079,23 @@ void wxWidgetCocoaImpl::AdjustClippingView(wxScrollBar* horizontal, wxScrollBar*
|
||||||
|
|
||||||
void wxWidgetCocoaImpl::UseClippingView()
|
void wxWidgetCocoaImpl::UseClippingView()
|
||||||
{
|
{
|
||||||
wxWindow* peer = m_wxPeer;
|
// starting from Sonoma child windows are bleeding through under the scrollbar
|
||||||
|
// use native scrollviews therefore
|
||||||
if ( peer && m_osxClipView == nil)
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
|
||||||
|
if ( WX_IS_MACOS_AVAILABLE(14, 0) )
|
||||||
{
|
{
|
||||||
m_osxClipView = [[wxNSClipView alloc] initWithFrame: m_osxView.bounds];
|
wxWindow* peer = m_wxPeer;
|
||||||
[(NSClipView*)m_osxClipView setDrawsBackground: NO];
|
|
||||||
[m_osxView addSubview:m_osxClipView];
|
|
||||||
|
|
||||||
// TODO check for additional subwindows which might have to be moved to the clip view ?
|
if ( peer && m_osxClipView == nil)
|
||||||
|
{
|
||||||
|
m_osxClipView = [[wxNSClipView alloc] initWithFrame: m_osxView.bounds];
|
||||||
|
[(NSClipView*)m_osxClipView setDrawsBackground: NO];
|
||||||
|
[m_osxView addSubview:m_osxClipView];
|
||||||
|
|
||||||
|
// TODO check for additional subwindows which might have to be moved to the clip view ?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2112,40 +2112,40 @@ bool wxWindowMac::MacIsChildOfClientArea( const wxWindow* child ) const
|
||||||
void wxWindowMac::MacRepositionScrollBars()
|
void wxWindowMac::MacRepositionScrollBars()
|
||||||
{
|
{
|
||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if ( !m_hScrollBar && !m_vScrollBar )
|
if ( m_hScrollBar || m_vScrollBar )
|
||||||
return ;
|
|
||||||
|
|
||||||
int scrlsize = m_hScrollBar ? m_hScrollBar->GetSize().y : ( m_vScrollBar ? m_vScrollBar->GetSize().x : MAC_SCROLLBAR_SIZE ) ;
|
|
||||||
int adjust = MacHasScrollBarCorner() ? scrlsize - 1 : 0 ;
|
|
||||||
|
|
||||||
// get real client area
|
|
||||||
int width, height ;
|
|
||||||
GetSize( &width , &height );
|
|
||||||
|
|
||||||
width -= MacGetLeftBorderSize() + MacGetRightBorderSize();
|
|
||||||
height -= MacGetTopBorderSize() + MacGetBottomBorderSize();
|
|
||||||
|
|
||||||
wxPoint vPoint( width - scrlsize, 0 ) ;
|
|
||||||
wxSize vSize( scrlsize, height - adjust ) ;
|
|
||||||
wxPoint hPoint( 0 , height - scrlsize ) ;
|
|
||||||
wxSize hSize( width - adjust, scrlsize ) ;
|
|
||||||
|
|
||||||
if ( m_vScrollBar )
|
|
||||||
m_vScrollBar->SetSize( vPoint.x , vPoint.y, vSize.x, vSize.y , wxSIZE_ALLOW_MINUS_ONE );
|
|
||||||
if ( m_hScrollBar )
|
|
||||||
m_hScrollBar->SetSize( hPoint.x , hPoint.y, hSize.x, hSize.y, wxSIZE_ALLOW_MINUS_ONE );
|
|
||||||
if ( m_growBox )
|
|
||||||
{
|
{
|
||||||
if ( MacHasScrollBarCorner() )
|
int scrlsize = m_hScrollBar ? m_hScrollBar->GetSize().y : ( m_vScrollBar ? m_vScrollBar->GetSize().x : MAC_SCROLLBAR_SIZE ) ;
|
||||||
|
int adjust = MacHasScrollBarCorner() ? scrlsize - 1 : 0 ;
|
||||||
|
|
||||||
|
// get real client area
|
||||||
|
int width, height ;
|
||||||
|
GetSize( &width , &height );
|
||||||
|
|
||||||
|
width -= MacGetLeftBorderSize() + MacGetRightBorderSize();
|
||||||
|
height -= MacGetTopBorderSize() + MacGetBottomBorderSize();
|
||||||
|
|
||||||
|
wxPoint vPoint( width - scrlsize, 0 ) ;
|
||||||
|
wxSize vSize( scrlsize, height - adjust ) ;
|
||||||
|
wxPoint hPoint( 0 , height - scrlsize ) ;
|
||||||
|
wxSize hSize( width - adjust, scrlsize ) ;
|
||||||
|
|
||||||
|
if ( m_vScrollBar )
|
||||||
|
m_vScrollBar->SetSize( vPoint.x , vPoint.y, vSize.x, vSize.y , wxSIZE_ALLOW_MINUS_ONE );
|
||||||
|
if ( m_hScrollBar )
|
||||||
|
m_hScrollBar->SetSize( hPoint.x , hPoint.y, hSize.x, hSize.y, wxSIZE_ALLOW_MINUS_ONE );
|
||||||
|
if ( m_growBox )
|
||||||
{
|
{
|
||||||
m_growBox->SetSize( width - scrlsize, height - scrlsize, wxDefaultCoord, wxDefaultCoord, wxSIZE_USE_EXISTING );
|
if ( MacHasScrollBarCorner() )
|
||||||
if ( !m_growBox->IsShown() )
|
{
|
||||||
m_growBox->Show();
|
m_growBox->SetSize( width - scrlsize, height - scrlsize, wxDefaultCoord, wxDefaultCoord, wxSIZE_USE_EXISTING );
|
||||||
}
|
if ( !m_growBox->IsShown() )
|
||||||
else
|
m_growBox->Show();
|
||||||
{
|
}
|
||||||
if ( m_growBox->IsShown() )
|
else
|
||||||
m_growBox->Hide();
|
{
|
||||||
|
if ( m_growBox->IsShown() )
|
||||||
|
m_growBox->Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_peer->AdjustClippingView(m_hScrollBar, m_vScrollBar);
|
m_peer->AdjustClippingView(m_hScrollBar, m_vScrollBar);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue