I've noticed that if the user sets a custom color for something (say the "base") in the UI in the Preferences dialog that when you set a new theme programmatically that it doesn't update the custom color which is different than how it works in the interface when you pick a new theme.
I'm working in VB6 in this case
Dim pr As PDFXEditCtl.ICabNode
Set pr = AxPXV_Control1.Inst.Settings("CustomUI")
pr("Theme").v = "DarkGray"
Call AxPXV_Control1.Inst.FireAppPrefsChanged(PXV_AppPrefsChange_CustomUI)
I found a workaround by clearing the Colors, Fonts, and Backgrounds prior to setting the theme but just wondering if I'm missing something or if there is a better way to set a theme?
AxPXV_Control1.Inst.Settings("CustomUI.Colors").Clear
AxPXV_Control1.Inst.Settings("CustomUI.Fonts").Clear
AxPXV_Control1.Inst.Settings("CustomUI.Backgrounds").Clear
Dim pr As PDFXEditCtl.ICabNode
Set pr = AxPXV_Control1.Inst.Settings("CustomUI")
pr("Theme").v = "DarkGray"
Call AxPXV_Control1.Inst.FireAppPrefsChanged(PXV_AppPrefsChange_CustomUI)
Also I don't see a CustomTheme property to check I do it by seeing if the Count is greater than 0 for any of them.
If AxPXV_Control1.Inst.Settings("CustomUI.Colors").Count > 0 then
bCustomUI = True
End if
If AxPXV_Control1.Inst.Settings("CustomUI.Fonts").Count > 0 then
bCustomUI = True
End if
If AxPXV_Control1.Inst.Settings("CustomUI.Backgrounds").Count > 0 then
bCustomUI = True
End if
Thanks
Setting Themes
Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
- Vasyl - PDF-XChange
- Site Admin
- Posts: 2444
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Setting Themes
Hi RMan.
Your workaround will work well. Because the main idea is: that when you have specified something in Colors/Fonts/Backgrounds inside the CustomUI section of parameters then the Editor will interpret this as "Custom" theme, which is based on theme specified in "CustomUI.Theme" parameter (if it is empty - then Default theme will be as a base). When Colors/Fonts/Backgrounds aren't specified at all, then it will be just a genuine theme specified in "CustomUI.Theme" parameter, without any alterations.
HTH.
Your workaround will work well. Because the main idea is: that when you have specified something in Colors/Fonts/Backgrounds inside the CustomUI section of parameters then the Editor will interpret this as "Custom" theme, which is based on theme specified in "CustomUI.Theme" parameter (if it is empty - then Default theme will be as a base). When Colors/Fonts/Backgrounds aren't specified at all, then it will be just a genuine theme specified in "CustomUI.Theme" parameter, without any alterations.
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.