![]() |
Big icon in xtpControlButtonPopup |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
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);
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |