Print Page | Close Window

Converting from old CXTPToolBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11397
Printed Date: 01 March 2025 at 1:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Converting from old CXTPToolBar
Posted By: james.boulton
Subject: Converting from old CXTPToolBar
Date Posted: 11 July 2008 at 6:09am
I have an app I am converting over from VC6 to .NET and ToolkitPro. In the app I am using CXTPToolBar for a toolbar, using a radio button style interface.
 
The new implementation of CXTPToolBar seems to be lacking in any way to set the buttons in the toolbar to be radio buttons, other than actual radio button controls. Previously I just used SetButtonStyle and TBSTYLE_GROUP to set this up.
 
I have worked around this by manually setting the checked status of the toolbar buttons using ON_UPDATE_COMMAND_UI, which does work but is a little ugly compared to the original solution.
 
Secondly I used a drop-down button selection to select sub-tools from the tool bar by using AddDropDownButton. The only similar feature I can find in the new implementation is to set the control style to xtpControlButtonPopup, but this doesnt provide the checkable radio-button style interface of the original.
 
Is there any way I can replicate the functionality of the original control, as it worked perfectly for my needs?
 
Cheers,
-- James



Replies:
Posted By: james.boulton
Date Posted: 11 July 2008 at 8:07am
Right, I'm getting somewhere now...
 
The drop down button type I was using before is now called xtpControlSplitButtonPopup. So if I set the type of the toolbar button to this, I can then load in a new toolbar for the popup like this...

m_pEditToolBar->GetControls()->SetControlType(TOOL_BOUNDINGVOLUME, xtpControlSplitButtonPopup);

CXTPControlPopup *pSubBar = (CXTPControlPopup *) m_pEditToolBar->GetControl(TOOL_BOUNDINGVOLUME);

pSubBar->GetCommandBar()->LoadToolBar(IDR_BOUNDINGSHAPE_TOOLBAR);

This works ok, but displays a menu style dropdown including an empty space where the text would be. I'd tried setting the width of the popup and setting the draw style to be icons only, but nothing seems to get rid of the empty space to the right of the icon.

How can I set this up so the drop down only displays the icon and nothing else?

ta!
-- James



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