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:
@@ -1751,9 +1751,6 @@ public:
|
||||
virtual void Refresh( bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
virtual bool SetFont( const wxFont& font );
|
||||
#if wxPG_SUPPORT_TOOLTIPS
|
||||
void SetToolTip( const wxString& tipString );
|
||||
#endif
|
||||
virtual void Freeze();
|
||||
virtual void SetExtraStyle( long exStyle );
|
||||
virtual void Thaw();
|
||||
|
@@ -55,9 +55,6 @@
|
||||
// 1 if splitter drag detect margin and control cannot overlap
|
||||
#define wxPG_NO_CHILD_EVT_MOTION 0
|
||||
|
||||
// If 1, then setting empty tooltip actually hides it
|
||||
#define wxPG_ALLOW_EMPTY_TOOLTIPS 1
|
||||
|
||||
#define wxPG_NAT_BUTTON_BORDER_ANY 1
|
||||
#define wxPG_NAT_BUTTON_BORDER_X 1
|
||||
#define wxPG_NAT_BUTTON_BORDER_Y 1
|
||||
@@ -94,9 +91,6 @@
|
||||
// 1 if splitter drag detect margin and control cannot overlap
|
||||
#define wxPG_NO_CHILD_EVT_MOTION 1
|
||||
|
||||
// If 1, then setting empty tooltip actually hides it
|
||||
#define wxPG_ALLOW_EMPTY_TOOLTIPS 0
|
||||
|
||||
#define wxPG_NAT_BUTTON_BORDER_ANY 1
|
||||
#define wxPG_NAT_BUTTON_BORDER_X 1
|
||||
#define wxPG_NAT_BUTTON_BORDER_Y 1
|
||||
@@ -131,9 +125,6 @@
|
||||
// 1 if splitter drag detect margin and control cannot overlap
|
||||
#define wxPG_NO_CHILD_EVT_MOTION 0
|
||||
|
||||
// If 1, then setting empty tooltip actually hides it
|
||||
#define wxPG_ALLOW_EMPTY_TOOLTIPS 1
|
||||
|
||||
#define wxPG_NAT_BUTTON_BORDER_ANY 0
|
||||
#define wxPG_NAT_BUTTON_BORDER_X 0
|
||||
#define wxPG_NAT_BUTTON_BORDER_Y 0
|
||||
@@ -168,9 +159,6 @@
|
||||
// 1 if splitter drag detect margin and control cannot overlap
|
||||
#define wxPG_NO_CHILD_EVT_MOTION 1
|
||||
|
||||
// If 1, then setting empty tooltip actually hides it
|
||||
#define wxPG_ALLOW_EMPTY_TOOLTIPS 0
|
||||
|
||||
#define wxPG_NAT_BUTTON_BORDER_ANY 0
|
||||
#define wxPG_NAT_BUTTON_BORDER_X 0
|
||||
#define wxPG_NAT_BUTTON_BORDER_Y 0
|
||||
|
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user