Print Page | Close Window

Big icon in xtpControlButtonPopup

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=10578
Printed Date: 17 June 2024 at 4:45am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Big icon in xtpControlButtonPopup
Posted By: znakeeye
Subject: Big icon in xtpControlButtonPopup
Date Posted: 10 May 2008 at 11:27am
I have a popup-menu in my ribbon. Its drop-down menu contains ~10 items with their corresponding small icons. When I select these sub-items, I want the button in the ribbon to get its big icon.
 
That way, the user understands which item is selected.
 
Q: How do I update this big icon elegantly?
 
At the moment I store the icon-ID of the menu item when it is being selected, and then call pControl->SetIconIndex in the update-handler of the popup-button. Hence, I get a 16x16-icon when I want a 32x32-icon!
 
I believe CXTPControlButton should be able to hold two icons! Then I could call this in the menu-handler:
m_selectedIconID = pControl->GetLargeIconID();
 
Any other ideas?



Replies:
Posted By: znakeeye
Date Posted: 10 May 2008 at 11:32am
Seems this did the trick (maybe you can explain why it works? :P)
 
When creating the popup-item:
XTPImageManager()->SetIcon(hLargeIcon, pControl->GetID(), CSize(32, 32));
XTPImageManager()->SetIcon(hSmallIcon, pControl->GetID(), CSize(16, 16));
 
When selecting the popup-item:
m_selectedIconID = tagNMCONTROL->pControl->GetIconId();
 
Then in the update-handler of the popup itself:
pPopup->SetIconId(m_selectedIconID);



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