Hello Support,
I want to react to the selection of an annotation in the control.
How can I do this?
I don't find an a suitable event to react to in OnEvent method (I only found e.stampSelected).
Maybe there is a way to do this writing a EventListener? On what? What would be the UIX_EventCode?
Kind regards
How to react to annotation selection on Control
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: 34
- Joined: Fri Mar 11, 2022 11:02 am
-
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: How to react to annotation selection on Control
You may try to handle the e.docSelection.changed. Then:
Code: Select all
int id_e_docSelection_changed = Str2ID("e.docSelection.changed");
int id_selection_annots = Str2ID("selection.annots");
....
OnEvent(eventID, event, from)
{
if (eventID == id_e_docSelection_changed)
{
selEvent = (IPXV_DocSelChangedEvent)event;
if (selEvent != null)
{
if (selEvent.Selection[id_selection_annots])
{
doc = (IPXV_Document)from;
if (doc != null)
{
annotSel = (IPXV_AnnotSelection)doc.GetSel(id_selection_annots);
...
}
}
}
}
}
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.
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.
-
- User
- Posts: 34
- Joined: Fri Mar 11, 2022 11:02 am
Re: How to react to annotation selection on Control
Thank you for this answer.
Unfortunately IPXV_DocSelChangedEvent does not exist at design time in the Interop.PDFXEdit.dll that I use (though it is there at runtime) and to change version might lead to other problems
Is there an alternative way?
Unfortunately IPXV_DocSelChangedEvent does not exist at design time in the Interop.PDFXEdit.dll that I use (though it is there at runtime) and to change version might lead to other problems
Is there an alternative way?
-
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: How to react to annotation selection on Control
I checked this, for example, in our FullDemo app, and it seems everything looks good with that. Just used the PDFXEdit.IPXV_DocSelChangedEvent type there...
But anyway, at the moment, you may simplify the code above by removing using that type. It should work without it too:
HTH.
But anyway, at the moment, you may simplify the code above by removing using that type. It should work without it too:
Code: Select all
if (eventID == id_e_docSelection_changed)
{
doc = (IPXV_Document)from;
if (doc != null)
{
annotSel = (IPXV_AnnotSelection)doc.GetSel(id_selection_annots);
...
}
}
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.
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.
-
- User
- Posts: 34
- Joined: Fri Mar 11, 2022 11:02 am
Re: How to react to annotation selection on Control
(Late) thanks for this!
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London