TogleAllBars

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

TogleAllBars

Post by anovy »

Hi,
Is there a way how to simply (with only one DoVerb call) find if any bar is active? Or must I enumerate all posible bars? I need this to know if the TogleAllBars command will hide or show bars before I will issue this command. BTW: This question would be pointless if you will provide ShowAllBars and HideAllBars commands. However I did not find such commands, only togle.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Hi, anovy
Is there a way how to simply (with only one DoVerb call) find if any bar is active?
Sorry, no simple way for this.
But, we will add new ShowAllBars/HideAllBars commands into the next build.

Best
Regards.
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Thank you.

Yet another issue:
The 'All' in ToggleAllBars means only those bars which are enabled by the user (i.e. second call to ToggleAllBars restores the previous state). So I suppose the ShowAllBars will work by the same way. OK?

And I just found maybe some error in ToggleAllBars (or in SaveSettings/LoadSettings). When the settings are saved with all bars hidden (after ToggleAllBars hid all bars), then after LoadSettings and ToggleAllBars (which should restore the bars) it is not restored the Document Tab (i.e. it is not kept the previously used Tabbed Documents mode). All other bars are restored by this way correctly. A simple togle (i.e. twice ToggleAllBars without SaveSettings/LoadSettings) keeps correctly also the Document Tab.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Hi, anovy
Yet another issue:
The 'All' in ToggleAllBars means only those bars which are enabled by the user (i.e. second call to ToggleAllBars restores the previous state). So I suppose the ShowAllBars will work by the same way. OK?
It's not an error, it is right behavior of the "ToggleAllBars" command and it is by design.
I don't understand what behavior of the "ShowAllBars" command is wanted by you. Do you want to show bars which are enabled by the user or to really show all(!) bars?
I think the default behavior of the "ShowAllBars" will be "really show all bars", but with special flag like "MatchUserPrefs" it could show only bars which are enabled by user.
The same applies to the "HideAllBars" command.
And I just found maybe some error in ToggleAllBars (or in SaveSettings/LoadSettings). When the settings are saved with all bars hidden (after ToggleAllBars hid all bars), then after LoadSettings and ToggleAllBars (which should restore the bars) it is not restored the Document Tab (i.e. it is not kept the previously used Tabbed Documents mode). All other bars are restored by this way correctly. A simple togle (i.e. twice ToggleAllBars without SaveSettings/LoadSettings) keeps correctly also the Document Tab.
It occurs because the control and end-user application saves the actual(!) visibility state of each UI-bar, but not user's temporary prefs which are used by ToggleAllBars operation.
In the future we can improve this behavior and add the ability to save a user's temporary bar-visibility-prefs.

Best
Regards.
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Hi again,
I need the ShowAllBars/HideAllBars pair to work like ToggleAllBars (i.e. show bars as they are defined by user's prefs). I need under some conditions to temporarily hide the bars and then restore them after the conditions are left. Moreover I realized that I will still need some function to recognize if all bars are hidden or not, so I will be able to correctly restore previous status.

Regarding the problem with SaveSettings/LoadSettings:
I understand why it occurs, but I think it is error, because here SaveSettings/LoadSettings does not restore the previous status. BTW: The same occurs also in your PDF XChange viewer application.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Hi, anovy.

Okay. We will improve behavior for ToggleAllBars command and add ShowAllBars/HideAllBars commands by your suggestions.
May be in the next build.

Best
Regards.
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Thank you. I think you already have similar functionality in your PDF XChange viewer application in full-screen mode, where you hide all bars if user enters full screen mode, and you restore them if user leaves full-screen mode. So maybe the only work which you should do is to expose this functionality.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

No. For the full-screen mode we have separate layout for all bars(position+visibility). Application(standalone only) enables this layout when user enters into full-screen mode.
When user exits from the full-screen mode application restores the main-layout of the all bars. And the "Full Screen" feature is unavailable in activeX-mode,
it is end-user feature only in current realization. You should imitate this functionality in your code.

But certainly in the future we can expose this functionality.
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Thank you for your effort Vasyl.

BTW: I meant the functionality regarding the bars visibility. I know that the full screen feature must be implemented by the client application.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Hi again,
I encountered a new problem regarding the ToggleAllBars command. As discussed before, the ToggleAllBars command toggles the bars as they are defined by user's prefs. However I found that this is not applied to bars opened programatically, but probably only those selected manually via UI. In my application, when no previous saved configuration is found, then I programatically open some inital set of bars (menu and some toolbars). Then the subseqsent pair of ToggleAllBars commands does not restore this my set of bars, but it shows all possible bars. So could you please fix this?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Will try to fix it...
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

I just found a workaround - a negative approach: If I first show all possible bars and then I hide the unwanted ones, then ToggleAllBars works as expected. The most complicated thing here are document bars. Because I must do this before any document is opened, I must create and then close a temporary new empty document, so I can work (show/hide) also document bars. Or is there any other way how to virtually show/hide a document bar if no document is opened?

In either case I hope you will fix the matter, because the above approach is complicated and uncommon.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Hi again,
I found new bug in ToggleAllBars. If no main bar is displayed, i.e. only some document bar is displayed, then TogleAllBars does nothing (it does not toggle alone document bars).
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Hi, anovy.

So:
And I just found maybe some error in ToggleAllBars (or in SaveSettings/LoadSettings). When the settings are saved with all bars hidden (after ToggleAllBars hid all bars), then after
LoadSettings and ToggleAllBars (which should restore the bars) it is not restored the Document Tab (i.e. it is not kept the previously used Tabbed Documents mode).
This issue fixed.
I need the ShowAllBars/HideAllBars pair to work like ToggleAllBars (i.e. show bars as they are defined by user's prefs). I need under some conditions to temporarily hide the bars and then
restore them after the conditions are left. Moreover I realized that I will still need some function to recognize if all bars are hidden or not, so I will be able to correctly restore previous
status. Regarding the problem with SaveSettings/LoadSettings: I understand why it occurs, but I think it is error, because here SaveSettings/LoadSettings does not restore the previous
status. BTW: The same occurs also in your PDF XChange viewer application.
Added ShowAllBars/HideAllBars commands, which change visibility of all bars from user's set (like as ToggleAllBars).
Also added the new method for test visibility of bars, HasVisibleBars - returns non-zero if there is at least one visible bar:

Code: Select all

DoVerb(NULL, "HasVisibleBars", dataIn, dataOut, 0);
// dataOut == 1|0;
Or is there any other way how to virtually show/hide a document bar if no document is opened?
In the new build you will be able to enumerate and change it, for example(pseudocode):

Code: Select all

GetProperty("Documents.LastView.Bars.Count", count);
for (i = 0; i < count; i++)
{
     GetProperty("Documents.LastView.Bars[" + i + "].Visible", val);   
     SetProperty("Documents.LastView.Bars[" + i + "].Visible", !val);
};
I found new bug in ToggleAllBars. If no main bar is displayed, i.e. only some document bar is displayed, then TogleAllBars does nothing (it does not toggle alone document bars).
This issue fixed.

----
All fixes and new features will be available in the new build(upcoming). Thanks for your help.

Best
Regards.
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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Thank you very much. You have great product with excellent support!
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: TogleAllBars

Post by John - Tracker Supp »

Pleasure and thanks for your patience - the new build will be available a little later this week

Cheers
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: TogleAllBars

Post by anovy »

Hi again,
I'm just testing the new version, thank you for it.

However I'm still unable to set the document options bar as visible without first opening a document. In my application when no previous settings were loaded, then I call
SetProperty("Documents.LastView.Bars[#33262].Visible",TRUE);
This returns S_OK. Then I expected that after opening a document, the Options bar will be shown. But it is not. What I do wrong? Or maybe I did not understand correctly the meaning of the LastView item (it is still undocumented)?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: TogleAllBars

Post by Vasyl - PDF-XChange »

Hi, anovy.

Unfortunately, this issue is confrimed, will be fixed in the next build.
Sorry for delay with this...

Best
Regards.
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.