Streamline wxPropertyGrid tooltip code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-09-23 12:58:02 +00:00
parent 614a87dffe
commit c27615f55c
3 changed files with 2 additions and 57 deletions

View File

@@ -4922,28 +4922,6 @@ bool wxPropertyGrid::HandleMouseDoubleClick( int WXUNUSED(x),
// -----------------------------------------------------------------------
#if wxPG_SUPPORT_TOOLTIPS
void wxPropertyGrid::SetToolTip( const wxString& tipString )
{
if ( tipString.length() )
{
wxScrolledWindow::SetToolTip(tipString);
}
else
{
#if wxPG_ALLOW_EMPTY_TOOLTIPS
wxScrolledWindow::SetToolTip( m_emptyString );
#else
wxScrolledWindow::SetToolTip( NULL );
#endif
}
}
#endif // #if wxPG_SUPPORT_TOOLTIPS
// -----------------------------------------------------------------------
// Return false if should be skipped
bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
wxMouseEvent &event )
@@ -5033,8 +5011,6 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
//
if ( m_windowStyle & wxPG_TOOLTIPS )
{
wxToolTip* tooltip = GetToolTip();
if ( m_propHover != prevHover || prevSide != m_mouseSide )
{
if ( m_propHover && !m_propHover->IsCategory() )
@@ -5074,34 +5050,18 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
int tw, th;
GetTextExtent( tipString, &tw, &th, 0, 0 );
if ( tw > space )
{
SetToolTip( tipString );
}
}
else
{
if ( tooltip )
{
#if wxPG_ALLOW_EMPTY_TOOLTIPS
SetToolTip( m_emptyString );
#else
wxScrolledWindow::SetToolTip( NULL );
#endif
}
SetToolTip( m_emptyString );
}
}
}
else
{
if ( tooltip )
{
#if wxPG_ALLOW_EMPTY_TOOLTIPS
SetToolTip( m_emptyString );
#else
wxScrolledWindow::SetToolTip( NULL );
#endif
}
SetToolTip( m_emptyString );
}
}
}