Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to Update a SplitButton's Icon?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Update a SplitButton's Icon?

 Post Reply Post Reply
Author
Message
Sstar9 View Drop Down
Newbie
Newbie


Joined: 25 August 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sstar9 Quote  Post ReplyReply Direct Link To This Post Topic: How to Update a SplitButton's Icon?
    Posted: 28 August 2006 at 10:51am

I have toolbar in a dialog. 

I want to dynamically modify the icon of the a split  button in my program, is there anyway I could do it.
 
For example, in the toolbar, I created a split button is named "Width". Clicking on its drop-down button, a list a width will show and user could select one out of the list.  After user's selection, I want the "Width" button to display a stroke with the current selected width, how to do that?
 
 
I have checked the tear-off  Popup example, however, I found that the CXTPControlPopupColor class is built-in class and after user select the color, the SetColor() function could be used to update the color.  But  there is no CXTPControlPopupWidth class. Without this class, how can I get this job done manually?
 
 
Sharing makes life better
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2006 at 12:10pm
Hello,
Add update handle for button and
 
 CXTPControl* pPopup = CXTPControl::FromUI(pCmdUI);
 if (pPopup)
 {
  pPopup->SetIconId(m_iconId);
 }
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sstar9 View Drop Down
Newbie
Newbie


Joined: 25 August 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sstar9 Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2006 at 6:10am
Thanks, Oleg, that works.
 
But before that, XTPImageManager()->SetIcons() should be called.
 
Sharing makes life better
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.051 seconds.