Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to use CXTPRibbonGroup::SetIconId()?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use CXTPRibbonGroup::SetIconId()?

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: How to use CXTPRibbonGroup::SetIconId()?
    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?
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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".
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.172 seconds.