Add link action for GOTOR  SOLVED

PDF-XChange Editor SDK for Developers

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

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
zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Add link action for GOTOR

Post by zarkogajic » Mon Sep 09, 2019 3:29 pm

Hi devs,

Say I'm interested only in (creation of) goto / gotor links.

Having the link tool active, dragging a rectangle OR having the text selection tool active and selecting "add goto link" will bring this dialog "Browse for Link Target":
image.png
How do I go about hiding the "Advanced..." button?

Or, renaming the "Advanced..." button to "Another document" (example) and then directly initiating the "GOTOR" action:
image.png
image.png (45.88 KiB) Viewed 380 times
That is:
image.png
image.png (48.62 KiB) Viewed 380 times

So, something like

PXV_Control1.Inst.ExecUICmd('cmd.addLink.goto', nil);

or

PXV_Control1.Inst.ExecUICmd('cmd.addLink.launch', nil);

But for GOTOR.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Tue Sep 10, 2019 6:58 am

Hello zarkogajic,

Here's the topic that would prove useful:
viewtopic.php?f=66&t=30597&p=122214&hil ... og#p122214
After you have the IUIX_Dialog, you can hide the Advanced button by using https://sdkhelp.tracker-software.com/vi ... g_ShowItem:

Code: Select all

dlg.ShowItem("btn.advanced", false);
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Tue Sep 10, 2019 10:14 am

Hi Alex,

Thanks. I'll take a look...

How about:

Something like
PXV_Control1.Inst.ExecUICmd('cmd.addLink.goto', nil);
or
PXV_Control1.Inst.ExecUICmd('cmd.addLink.launch', nil);

But for GOTOR.

So to directly call the GOTOR UI ?


User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Tue Sep 10, 2019 12:34 pm

Hello zarkogajic,

Sadly, no such command is available.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Tue Sep 10, 2019 1:38 pm

Alex,

Ah :( Any chance such command will be added ?

Btw, this topic: viewtopic.php?f=66&t=30597&p=122214&hil ... og#p122214

How do I know the name of dialog for "cmd.addLink.goto", like how "DlgSplitPages" was used in that code?

You mention some "Resources.dat" but I do not see where to find this.

?

Also, for "dlg.ShowItem("btn.advanced", false);" - where to get button names like ""btn.advanced"



User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Tue Sep 10, 2019 2:03 pm

The Resources.dat is located near the dlls that you have installed with Editor SDK. Inside it there is a DlgTemplates.xml file that holds all of the dialogs.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Tue Sep 10, 2019 2:55 pm

Hi Alex,
Sasha - Tracker Dev Team wrote:
Tue Sep 10, 2019 6:58 am
viewtopic.php?f=66&t=30597&p=122214&hil ... og#p122214
After you have the IUIX_Dialog, you can hide the Advanced button by using https://sdkhelp.tracker-software.com/vi ... g_ShowItem:

Code: Select all

dlg.ShowItem("btn.advanced", false);
I have the EventMonitor running, listening for "e_ShowModal" but it does not work for the "Browse for link target" dialog - as this is not a modal window.

Any idea?

p.s.
When I click the "Advanced..." button (the one I want to hide) it does fire for "Edit Action List" window - as this one is modal.


User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Tue Sep 10, 2019 2:56 pm

Hello zarkogajic,

Well there is an easier way for you - just remove that button from the xml itself - nothing more is needed.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Tue Sep 10, 2019 3:24 pm

:) Well, that's a straightforward approach.

Yes, but that would remove it for good. I want to do it programmatically (if possible) as in some scenarios I want the user to have it and in some not.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR  SOLVED

Post by Sasha - Tracker Dev Team » Wed Sep 11, 2019 9:35 am

Hello zarkogajic,

You should get the needed dialog as advised here (only use your ID):
viewtopic.php?f=66&t=27795&hilit=find+dialog#p108843

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Wed Sep 11, 2019 10:45 am

Hi Alex,

Thanks that helped. However I would again need some help from your Delphi-guy :)

Attached is a sample application.

I cannot get past one line of code:

Code: Select all

function TIUIX_EventMonitor.OnEventMonitor(const pTarget: IUIX_Obj; const pEvent: IUIX_Event): HResult;
...
    guid := GetTypeData(TypeInfo(IUIX_Dialog))^.Guid;
    pTarget.QueryImpl(guid, nil, outPtr);

    //Access Violation here
    dlg := IUIX_Dialog(outPtr);
I've tried various approaches to get from that pointer (outPTR) to the IUIX_Dialog dlg instance - but all failed...
image.png
image.png (15.36 KiB) Viewed 340 times
To test: click the button "btnLoadFIle", then "btnLinkTool" and do a rectangle to activate the link tool dialog.

Attachments
pdfxchange-eventmonitoring.zip
(52.87 KiB) Downloaded 2 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Wed Sep 11, 2019 1:57 pm

Hello zarkogajic,

Forwarded this one to him. Will reply back when he'll have some time to look at this one.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 63
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add link action for GOTOR

Post by zarkogajic » Thu Sep 12, 2019 2:56 pm

Hi Alex,

I got it working, no need to bother your Delphi-guy :)


User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add link action for GOTOR

Post by Sasha - Tracker Dev Team » Fri Sep 13, 2019 6:58 am

:D
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply