From: Vadim Zeitlin Date: Thu, 29 Dec 2011 22:05:15 +0000 (+0000) Subject: Display help string for ribbon tools in a tool tip. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/349f41fdbd8a0f101e61c9992316328af14c30b0 Display help string for ribbon tools in a tool tip. Show the help string of the ribbon item currently being hovered over in a tooltip. Closes #11879. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 9d420c3750..6e56743fa5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -459,6 +459,7 @@ All (GUI): wxDataViewCtrl (Andrew Xu). - Fix item alignment in icon view in the generic wxListCtrl. - Support font-family/style, text-decoration in wxHtmlWindow (Blake Oleander). +- Show ribbon tools help strings in tooltips (John Roberts). GTK: diff --git a/src/ribbon/buttonbar.cpp b/src/ribbon/buttonbar.cpp index a1404abbb8..10680a0c31 100644 --- a/src/ribbon/buttonbar.cpp +++ b/src/ribbon/buttonbar.cpp @@ -875,6 +875,11 @@ void wxRibbonButtonBar::OnMouseMove(wxMouseEvent& evt) } } + if(new_hovered == NULL && GetToolTip()) + { + UnsetToolTip(); + } + if(new_hovered != m_hovered_button || (m_hovered_button != NULL && new_hovered_state != m_hovered_button->base->state)) { @@ -886,6 +891,7 @@ void wxRibbonButtonBar::OnMouseMove(wxMouseEvent& evt) if(m_hovered_button != NULL) { m_hovered_button->base->state = new_hovered_state; + SetToolTip(m_hovered_button->base->help_string); } Refresh(false); } diff --git a/src/ribbon/toolbar.cpp b/src/ribbon/toolbar.cpp index 5715d6e1bc..95afe60396 100644 --- a/src/ribbon/toolbar.cpp +++ b/src/ribbon/toolbar.cpp @@ -581,6 +581,15 @@ void wxRibbonToolBar::OnMouseMove(wxMouseEvent& evt) } } + if(new_hover) + { + SetToolTip(new_hover->help_string); + } + else if(GetToolTip()) + { + UnsetToolTip(); + } + if(new_hover != m_hover_tool) { if(m_hover_tool)