![]() |
Converting from old CXTPToolBar |
Post Reply ![]() |
Author | |
james.boulton ![]() Newbie ![]() Joined: 11 July 2008 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
james.boulton ![]() Newbie ![]() Joined: 11 July 2008 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
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 |