Customize the built-in menu bars and panes  SOLVED

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

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

Post Reply
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Customize the built-in menu bars and panes

Post by Shaun Luttin »

We would like to use parts of the built-in menu bars and panes. For instance, in the Zoom bar, we might only want to expose the slider. How can we do that programmatically?
Capture.PNG
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Customize the built-in menu bars and panes

Post by Tracker Supp-Stefan »

Hello Shaun,

The easiest way would be to install the end user Viewer, customize the UI there to the way you want it - and then export the settings to a data file.
Then use the LoadSettings() method to load that file in the AX control immediately after you load the control itself in your project.

Regards,
Stefan
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Re: Customize the built-in menu bars and panes

Post by Shaun Luttin »

Thank you. We'll give that a try.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Customize the built-in menu bars and panes

Post by Tracker Supp-Stefan »

:)
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Re: Customize the built-in menu bars and panes

Post by Shaun Luttin »

We tried that and are receiving an exception that says, "Source storage is wrong."
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Re: Customize the built-in menu bars and panes  SOLVED

Post by Shaun Luttin »

We were able to make this work by exporting the settings from our application instead of from the end-user viewer. This is how we did it.

Code: Select all

public void SaveSettings() {
    try {
        // SavePath is an absolute path to a *.dat file
        var obj = SavePath as object;
        _viewer.SaveSettings(ref obj);
    }
    catch (Exception ex) {
        _viewer.GetTextFromResult(ex.HResult, out var text);
        Pd.Trace(text);
    }
}

public void LoadSettings() {
    try {
        // LoadPath is an absolute path to a *.dat file
        var obj = LoadPath as object;
        _viewer.LoadSettings(obj);
    }
    catch (Exception ex) {
        _viewer.GetTextFromResult(ex.HResult, out var text);
        Pd.Trace(text);
    }
}
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Customize the built-in menu bars and panes

Post by Tracker Supp-Stefan »

Glad to hear all is now solved Shaun Luttin,

And thanks for sharing it for everyone to see!

Cheers,
Stefan
Post Reply