Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Toolbar and Tearoff toolbars
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar and Tearoff toolbars

 Post Reply Post Reply
Author
Message
AliRafiee View Drop Down
Groupie
Groupie


Joined: 06 May 2004
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote AliRafiee Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar and Tearoff toolbars
    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

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: 14 May 2004 at 12:09am

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
Back to Top
AliRafiee View Drop Down
Groupie
Groupie


Joined: 06 May 2004
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote AliRafiee Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2004 at 10:43am

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

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.141 seconds.