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?
Customize the built-in menu bars and panes SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- Shaun Luttin
- User
- Posts: 20
- Joined: Tue Apr 17, 2018 12:13 am
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Customize the built-in menu bars and panes
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
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
- Shaun Luttin
- User
- Posts: 20
- Joined: Tue Apr 17, 2018 12:13 am
Re: Customize the built-in menu bars and panes
Thank you. We'll give that a try.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
- Shaun Luttin
- User
- Posts: 20
- Joined: Tue Apr 17, 2018 12:13 am
Re: Customize the built-in menu bars and panes
We tried that and are receiving an exception that says, "Source storage is wrong."
- Shaun Luttin
- User
- Posts: 20
- Joined: Tue Apr 17, 2018 12:13 am
Re: Customize the built-in menu bars and panes SOLVED
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);
}
}
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Customize the built-in menu bars and panes
Glad to hear all is now solved Shaun Luttin,
And thanks for sharing it for everyone to see!
Cheers,
Stefan
And thanks for sharing it for everyone to see!
Cheers,
Stefan