How to: Ribbon Toolbars from CommandBars Designer |
Post Reply |
Author | ||
lfoster
Groupie Joined: 26 April 2010 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 08 June 2010 at 8:32am |
|
I'm playing around with Ribbon toolbars that have been loaded in from CommandBars Designer projects and can currently switch between Ribbon bars at runtime which is nice. As I couldn't really find anything in the forum on how to do it I thought I'd post up my code to help others out. The sample applications only show how to load in from binary resources in your application but if like me you want to load different layouts at different times without having to recompile then the following will help.
The following brings my designer toolbars in for customisation, excellent :
Just remember to export your resources from the CommandBars Designer so you can load them into your application. I Hope this helps some of those searching the forums. Lewis |
||
lfoster
Groupie Joined: 26 April 2010 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
|
We do seem to have a problem with different languages when using the CommandBars Designer .xcb files.
One solution is to translate the .xcb files but they don't appear to be valid xml according to our language processing tools. This also doesn't seem like the best solution. Ideally I'd like to stick with language "satallite" dlls but I'm struggling to see how this can be done as we essentially have no string tables, everything is in the .xcb file. Has anyone got any experience with .xcb files from CommandBars Designer? Any ideas on how you could use language dlls? I'll be sure to post up with any solution that I can work out. |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
The language dlls only change built-in strings, it won't convert your text like the buttons you add.
You can use CommandBar Actions: http://codejock.com/support/articles/com/commandbars/cb_26.asp There is a MFC CommandBars Action sample to show how to use them |
||
lfoster
Groupie Joined: 26 April 2010 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
|
Excellent I'll take a look, thanks SuperMario.
|
||
lfoster
Groupie Joined: 26 April 2010 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
|
Hmm, I see a few issues with actions.
1. It seems Ribbon groups do not have actions listed in the CommandBars Designer. It may be possible to create an action manually through XML and to give the group the same ID as the action? - Not ideal, but it may work, i will try it. 2. I see no way to export actions from CommandBars Designer to an XML format that the Resource Editor can understand. I have tried exporting to XML and to XCB but the CodeJock Resource Editor does not understand either because they contain bitmap information etc. I can see how Actions can allow me to use multiple languages easily. I just can't see how to convert my .xcb file into a number of different language .xml files containing just the actions... Thanks |
||
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 |