Print Page | Close Window

Saving and loading Ribbon customization

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=21904
Printed Date: 22 November 2024 at 6:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Saving and loading Ribbon customization
Posted By: dbenito
Subject: Saving and loading Ribbon customization
Date 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



Replies:
Posted By: Willowmaster
Date 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





Posted By: dbenito
Date 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


Posted By: dbenito
Date 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


Posted By: Willowmaster
Date 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





Posted By: dbenito
Date 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



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