pdfCtl.Doc.OperationHistory and e.annots.inserted / e.annots.deleted

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.
khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

pdfCtl.Doc.OperationHistory and e.annots.inserted / e.annots.deleted

Post by khho »

I have an Undo- and a Redo-Button in my App (they execute cmd.undo and cmd.redo).
I want to start with an unabled Undo-Button and enable it when an annot was added on the AxPXV_Control.
If event in OnEvent is e.annots.inserted I call a Method in my class to enable button when pdfCtl.Doc.OperationHistory.CanUndo.
But this is not set to true yet.

What would be the right way to reach my aim?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: pdfCtl.Doc.OperationHistory and e.annots.inserted / e.annots.deleted

Post by Vasyl-Tracker Dev Team »

Hi khho.

Seems for your case is better to handle the following events:
e.document.historyChanged
or
e.document.modStateChanged

Because e.annots.xxx arriving slightly earlier than doc-history is changed...

HTH.
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.
khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

Re: pdfCtl.Doc.OperationHistory and e.annots.inserted / e.annots.deleted

Post by khho »

Yes, that helped, thank you! :D
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

pdfCtl.Doc.OperationHistory and e.annots.inserted / e.annots.deleted

Post by Tracker Supp-Stefan »

:)