PXV_VisibleCmdPanes_All vs cmd.view.toggleAllCmdBars vs multiple instances of PXVControl

PDF-XChange Editor SDK for Developers

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - 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.
zarkogajic
User
Posts: 1491
Joined: Thu Sep 05, 2019 12:35 pm

PXV_VisibleCmdPanes_All vs cmd.view.toggleAllCmdBars vs multiple instances of PXVControl

Post by zarkogajic »

Hi Support,

Couple of Q's raised here:

Having 2 instances of PXV Control.

1. First instantiated + setting PXV_VisibleCmdPanes_All.
2. cmd.view.toggleAllCmdBars executed - all bars get hidden.

Now, instantiating second instance, again + PXV_VisibleCmdPanes_All

Since PXV_VisibleCmdPanes_All is global -> this will reset the visibility of all MainView bars in the first pxvControl instance.

I need to hide back the bars hidden via toggleAllCmdBars in the first instance.

[Q1] But, how do I know, i.e. what "setting" to read from the first instance, to know that toggleAllCmdBars was executed and all bars were hidden (before global PXV_VisibleCmdPanes_All made them visible again)?

[Q2] And what does toggleAllCmdBars actually do? It does not unhide the bars that I've hidden from code using IUIX_CmdBar.Hide.

[Q3] Is it altering the VisibleCmdBars of PXVControl? If so, where is that value stored? In some Instance setting (since global)?

[Q4] And finally: toggleAllCmdBars does not hide my custom added bars - is that expected?

-žarko
zarkogajic
User
Posts: 1491
Joined: Thu Sep 05, 2019 12:35 pm

Re: PXV_VisibleCmdPanes_All vs cmd.view.toggleAllCmdBars vs multiple instances of PXVControl

Post by zarkogajic »

Hi Support,

I've played a bit more here .. and here's what I figured out ...

Executing cmd.view.toggleAllCmdBars changes the value of VisibleCmdBars from default PXV_VisibleCmdBars_All to "0" (no bars visible) for ALL pxvControl instances (because it is really not PXVControl related but instance related e.g. global).

If executed, and then reading it from one/any PXVControl the value is 0 (so all hidden). Now, when a new instance of PXVControl is created - it again defaults to PXV_VisibleCmdBars_All - so somehow the set value is not preserved as if not global (but acts as if is) - and all bars on all existing PXVControl instances are back to visible.

I'm now storing (custom handling cmd.view.toggleAllCmdBars via IUIX_CmdHandler) the value of VisibleCmdBars as my local field. When a new PXVControl is created I'm setting VisibleCmdBars for it to my internally stored value. Works.

So, Q1 and Q3 solved.

Still open questions:

[Q2] VisibleCmdBars does not unhide the bars that I've hidden from code using IUIX_CmdBar.Hide. I'm ok with this - just curious to know why ?

[Q4] toggleAllCmdBars does not hide my custom added bars. Again, I'm ok with it - just would be more at ease if this is confirmed to be "as designed".

-žarko