MouseUp-Event fires too early

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

MouseUp-Event fires too early

Post by Dorwol »

Hello,

thank you for implementing the "Notifications.Mouse" Event. But if I'll check, if the user has select something to "cut", your event fires too early.

For Example:

Private Sub vwViewer_OnEvent(ByVal nType As Long ...)
Dim vState As Variant
vwViewer.GetProperty "Commands[""Cut""].State", vState
Debug.Print vState
End Sub

...if you select something that's normaly possible to cut (like a TextFieldBox), the vState will have "0" ;-(
Only if I select the TextBox once again, your vState will have "1" - because it is the result of the first MouseUp.

If this event is not possible for you to fix, can you spend a "SomethingSelected"-Event as alternative?

BTW: THANK YOU FOR GREAT SUPPORT!
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: MouseUp-Event fires too early

Post by Vasyl - PDF-XChange »

We will add new feature in the next build:
new named notification(example, VB6):

Code: Select all

Call CoPDFXCview1.SetProperty("Notifications.Selection.Filter", -1) 'about all selection changes
Private Sub CoPDFXCview1_OnEvent(ByVal nType As Long, ByVal Name As String, ByVal DataIn As Variant, DataOut As Variant, ByVal Flags As Long)
    If nType = PXCVA_EventTypes.PXCVA_OnNamedNotify Then
        If Name = "Notifications.Selection" Then
            Dim dataOut As Variant
            Dim docID As Integer
            Call CoPDFXCview1.GetProperty("Notifications.Selection.Document", dataOut)
            docID = vDataOut
        End If
    End If
Exit Sub
In your case you may catch "Notifications.Mouse" with "Notifications.Mouse.msg"=WM_LBUTTONUP in current realization.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: MouseUp-Event fires too early

Post by Dorwol »

PERFECT! :P
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: MouseUp-Event fires too early

Post by John - Tracker Supp »

;)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
millerna
User
Posts: 7
Joined: Thu Jul 16, 2009 12:31 am

Re: MouseUp-Event fires too early

Post by millerna »

I am experiencing what I think is a similar problem.

Code: Select all

     spMouse.GetProperty('msg', vDataOut, 0); msg := vDataOut;
      if msg = WM_LBUTTONUP then
      begin
        Result := '';
        try
          Script := 'var OutStr = 0; var AnnotsOnPage = this.getAnnots(0);'
                   +'if (AnnotsOnPage != null) OutStr = AnnotsOnPage.length; OutStr;';
          CoPDFXCview1.RunJavaScript(Script,Result,0,0);
        except ShowMessage('This JavaScript Failed' +#13#10+ Script); end;
        Memo1.Lines.add(Result);
      end;
If I have the rectangle tool selected, the first time the code above executes, result = 0, but there is actually one rectangle annotation visible on the page. If I draw a second rectangle, result = 1.
Please advise.

Thank you
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: MouseUp-Event fires too early

Post by Ivan - Tracker Software »

When the mouse event WM_LBUTTONUP occured, the annotation had not yet been added to the page.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.