Print Page | Close Window

How to use CXTPRibbonGroup::SetIconId()?

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=16509
Printed Date: 03 May 2024 at 6:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use CXTPRibbonGroup::SetIconId()?
Posted By: rdhd
Subject: How to use CXTPRibbonGroup::SetIconId()?
Date Posted: 24 March 2010 at 6:53pm
I am trying to use the SetIconId method on a CXTPRibbonGroup. I can set the icon id with no problem. But when I squeeze the app frame so the groups collapse and the group is drawn, the display code is not using the image I set. Instead another icon is drawn that is obtained by using the CXTPControl::GetIconId method. When squeezed down I can step through drawing code and the CXTPRibbonPaintManager::DrawControlGroupPopup CJ is called from CXTPRibbonGroup::Draw (when "m_pControlGroupPopup->IsVisible" returns true).
 
I can see the CXTPRibbonGroupControlPopup has the pointer to the actual group that has the m_nIconId set to my image id. But it is not being used. It looks like the code that creates the group control popup should be copying the group's icon id as well as the data it is copying. Since I don't create these group popups directly, I can not figure out how to get CJ to draw with the icon using the Id I set using CXTPRibbonGroup::SetIconId().
 
This also happens when I right-click and add the group to the QAT.
 
The xtpribbongroup.h file has comments that indicate m_nIconId specifies the icon to draw when there is not enough room to draw the group. But that is not happening. Is this a bug?
 
So ... how do I set an icon for a group that is not the same as the group ID that will actually be displayed on the QAT or on the ribbon because there is not enough room on the ribbon to display the group itself?



Replies:
Posted By: rdhd
Date Posted: 25 March 2010 at 10:36am
I found a way around the bug.
 
pGroup->SetIconId // does nothing discernable
pPopup = pGroup->GetControlGroupPopup
pPopup->SetIconId // icon will be used when group is added to QAT or group is displayed as a "button".



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