Feature Requests item #2858734, was opened at 2009-09-14 20:06
Message generated for change (Tracker Item Submitted) made by pgriddev
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=462819&aid=2858734&group_id=51305
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Any component
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ronan Chartois (pgriddev)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxTreeListCtrl - add tooltips per row
Initial Comment:
[opened on behalf of Carl Godkin]
I have a suggestion for improving wxTreeListCtrl.
I wanted to add tool tips to a wxTreeListCtrl but had a little
trouble that I have since worked around. I want the tool tips to be
based on the item I'm hovering over.
To do this, I added a handler for mouse motion and am using HitTest
to figure out which item I'm hovering over.
There's a problem with this, though: the header. I needed a way to
account for the height of the header but m_headerHeight is a private
member.
My first change was to make a protected GetHeaderHeight() method.
Then in my OnMouseMotion handler I can do this:
wxPoint point (event.GetX(), event.GetY() + GetHeaderHeight());
wxTreeItemId item = HitTest (point);
Second, wxWindow::SetToolTip() doesn't work correctly since it's
really the main window that needs to handle the tool tip. So my
second change was to override wxTreeListCtrl::SetToolTip() and
have my function call m_main_win::SetToolTip().
Here's the whole function that I added to the end of treelistctrl.cpp:
void wxTreeListCtrl::SetToolTip (const wxString &tip)
{
m_main_win->SetToolTip (tip);
}
And here are the changes I made to the protected section of treelistctrl.h:
int GetHeaderHeight() const { return m_headerHeight; }
void SetToolTip (const wxString &tip);
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=462819&aid=2858734&group_id=51305
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
wxCode-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxcode-users