X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19da49fcd0dd496f1a25f8dda9237420b4ca18db..4d073429a06c885db6440b79d754d8316d847223:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index eb177d058e..26ba49eea1 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -674,6 +674,11 @@ bool wxTreeCtrl::Create(wxWindow *parent, wstyle |= TVS_CHECKBOXES; #endif // wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE +#ifndef __WXWINCE__ + // Need so that TVN_GETINFOTIP messages will be sent + wstyle |= TVS_INFOTIP; +#endif + // Create the tree control. if ( !MSWCreateControl(WC_TREEVIEW, wstyle) ) return false; @@ -2459,6 +2464,30 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) break; } +#ifndef __WXWINCE__ + // These *must* not be removed or TVN_GETINFOTIP will + // not be processed each time the mouse is moved + // and the tooltip will only ever update once. + case TTN_NEEDTEXTA: + case TTN_NEEDTEXTW: + { + *result = 0; + + break; + } + + case TVN_GETINFOTIP: + { + eventType = wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP; + NMTVGETINFOTIP *info = (NMTVGETINFOTIP*)lParam; + + // Which item are we trying to get a tooltip for? + event.m_item = info->hItem; + + break; + } +#endif + case TVN_GETDISPINFO: eventType = wxEVT_COMMAND_TREE_GET_INFO; // fall through @@ -2805,6 +2834,18 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) DeleteTextCtrl(); break; +#ifndef __WXWINCE__ + case TVN_GETINFOTIP: + { + // If the user permitted a tooltip change, change it + if (event.IsAllowed()) + { + SetToolTip(event.m_label); + } + } + break; +#endif + case TVN_SELCHANGING: case TVN_ITEMEXPANDING: // return true to prevent the action from happening