Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Saving and loading Ribbon customization
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Saving and loading Ribbon customization

 Post Reply Post Reply
Author
Message
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Topic: Saving and loading Ribbon customization
    Posted: 11 October 2013 at 4:34am
Is there any way to save only the ribbon customization, rather than the entire ribbon?
 
I have an application where the users can change the UI language, so when I create the ribbon in my code, I set the appropriate captions depending on the language selected by the user. I then use LoadCommandBars to load the ribbon customization from the registry.
 
Unfortunately, this means that if the user changes the language, when I load the customizations from the registry, the correct captions are replaced by the captions in the previous UI language.
 
In a previous version of this application, we got around this by using actions and resetting the captions of all of the actions after loading the customization. Unfortunately, when we transitioned to using the ribbon we found we needed to set different captions (shorter or longer) for the same actions depending on where they appeared, so this is no longer an option.
 
I've tried using DoPropExchange with various different combinations of StateOptions, but it doesn't seem to work. Needless to say, there are no code examples for using DoPropExchange with the registry, and the ones for XML don't really show anything useful.
 
Does anybody have any idea how to do this? Or maybe some kind of workaround I could use?
 
Regards,
 
Daniel
Product: Xtreme SuitePro (ActiveX) version 16.2.6

Platform: Windows 8.1 (64bit)

Language: Visual Basic 6.0
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2013 at 9:04am
I think you should not use the options SerializeControls And SerializeDesignerControls. Let me know if that's it. If not I have another suggestion which involves doing two times a propexchange. :)
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0



Back to Top
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Posted: 24 January 2014 at 4:23am
Can anybody provide a working example for using CreateAsRegistry? No matter what I try, it always returns false, so I can't actually properly test calling DoPropExchange. I have the feeling I got it to work the last time I tested this, but I did it in a test project which I no longer have.
Product: Xtreme SuitePro (ActiveX) version 16.2.6

Platform: Windows 8.1 (64bit)

Language: Visual Basic 6.0
Back to Top
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Posted: 24 January 2014 at 4:40am
OK, I got the CreateAsRegistry call to work. The problem now is that if I set the SerializeControls property of the StateOptions object to false, it doesn't save anything. If I set it to True, and I also set SaveOnlyCustomized to True, it still saves absolutely everything.
 
Basically, I want it to save any manual changes made by the end user to the ribbon or the QAB, but I don't want it to save any of the original information about the ribbon controls (captions, images, etc.) which may need to change from time to time.
 
Is there really no way to do this?
Product: Xtreme SuitePro (ActiveX) version 16.2.6

Platform: Windows 8.1 (64bit)

Language: Visual Basic 6.0
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2014 at 5:22am
If you only want to save customized controls you have to call the .CreateOriginalControls on the CommandbarsControls collection after initially setting the controls on the commandbar. That way the CodeJock software knows when controls are customized.
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0



Back to Top
dbenito View Drop Down
Groupie
Groupie


Joined: 14 May 2008
Location: Spain
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbenito Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2014 at 7:54am
Thanks, but even after calling RibbonBar.Controls.CreateOriginalControls (where RibbonBar is a reference I store when calling CommandBars.AddRibbonBar), it still saves absolutely everything, which means I need to create the ribbon bar, load the user customization, and then reset all the captions, descriptions, etc. in case the user has changed the UI language of my program.

Moreover, calling RibbonBar.Reset does absolutely nothing. Back when we still used normal command bars, simply calling EnableCustomization was enough to get everything to work automatically. Do I now need to add code to the CustomizationResetAll event to re-create the ribbon? (This is what is done in the RibbonSample example.)

I'm sorry, but this all seems like a step backwards - there are very basic things that should work automatically, and I find myself jumping through hoops just to get them working acceptably.
Product: Xtreme SuitePro (ActiveX) version 16.2.6

Platform: Windows 8.1 (64bit)

Language: Visual Basic 6.0
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.172 seconds.