Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to change ribbon button tooltip dynamically?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change ribbon button tooltip dynamically?

 Post Reply Post Reply
Author
Message
Beth View Drop Down
Groupie
Groupie


Joined: 10 December 2004
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Beth Quote  Post ReplyReply Direct Link To This Post Topic: How to change ribbon button tooltip dynamically?
    Posted: 04 April 2013 at 2:06pm
Is there a way to change ribbon button tooltip dynamically?
 
Thanks,
Beth
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2013 at 3:44pm
Use the SetTooltip method?

We subclass the ribbon bar and react to OnToolHitTest. We not only can change the text, but we can change the tooltip style (to xtpToolTipHTML) to affect the style of individual ribbon controls.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2013 at 11:38am
Beth. Ignore what I said! When OnToolHitTest is called, if you change the style CJ deletes the current tooltip. That would be fine since it is in instance data but the code that calls OnToolHitTest has a copy of the pointer to the tooltip that gets deleted. So that is a show stopper.

It looks like you cannot change the style dynamically during an OnToolHitTest call. And the methods on the stack to get to OnToolHitTest are not virtual until you get to CXTPCommandBar::OnWndMsg.

So at that point you can switch styles but you don't know what control will be hit. I simply don't see a way to change styles based on the control itself.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.