hello,
I am poping my own right click menu after setting SetProperty('Notifications.Mouse.Skip', 'True', 0)
and it works great.
However when annotation is active or selected the mouse cursor switches to specific annotation cursor
and when I right click, the cursor does not reset to Arrow.
I tried to use CoPDFXCview.Cursor = crArrow, but it didn't work.
Is there a way to change mouse cursor?
Thanks,
-Tatiana
Setting Mouse Cursor
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: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Setting Mouse Cursor
Hi Tatiana,
When you detect a right mouse button click call the GetSelectedAnnot() method. It will return -1 as it's first output parameter if no annotation is selected, and you can then proceed with ignoring the right button click and show your own context menu, and if an annotation is selected - you can use DeselectAll - ID 33248, and then show your context menu - this should keep your cursor to the default.
Cheers,
Stefan
When you detect a right mouse button click call the GetSelectedAnnot() method. It will return -1 as it's first output parameter if no annotation is selected, and you can then proceed with ignoring the right button click and show your own context menu, and if an annotation is selected - you can use DeselectAll - ID 33248, and then show your context menu - this should keep your cursor to the default.
Cheers,
Stefan
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Setting Mouse Cursor
Is it possible to keep annotation selected and change cursor to default on right click?
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Setting Mouse Cursor
Hi Tatiana,
I can think of "selecting the annotation back after closing the context menu" kind of solution, but will check with our devs to see if there's a more elegant one.
Regards,
Stefan
I can think of "selecting the annotation back after closing the context menu" kind of solution, but will check with our devs to see if there's a more elegant one.
Regards,
Stefan
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Setting Mouse Cursor
Hi, TatianaS.
LoadCursor/SetCursor - are from system's API functions. IDC_ARROW == 32512.
HTH
Please try to use in your code:I tried to use CoPDFXCview.Cursor = crArrow, but it didn't work.
Is there a way to change mouse cursor?
Code: Select all
OnMouseRClick()
{
HCURSOR hCurArrow = LoadCursor(NULL, IDC_ARROW);
SetCursor(hCurArrow);
ShowPopupMenu();
}
HTH
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.