Adding to the OnMouseMove Event  SOLVED

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
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Adding to the OnMouseMove Event

Post by Lambchop »

Attached is the sample project you guys put together many months ago (continues to be a life saver for me - Thank You!). This project uses a new instance of the IPXV_Tool. I want to interact with the new regions like I would any other object when in Hand mode. For example, if I draw a textbox and then choose Hand, I can still Mouse Over the textbox region and the mouse cursor changes and the object becomes clickable. If I move over my new region of my custom tool, then it ignores it even though my OnMouseMove is still active for the tool. I have tried several solution approaches and I have successfully crashed my application but no success in integrating the functionality.
What I want to do: create a custom region (as shown in the sample project), perform another PDF function (e.g. draw text box), select Hand, be able to mouse over either object and make either object "clickable". For example, if you could show a message box upon my custom box click while in Hand mode then i can take it from there.
I am sure I am missing something simple and over complicating my approach. Thank you for the help!
-Eric
FullDemo.CustomTool.zip
(130.63 KiB) Downloaded 88 times
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Adding to the OnMouseMove Event  SOLVED

Post by Vasyl-Tracker Dev Team »

Hi Eric.

I'm not quite sure that is a good idea to intercept and handle the mouse messages when the pointer is over your custom region but while your custom tool isn't active. Because it may break the behavior of the currently active tool, potentially.

Allow me to offer a slightly different solution: when your tool is deactivating (OnDeactivated) - you may just hide all custom regions but keep them in the tool's data. Then the user may spend some time with other tools to zoom/comment/etc and when he activates your tool again (OnActivated) - you may just show your existing regions back to continue working with them...

Anyway, in your sample project, I also tried another idea: even when the custom tool is inactive and custom regions are visible - now it is possible to click any of them to activate the custom tool automatically, to continue making edits of that regions. Please look into UIEventDemoMon::OnEventMonitor to see how it works. I have also changed the PagesMarkupTool::OnActivated/OnDeactivated to keep the custom regions when the tool is deactivated and to hide/show their control-points...

FullDemo.CustomTool.zip
(131.79 KiB) Downloaded 94 times

HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Lambchop
User
Posts: 34
Joined: Mon May 02, 2022 5:58 pm

Re: Adding to the OnMouseMove Event

Post by Lambchop »

I am implementing your idea to toggle the tool based on selection. An obvious, yet elegant solution! I had already implemented the storing and redisplay, but trapping on the object selection is clearly the best approach. Thank you tremendously! -Eric
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Adding to the OnMouseMove Event

Post by Tracker Supp-Stefan »

:)
Post Reply