e_docSelection_changed question

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

e_docSelection_changed question

Post by lidds »

I have started developing my own comment form as it gives some more features to my users for my tool than the currently one. Everything seems to be going OK, apart from this one issue.

I am intercepting the e_docSelection_changed event so that when the user selects a markup from the document it automatically selects the comment from my new comment grid, using the code below:

Code: Select all

						Dim Doc As PDFXEdit.IPXV_Document = CType(e.pFrom, PDFXEdit.IPXV_Document)
                        Dim nLen As UInteger = e.pEvent.Param2
                        Dim buffer = New Integer(nLen - 1) {}
                        Dim ptr As IntPtr = New IntPtr(e.pEvent.Param1)

                        If nLen = 0 Then
                            ' Deselect all rows as nothing is selected in the PDF document
                            MISData.Instance.frmDocDesigner.selectAnnotGridRow(-1)
                        Else
                            Marshal.Copy(ptr, buffer, 0, CInt(nLen))
                            For i As UInteger = 0 To nLen - 1
                                Dim docSel As PDFXEdit.IPXV_DocSelection = Doc.GetSelCluster(buffer(i))
                                Dim annotSel As PDFXEdit.IPXV_AnnotSelection = TryCast(docSel, PDFXEdit.IPXV_AnnotSelection)
                                If annotSel IsNot Nothing Then
                                    If annotSel.Items.Count <> 0 Then
                                        For annotCount As UInteger = 0 To annotSel.Items.Count - 1
                                            Dim rowHandle As Integer = commonCode.GetRowHandleByColumnValue(MISData.Instance.frmDocDesigner.gridAnnotations, "annotOID", annotSel.Items(annotCount).Name)

                                            If rowHandle <> -1 Then
                                                MISData.Instance.frmDocDesigner.selectAnnotGridRow(rowHandle)
                                            End If
                                        Next
                                    End If
                                End If
                            Next
                        End If
The above code works fine when selecting a markup individually, however is I try to draw a selected region and select multiple markups it stops the drawing of the completed region on the document.

I was wondering if there is an event that is raised when a selected region is completed? If not is there a way that you can think of that I can get this executing correctly?

Thanks

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

Re: e_docSelection_changed question

Post by Sasha - Tracker Dev Team »

Hello Simon,

What do you mean by "selecting a region"?

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

Re: e_docSelection_changed question

Post by lidds »

Hi Alex,

What I mean is when I depress the left mouse button and stretch a selection window to select multiple markups.

I hope that clarifies?

Thanks

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

Re: e_docSelection_changed question

Post by Sasha - Tracker Dev Team »

Hello lidds,

From what I see, you are selecting something on your form, that means that you are moving the focus from the Control. That can cause the selection to stop dragging as you describe.

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

Re: e_docSelection_changed question

Post by lidds »

Hi Alex,

Yes you are correct, this was the error, should have seen this.

Instead a used a selection flag and intercepted the left button up mouse event.

Thanks for you help

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

e_docSelection_changed question

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply