Karol Borkowski
Karol Borkowski

Reputation: 742

Mouse hold in wxWidget

I have w graph made in wxWidget. I'd like to enable moving it by holding the left button. My idea is to catch all the mouse events, move the graph after the down click and escape the function after the up click. Do you have any better ideas?

Thank you in advance.

Upvotes: 0

Views: 574

Answers (1)

VZ.
VZ.

Reputation: 22688

You need to use CaptureMouse() to do this. Don't forget to call ReleaseMouse() later and, importantly, also handle mouse capture lost event (see the documentation link above), as your program can always lose capture unexpectedly, e.g. if the user switches to another application.

Upvotes: 1

Related Questions