Multiple controls with different commandbars

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

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.
Post Reply
DeKo
User
Posts: 56
Joined: Thu Sep 28, 2017 9:45 am

Multiple controls with different commandbars

Post by DeKo »

Hello,

so, in our software we often use multiple controls in different windows. So far we never had problems (and the following isn't really a huge problem but somewhat ugly). So, we have window A and window B. The control in window A does have following bars: file, zoom, commenting, rotating. On the other hand, window B has: file, zoom and rotating. For enabling and disabling the bars, i use the following piece of code:

Code: Select all

pdfCtl.Inst.ShowCmdBar2(IDs[(int)id], value);
On the first sight its not that obvious, but i realized the bars are tied to the instance (which is basically a singleton through out the runtime of the application). This leads to weird interactions between multiple windows: When i let window B create the pdf control, don't close it and open window A with the pdf control, the bars in the control of window B gets changed, too.

Is there a solution to this problem or is there no way around?

Greetings,
Dennis
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Multiple controls with different commandbars

Post by Sasha - Tracker Dev Team »

Hello Dennis,

It's somewhat more complicated if you want to use it in multiple control environment.
Please download the latest FullDemo version from the github and see the CmdFileTree.cs
There is a sample, on how to load and synchronize all of the command bars with the active main view.
In your case you should get the needed IPXV_MainFrame by index

Code: Select all

pdfCtl.Inst.MainFrm[i]
and then get the IPXV_MainView from it.
Then see the CollectAllTabsAndBars method to obtain the IUIX_CmdBar with needed ID and then you can use it's Hide()/Show() methods.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DeKo
User
Posts: 56
Joined: Thu Sep 28, 2017 9:45 am

Re: Multiple controls with different commandbars

Post by DeKo »

Hello Alex,

thanks for the sample :) I was unable to test that out yet since my schedule is pretty tight, but i'll keep that in mind when i'm approaching that problem again.

If anything comes up i just let you know.


Greetings,
Dennis
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Multiple controls with different commandbars

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply