Print Page | Close Window

Graphical Tooltip for system button?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10133
Printed Date: 28 November 2024 at 12:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Graphical Tooltip for system button?
Posted By: swuk
Subject: Graphical Tooltip for system button?
Date Posted: 07 April 2008 at 5:38pm
I apologize in advance for this - the answer is probably right under my nose, but I just can't see it and it's driving me crazy!

How do I get the beautiful system menu preview graphic into the tooltip that comes up for the system button? The ribbon sample has this:



In my own app, I just get the text. I can't see any png/bmp in the sample's resources that contains the graphic?



Replies:
Posted By: Oleg
Date Posted: 08 April 2008 at 1:55am
Hi,
 
You need load this bitmap. In sample these lines load it:
 
 UINT uiGroupsTip[] = {ID_GROUP_CLIPBOARD_OPTION, ID_GROUP_FONT_OPTION, ID_GROUP_PARAGRAPH_OPTION, ID_GROUP_STYLES_OPTION, IDB_GEAR};
 pCommandBars->GetImageManager()->SetIcons(IDB_GROUPOPTIONTOOLTIP, uiGroupsTip, _countof(uiGroupsTip), CSize(100, 130));


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: swuk
Date Posted: 08 April 2008 at 10:00am
Fantastic! And thanks for such a fast reply! 


Posted By: Didi
Date Posted: 29 November 2013 at 10:24am
Can I also load images like that at runtime?
I.e. anpreview of documents?


Posted By: Didi
Date Posted: 29 November 2013 at 11:06am
Sorry, but I didn't see a change button.

I must show  preview-tooltips for  GalleryItems.
In my class, derived  from CXTPControlGalleryItem, I can only set a string for tooltip.
Can I catch the tooltip's popup-message to paint my own tooltip with mfc, or is it possible to derive a tooltip-class from CXTPControlGalleryItem's tooltip?
Thank you,
didi


Posted By: rdhd
Date Posted: 05 December 2013 at 11:57am
You can create your own tooltip window and that lets you draw/paint whatever you wish.

Subclass a CXTPToolTipContext and implement the virutal method CreateToolTip. Create your tooltip when that method is called.

I'm not sure how you will get your derived tooltip context set in the command bars class. We have derived from CJ's command bars object and after contstruction, we do this:

    CMDTARGET_RELEASE(m_pToolTipContext);// releases the tip context CJ created in the ctor

    m_pToolTipContext = new JCXTPToolTipContext;// creates and replaced the CJ context with our own





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net