constrain tooltip rectangle to window (access to screen is very expensive under OSX)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -287,6 +287,28 @@ void wxMacToolTip::Draw()
|
|||||||
m_rect.right += kTipBorder ;
|
m_rect.right += kTipBorder ;
|
||||||
#endif
|
#endif
|
||||||
m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
|
m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
|
||||||
|
Rect r ;
|
||||||
|
GetPortBounds( GetWindowPort( m_window ) , &r ) ;
|
||||||
|
if ( m_rect.top < 0 )
|
||||||
|
{
|
||||||
|
m_rect.bottom += -m_rect.top ;
|
||||||
|
m_rect.top = 0 ;
|
||||||
|
}
|
||||||
|
if ( m_rect.left < 0 )
|
||||||
|
{
|
||||||
|
m_rect.right += -m_rect.left ;
|
||||||
|
m_rect.left = 0 ;
|
||||||
|
}
|
||||||
|
if ( m_rect.right > r.right )
|
||||||
|
{
|
||||||
|
m_rect.left -= (m_rect.right - r.right ) ;
|
||||||
|
m_rect.right = r.right ;
|
||||||
|
}
|
||||||
|
if ( m_rect.bottom > r.bottom )
|
||||||
|
{
|
||||||
|
m_rect.top -= (m_rect.bottom - r.bottom) ;
|
||||||
|
m_rect.bottom = r.bottom ;
|
||||||
|
}
|
||||||
ClipRect( &m_rect ) ;
|
ClipRect( &m_rect ) ;
|
||||||
BackColor( whiteColor ) ;
|
BackColor( whiteColor ) ;
|
||||||
ForeColor(blackColor ) ;
|
ForeColor(blackColor ) ;
|
||||||
|
@@ -287,6 +287,28 @@ void wxMacToolTip::Draw()
|
|||||||
m_rect.right += kTipBorder ;
|
m_rect.right += kTipBorder ;
|
||||||
#endif
|
#endif
|
||||||
m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
|
m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
|
||||||
|
Rect r ;
|
||||||
|
GetPortBounds( GetWindowPort( m_window ) , &r ) ;
|
||||||
|
if ( m_rect.top < 0 )
|
||||||
|
{
|
||||||
|
m_rect.bottom += -m_rect.top ;
|
||||||
|
m_rect.top = 0 ;
|
||||||
|
}
|
||||||
|
if ( m_rect.left < 0 )
|
||||||
|
{
|
||||||
|
m_rect.right += -m_rect.left ;
|
||||||
|
m_rect.left = 0 ;
|
||||||
|
}
|
||||||
|
if ( m_rect.right > r.right )
|
||||||
|
{
|
||||||
|
m_rect.left -= (m_rect.right - r.right ) ;
|
||||||
|
m_rect.right = r.right ;
|
||||||
|
}
|
||||||
|
if ( m_rect.bottom > r.bottom )
|
||||||
|
{
|
||||||
|
m_rect.top -= (m_rect.bottom - r.bottom) ;
|
||||||
|
m_rect.bottom = r.bottom ;
|
||||||
|
}
|
||||||
ClipRect( &m_rect ) ;
|
ClipRect( &m_rect ) ;
|
||||||
BackColor( whiteColor ) ;
|
BackColor( whiteColor ) ;
|
||||||
ForeColor(blackColor ) ;
|
ForeColor(blackColor ) ;
|
||||||
|
Reference in New Issue
Block a user