Edit Model/Currently tool

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
HomerWu
User
Posts: 91
Joined: Fri Nov 25, 2016 8:19 am

Edit Model/Currently tool

Post by HomerWu »

Hello

Do you have a Method or Property to get which tool is using currently?
for example,when we click 'Hand tool' button,the arror become a hand and we can just use it prview the pdf
when we click 'Zoom tool' button,the arror become a magnifier and we can use it change the zoom of the pdf,
when we click 'Line tool' button,the arror become a Quasi-minded and we can use it draw lines on the pdf……

i'm now use my owner button to use diffirent tools,and I have two questions:
1.how can i get which tool is using currently?
2.do you have any event for tool changing or tool changed?

I'm look for you help,any sample code is much more help for me.

Thanks.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Edit Model/Currently tool

Post by Sasha - Tracker Dev Team »

Hello HomerWu,

Have you tried searching our wiki - there is an ActiveTool property https://sdkhelp.pdf-xchange.com/vie ... ActiveTool
Also there is this event - https://sdkhelp.pdf-xchange.com/vie ... lActivated

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
HomerWu
User
Posts: 91
Joined: Fri Nov 25, 2016 8:19 am

Re: Edit Model/Currently tool

Post by HomerWu »

Hello Sasha,

:?

Thanks for your reply.
one more question,i found that when i edit form,the activetool name is 'Edit Fields',but no matter what control I add(Text Field/Check Box/Button ect),
the activetool always be 'Edit Fields',how can i get the sub name of the activetool?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Edit Model/Currently tool

Post by Sasha - Tracker Dev Team »

Hello HomerWu,

I'm doing this and everything works as expected for me:

Code: Select all

if (e.nEventID == nIDS[(int)IDS.e_document_toolActivated])
{
	PDFXEdit.IPXV_Tool tool = pdfCtl.Doc.ActiveTool;
	string s = tool.Name;
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
HomerWu
User
Posts: 91
Joined: Fri Nov 25, 2016 8:19 am

Re: Edit Model/Currently tool

Post by HomerWu »

Hello Sasha,

Maybe you did not understand what I meant.
Yes,i can get the tool name by using the code 'PDFXEdit.IPXV_Tool tool = pdfCtl.Doc.ActiveTool',but,how can i get its subname?
please have a look at the attachment below,when i click 'Radio Button' item,the 'Radio Button' item checked,and i can add radio button to the document.when i click 'Button' item,the 'Button' item checked,and i can add button to the document……
I can get the ActiveToll is 'Edit Fields',but i also want to know what field will be added to the document when i left click mouse,so,do you have any way to help me ?

Thanks.
Attachments
edit field.png
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Edit Model/Currently tool

Post by Sasha - Tracker Dev Team »

Hello HomerWu,

There is no direct way of knowing that through the e.document.toolActivated alone. There is a way of doing this though. These all buttons are commands so basically what you can do is implement a custom commands' handler as listener and set some variable to mark the currently selected command. Here's the handler's sample:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6
Also, here's the list of all of the commands that are used in that menu bar:
cmd.tool.editFields.mode.select,
cmd.tool.editFields.mode.text,
cmd.tool.editFields.mode.check,
cmd.tool.editFields.mode.radio,
cmd.tool.editFields.mode.list,
cmd.tool.editFields.mode.combo,
cmd.tool.editFields.mode.button,
cmd.tool.editFields.mode.signature,
cmd.tool.editFields.mode.barcode,

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