wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.75k stars 1.69k forks source link

Event-based processing of tem tooltips in generic TreeCtrl #6376

Closed wxtrac closed 2 years ago

wxtrac commented 20 years ago

Issue migrated from trac ticket # 6376

component: GUI-generic | priority: normal

2003-12-11 17:03:47: hockkn (Kevin Hock) created the issue


This patch is a descendant of path 827011, which added event-based processing of tooltips on MSW. Most importantly, that patch added a new event and new method to the tree event, and with this framework already in place, the only change needed is in the generic tree control itself.

A new event EVT_TREE_ITEM_GETTOOLTIP is thrown when a tooltip is needed by the tree (thus allowing the tooltip to change dynamically when the mouse is moved over different items).

To set the tooltip, use the new SetToolTip method in wxTreeEvent. Assuming that the event is not vetoed, the new tooltip will then be set. m_label is used by SetToolTip to avoid cluttering the wxTreeEvent with new members.

This patch does NOT fix the fact that tooltips on a tree always appear just below the bottom of the tree control, rather than over the active object, but it seems that that would be a separate, unrelated patch.

There also seems to be an issue of when events are and are not thrown from the generic tree control, based on focus, but that too is not the intent of this patch.

Patch is made against HEAD from, admittedly, a few weeks ago (11-25).

wxtrac commented 20 years ago

2003-12-11 17:03:47: hockkn (Kevin Hock) uploaded file treetoolg.patch (1.2 KiB)

Patch to treectlg.cpp in src/generic to add tooltip support

wxtrac commented 20 years ago

2003-12-13 11:20:55: @JulianSmart commented


Applied, thanks! Julian