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, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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 » Mon Apr 23, 2018 11:39 pm

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: 13543
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 » Tue Apr 24, 2018 9:56 am

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 » Tue Apr 24, 2018 4:36 pm

Thank you. We'll give that a try.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13543
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 » Wed Apr 25, 2018 8:34 am

:)

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 » Tue May 01, 2018 6:56 pm

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 » Wed May 02, 2018 12:52 am

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: 13543
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 » Wed May 02, 2018 11:11 am

Glad to hear all is now solved Shaun Luttin,

And thanks for sharing it for everyone to see!

Cheers,
Stefan

Post Reply