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!
MouseUp-Event fires too early
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: MouseUp-Event fires too early
We will add new feature in the next build:
new named notification(example, VB6):
In your case you may catch "Notifications.Mouse" with "Notifications.Mouse.msg"=WM_LBUTTONUP in current realization.
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
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.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: MouseUp-Event fires too early
PERFECT! 

-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: MouseUp-Event fires too early

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
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 7
- Joined: Thu Jul 16, 2009 12:31 am
Re: MouseUp-Event fires too early
I am experiencing what I think is a similar problem.
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
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;
Please advise.
Thank you
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: MouseUp-Event fires too early
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.
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.