Way to override open for any supported file type

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
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Way to override open for any supported file type

Post by DolphinMann »

Is there a way to override the open button to always have the filter for any supported file type? I know how to make a NEW button or command that will do it, but it seems redundant since there is always an open button within the standard GUI.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Way to override open for any supported file type

Post by Sasha - Tracker Dev Team »

Hello DolphinMan,

You mean you want to change the filter type in our open dialog to *.*?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: Way to override open for any supported file type

Post by DolphinMann »

Essentially, but not exactly. I want to change it to:

pdfCtl.Inst.ShowOpenFilesDlg(sFilter, "", bAllowMult);

Where sFilter = "<allSupp>"

I can do this of course with my own button or some other code line override, but I was wondering if it is possible to have the primary open button button in the GUI control use that filter to show all supported file types instead of just PDFs.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Way to override open for any supported file type

Post by Sasha - Tracker Dev Team »

Hello DolphinMann,

Well what you can do is to implement custom cmd.open command handler where you would call your code in the OnNotify method. By saving the old handler within the custom handler's class you should be able to leave all of the default functionality intact.
Here's the sample of the command handler's implementation for custom save and saveAs commands:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6
You should be able to implement this class for the open command by analogy.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: Way to override open for any supported file type

Post by DolphinMann »

confirmed working, thank you
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Way to override open for any supported file type

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: Way to override open for any supported file type

Post by DolphinMann »

Similar question.....

Is there a way to have the drag and drop of pages between multiple PDF documents be a "MOVE" rather than a "COPY"? Would I have to override the handler like I have done here or is this a setting somewhere(couldn't find it if it is).
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Way to override open for any supported file type

Post by Sasha - Tracker Dev Team »

Hello DolphinMann,

I'm afraid Drag and Drop is not nearly that simple. The thing is that this behavior is hard-coded and is default for most Windows programs. When you press the Shift button the pages will be moved not copied.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply