Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Converting from old CXTPToolBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Converting from old CXTPToolBar

 Post Reply Post Reply
Author
Message
james.boulton View Drop Down
Newbie
Newbie


Joined: 11 July 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote james.boulton Quote  Post ReplyReply Direct Link To This Post Topic: Converting from old CXTPToolBar
    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
Back to Top
james.boulton View Drop Down
Newbie
Newbie


Joined: 11 July 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote james.boulton Quote  Post ReplyReply Direct Link To This Post 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
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.063 seconds.