Print Page | Close Window

Toolbar and Tearoff toolbars

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=727
Printed Date: 24 December 2024 at 8:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar and Tearoff toolbars
Posted By: AliRafiee
Subject: Toolbar and Tearoff toolbars
Date 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




Replies:
Posted By: Oleg
Date 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


Posted By: AliRafiee
Date 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




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