Add link action for GOTOR SOLVED
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.
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.
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Add link action for GOTOR
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":
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:
That is:
So, something like
PXV_Control1.Inst.ExecUICmd('cmd.addLink.goto', nil);
or
PXV_Control1.Inst.ExecUICmd('cmd.addLink.launch', nil);
But for GOTOR.
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":
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:
That is:
So, something like
PXV_Control1.Inst.ExecUICmd('cmd.addLink.goto', nil);
or
PXV_Control1.Inst.ExecUICmd('cmd.addLink.launch', nil);
But for GOTOR.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
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.pdf-xchange.com/vi ... g_ShowItem:
Cheers,
Alex
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.pdf-xchange.com/vi ... g_ShowItem:
Code: Select all
dlg.ShowItem("btn.advanced", false);
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
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 ?
-ž
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
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Hello zarkogajic,
Sadly, no such command is available.
Cheers,
Alex
Sadly, no such command is available.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
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"
-ž
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
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
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
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
Hi Alex,
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.
-ž
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.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.pdf-xchange.com/vi ... g_ShowItem:Code: Select all
dlg.ShowItem("btn.advanced", false);
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
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Hello zarkogajic,
Well there is an easier way for you - just remove that button from the xml itself - nothing more is needed.
Cheers,
Alex
Well there is an easier way for you - just remove that button from the xml itself - nothing more is needed.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
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.
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
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
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
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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
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:
I've tried various approaches to get from that pointer (outPTR) to the IUIX_Dialog dlg instance - but all failed...
To test: click the button "btnLoadFIle", then "btnLinkTool" and do a rectangle to activate the link tool dialog.
-ž
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);
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 68 times
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Hello zarkogajic,
Forwarded this one to him. Will reply back when he'll have some time to look at this one.
Cheers,
Alex
Forwarded this one to him. Will reply back when he'll have some time to look at this one.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
Hi Alex,
I got it working, no need to bother your Delphi-guy
-ž
I got it working, no need to bother your Delphi-guy
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
Hi Alex,
In this post viewtopic.php?f=66&t=28347&p=111997&hil ... st#p112175 you show how to hide the "cmd.actions.add" command.
Such a command does not exist (any more) correct (so that code does not apply any more)?
I can get to the "DlgEditActionsList" dialog and monitor it, but that top "command line" is not a part of dialog items.
Is there ANY way to hide some of the actions listed from that "Add..." menu?
Is there ANY way to initiate adding any of the listed action like GOTO or GOTOR or Launch without the need to select from the drop down?
-žarko
I'm waking up this topic, just to double/triple check something...
In this post viewtopic.php?f=66&t=28347&p=111997&hil ... st#p112175 you show how to hide the "cmd.actions.add" command.
Such a command does not exist (any more) correct (so that code does not apply any more)?
I can get to the "DlgEditActionsList" dialog and monitor it, but that top "command line" is not a part of dialog items.
Is there ANY way to hide some of the actions listed from that "Add..." menu?
Is there ANY way to initiate adding any of the listed action like GOTO or GOTOR or Launch without the need to select from the drop down?
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Hello žarko,
Here's a code sample -it show you how the command IDs are formed, how to call them and also the access to the SubMenu to remove the unneeded ones:
Cheers,
Alex
Here's a code sample -it show you how the command IDs are formed, how to call them and also the access to the SubMenu to remove the unneeded ones:
Code: Select all
public static PDFXEdit.IUIX_ScrollContainer GetParentScrollContainer(PDFXEdit.IUIX_Obj obj)
{
if (obj.Parent != null)
{
IntPtr outPtr;
obj.Parent.QueryImpl(typeof(PDFXEdit.IUIX_ScrollContainer).GUID, null, out outPtr);
PDFXEdit.IUIX_ScrollContainer sc = (PDFXEdit.IUIX_ScrollContainer)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
if (sc != null)
return sc;
return GetParentScrollContainer(obj.Parent);
}
return null;
}
if ((pEvent.Code == (int)PDFXEdit.UIX_EventCodes.e_ShowModal)) //launched after the BeginModal
{
if (pTarget.ID == pTarget.ThreadCtx.Inst.Str2ID("DlgEditActionsList"))
{
IntPtr outPtr;
pTarget.QueryImpl(typeof(PDFXEdit.IUIX_Dialog).GUID, null, out outPtr);
PDFXEdit.IUIX_Dialog dlg = (PDFXEdit.IUIX_Dialog)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
if (dlg == null)
return;
PDFXEdit.IUIX_List lst = null;
PDFXEdit.IUIX_Obj obj = dlg.GetItem("actions");
if (obj != null)
{
obj.QueryImpl(typeof(PDFXEdit.IUIX_List).GUID, null, out outPtr);
lst = (PDFXEdit.IUIX_List)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
}
if (lst == null)
return;
IUIX_ScrollContainer sc = GetParentScrollContainer(obj);
if (sc == null)
return;
IUIX_CmdBar bar = sc.CmdPaneTop[0][0];
if (bar == null)
return;
IPXS_Inst pxsInst = (IPXS_Inst)m_Inst.GetExtension("PXS");
IUIX_CmdItem itAdd = bar.FindFirstItemByCmdName("cmd.actions.add");
for (uint i = 0; i < m_Inst.ActionHandlersCount; i++)
{
IPXV_ActionHandler ah = m_Inst.ActionHandler[i];
if ((ah.Flags & (int)PXV_ActionHandlerFlags.AHF_Hidden) != 0)
continue;
int nID = m_Inst.Str2ID(pxsInst.AtomToStr(ah.Type));
int nIndex = itAdd.SubMenu.FindFirstItemByCmdID(nID);
IUIX_Cmd subCmd = itAdd.SubMenu.FindFirstCmd(nID);
subCmd.Handler.OnNotify((int)UIX_CmdNotifyCodes.UIX_CmdNotify_Exec, subCmd, null, null, 0);
break;
}
}
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
Hi Alex,
Thanks much, this works!
A confirmation please: all those commands (like "cmd.actions.add") are created/generated on the fly and removed when the dialog is no longer used? As if I go over CmdManager.Cmds they are not there.
p.s.
In your code "GetParentScrollContainer(obj);" should actually be "GetParentScrollContainer(lst.Obj);"
-ž
Thanks much, this works!
A confirmation please: all those commands (like "cmd.actions.add") are created/generated on the fly and removed when the dialog is no longer used? As if I go over CmdManager.Cmds they are not there.
p.s.
In your code "GetParentScrollContainer(obj);" should actually be "GetParentScrollContainer(lst.Obj);"
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR SOLVED
Hello žarko,
These commands are not registered in the Command Manager - thus they only live until the dialog is opened and to get to them, such complicated coding is required. And yes, the list's object should be used to obtain it's parent scroll container.
Cheers,
Alex
These commands are not registered in the Command Manager - thus they only live until the dialog is opened and to get to them, such complicated coding is required. And yes, the list's object should be used to obtain it's parent scroll container.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Add link action for GOTOR
Thanks Alex, time to "solved" this topic
-ž
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add link action for GOTOR
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ