Setting Themes
Posted: Tue Jan 14, 2025 10:09 am
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
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