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.
YuMERA
Knows some wx things
Posts: 44 Joined: Fri Jul 05, 2019 8:47 pm
Post
by YuMERA » Sun Apr 19, 2020 11:53 pm
I have one event ItemSelect function
Code: Select all
OnlcRacunItemSelect(wxListEvent& event)
My question is : How I know what is mouse button is pressed (LEFT or RIGHT) before producing the event?
For example, please.
Thx.
me[R]a
ONEEYEMAN
Part Of The Furniture
Posts: 7479 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Mon Apr 20, 2020 12:44 am
Hi,
What is the exact scenario you are looking for?
Also - why do you need to generate the wxListEvent? They will be generated for your program and your program will need to react to it.
And finally - what exact event you are looking for?
Thank you.
catalin
Moderator
Posts: 1618 Joined: Wed Nov 12, 2008 7:23 am
Location: Romania
Post
by catalin » Mon Apr 20, 2020 9:00 am
YuMERA wrote: ↑ Sun Apr 19, 2020 11:53 pm How I know what is mouse button is pressed (LEFT or RIGHT)
You probably need wxGetMouseState(), then check for left/right button state.
YuMERA
Knows some wx things
Posts: 44 Joined: Fri Jul 05, 2019 8:47 pm
Post
by YuMERA » Mon Apr 20, 2020 10:26 am
catalin wrote: ↑ Mon Apr 20, 2020 9:00 am
You probably need wxGetMouseState(), then check for left/right button state.
Thanks. That is what I need.
Code: Select all
wxMouseState mouse_state;
mouse_state = wxGetMouseState();
if (mouse_state.LeftIsDown())
wxMessageBox("Left click")