Toolbar and Tearoff toolbars |
Post Reply |
Author | |
AliRafiee
Groupie Joined: 06 May 2004 Status: Offline Points: 32 |
Post Options
Thanks(0)
Posted: 13 May 2004 at 1:48pm |
Hi everyone, I have a toolbar, and one of the items is a tearoff item, (once pressed it will display a tearoff toolbar). I am using that for drawing tools, and the tearoff has the different tools like, line, rect, arc, ellipse, and so on. What I want to do is to change the icon in the main toolbar upon selection of one of the tools in the tearoff. So, if the user selects line from the tearoff toolbar, I want to display that line icon as the main toolbars item icon, and once they select rectangle, display the rectangle icon in its place. Does any one know how to that?
thanks in advance Ali Rafiee |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ON_UPDATE_COMMAND_UI(ID_BDR_POPUP, OnUpdateBorder) ... void CMainFrame::OnUpdateBorder(CCmdUI* pCmdUI){ pCmdUI->Enable(); CXTPControl* pControl = CXTPControl::FromUI(pCmdUI); pControl->SetIconId(m_nCurrentTool); } |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
AliRafiee
Groupie Joined: 06 May 2004 Status: Offline Points: 32 |
Post Options
Thanks(0)
|
Thanks it worked great. Although I had to change the code a little . When I actually clicked on the toolbar icon itself the FromUI method returned a NULL so I had to check for a NULL control pointer before SetIconId!? Is that what should happen? Ali Rafiee |
|
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 |