Right click not selecting correct annotation item...

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
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Right click not selecting correct annotation item...

Post by lidds »

I have a custom onEvent that I am using to show a custom contextMenu, see code below. This contextMenu display different options depending on the selected annotation. This all works fine if I firstly select the annotation element (left mouse click) and then right click. However if I simply right click onto an annotation element it uses the annotation element previously selected?

Code: Select all

Public Sub OnEvent(pSender As PDFXEdit.IUIX_Obj, pEvent As PDFXEdit.IUIX_Event) Implements PDFXEdit.IUIX_ObjImpl.OnEvent
            If pEvent.Code = CInt(&H204) Then
                Dim pt As PDFXEdit.tagPOINT
                pt.x = pEvent.Pos.x
                pt.y = pEvent.Pos.y
                Dim screenPt As PDFXEdit.tagPOINT
                Dim nHitTestCode As Integer = 0
                Dim annot As PDFXEdit.IPXC_Annotation = Parent.docPreview.Doc.ActiveView.PagesView.GetAnnotFromPt(pt, nHitTestCode)
                pSender.ClientPtToScreen(pt, screenPt)

                If annot IsNot Nothing Then
                    If MISData.Instance.ViewerMode = "Markup" Then                        
                        Parent.popupMarkup.ShowPopup(New Point(screenPt.x, screenPt.y))
                    End If
                Else
                    If MISData.Instance.ViewerMode <> "View" Then
                        Parent.RadialMenu1.ShowPopup(New Point(screenPt.x, screenPt.y))
                    End If
                End If
Thanks

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

Re: Right click not selecting correct annotation item...

Post by Sasha - Tracker Dev Team »

Hello Simon,

Can you recreate this in the End-User Editor? If so, then please provide a sample document and a way to reproduce this behavior.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Right click not selecting correct annotation item...

Post by lidds »

Alex,

Sorry this was my fault, I was displaying the popup before the e_docSelection_changed event fired.

Thanks

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

Re: Right click not selecting correct annotation item...

Post by Sasha - Tracker Dev Team »

Glad you had this sorted out.

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