Handling mouse selection events Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
beneficii
Earned some good credits
Earned some good credits
Posts: 111
Joined: Fri Nov 27, 2009 2:49 am

Handling mouse selection events

Post by beneficii » Thu Mar 01, 2018 10:39 pm

I'm using wxWidgets 3.0.3 with Visual Studio 2017 Community on Windows 8.1, and I've got a question.

I'm working on a tile map editor, and I want to add a selection tool to the interface. This is where the user can press the left mouse key down on a tile, and while holding the mouse key down moves the mouse to another tile before letting go. This is like in Microsoft Paint, where you can use the selection tool to create a selection rectangle that you can use cut or copy on.

Does anyone have any idea how I should handle the mouse events to accomplish this? Is there any example source code I can look at for this?

User avatar
doublemax
Moderator
Moderator
Posts: 13903
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Handling mouse selection events

Post by doublemax » Thu Mar 01, 2018 11:23 pm

The "drawing" sample shows this, look for "rubberband" in the code.
Use the source, Luke!

Post Reply