Overriding Form Editor Draw Event  SOLVED

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.
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Overriding Form Editor Draw Event

Post by Lambchop »

The title is a little misleading and I am sure that it has been answered somewhere previously in this forum. What I am trying to do is:
Goal: Popup a "required" window with specific properties the user must enter whenever they are adding a form editor field. Regardless if it is a textbox, drop down, list, or radio editor, I need it to draw the control and then immediately pull up a form (where I set a lot of other properties).
Problem: I cannot figure out how to trap the after editor draw event so that I can set the additional properties on the editor control or if the user cancel outs then I delete or "cancel" the editor control object that was just drawn.

I am getting stuck on how to trap the after editor draw event. Please advise when you get the chance!
Best Wishes
-Eric
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Overriding Form Editor Draw Event

Post by Vasyl-Tracker Dev Team »

If I understand you correctly - you may try to use the CustomTool.PagesMarkupTool.OnMouseUp method to catch the moment when user released the left mouse button and finished creation of new rectangle-region of selection...
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Re: Overriding Form Editor Draw Event

Post by Lambchop »

So I need to create my own custom tools for every one of the form editors just to trap the OnMouseUp event? Are you sure there is no event triggered after a form editor (like a text box) is added to a layer?

If I have to write my own custom tool to replace every one of the tracker form editor tools just to trap the OnMouseUp event then I have to override the PDX menus too and it becomes a cascade of coding headaches just so that I can trap the OnMouseUp event. I sure hope I am misunderstanding your recommendation. Can you confirm when you get chance? -Eric
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Overriding Form Editor Draw Event

Post by Vasyl-Tracker Dev Team »

Another option - you may intercept the "e.formFields.inserted", like:

Code: Select all

int e_formField = pxvInst.Str2ID("e.formFields.inserted");

OnEvent(eventID,  event)
{
      if (eventID == e_formField)
      {
           IPXV_FormFieldsList fieldsList = (IPXV_FormFieldsList)e.pFrom;
           foreach (IPXC_FormField field : fieldsList)
           {
                 PXC_FormFieldType type = field.Type; // FFT_Text, FFT_ComboBox, ...
                 uint wc = field.WidgetsCount; // ==1 typically
                 for (uint i = 0; i < wc; i++)
                 {
                       IPXC_Annotation widget = field.Widget(i);
                       widget.PageIndex;
                       widget.Rect; // rect on page, in page's coord. system
                       IPXC_AnnotData_Widget adw = (IPXC_AnnotData_Widget)widget.Data;
                       ... 
                 }
           }
      }
}
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Re: Overriding Form Editor Draw Event

Post by Lambchop »

Vasyl - Thank you!! Can you please look at the attached project and tell me why the OnEvent handler is not firing? What is getting instantiated in the FullDemo that I am missing ... this does not make any sense as this should be super simple.
XChangeTesting.zip
XChangeTestingCSharp.zip
You do not have the required permissions to view the files attached to this post.
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Re: Overriding Form Editor Draw Event

Post by Lambchop »

To be more specifically clear ... the OnEvent does NOT fire simply by adding the control and its associated OnEvent method. Why?
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Overriding Form Editor Draw Event  SOLVED

Post by zarkogajic »

Hi,

Take a look at: https://sdkhelp.pdf-xchange.com/view/PXV:IPXV_Control_EnableEventListening

And check how it is implemented in FullDemo.

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Overriding Form Editor Draw Event

Post by Vasyl-Tracker Dev Team »

Thank you, Zarko! :)
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.