Page 1 of 1

Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 4:42 pm
by Mungo1981
Dear Community,
As Everyday the same procedure.
I still standing on the tube, and I knew no way to do what I wont.

I have to bind the Left Click on my Mouse on a Panel, to call a Procedure.
So far I am:

Code: Select all

 TrackAmp->Bind( wxEVT_LEFT_UP, &TrackControl::OnGenTrack);
This Should:
1.) Bind the Command wxEVT_LEFT_UP,
2.) on the Panel "TrackAmp" to
3.) the Procedure TrackControl::OnGenTrack()

So in this Version it rains Error Messages, which I not understand.
And my Main-Question is:
1.) Must I Include some thing special to get Mouse_Events when other Events like Buttons are running.
2.) Has the call of the Procedure chatch any Parameters giving by this Bind
3.) What is the correct spelling on the Event: "wxEVT_LEFT_UP" or "wx.EVT_LEFT_UP". last spelling are listed in Python Code Examples

For any Help in Futuire
thanks of
Mungo1981

Re: Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 4:49 pm
by doublemax
So in this Version it rains Error Messages, which I not understand.
Please post the exact error message(s).

Code: Select all

TrackAmp->Bind( wxEVT_LEFT_UP, &TrackControl::OnGenTrack);
What is the type of "TrackAmp" and in which context is this called? Depending on the answers, the code might have to look like this (just a guess!):

Code: Select all

TrackAmp->Bind( wxEVT_LEFT_UP, &TrackControl::OnGenTrack, this);
1.) Must I Include some thing special to get Mouse_Events when other Events like Buttons are running.
No.
2.) Has the call of the Procedure chatch any Parameters giving by this Bind
Sorry, i don't understand the question.
3.) What is the correct spelling on the Event: "wxEVT_LEFT_UP" or "wx.EVT_LEFT_UP". last spelling are listed in Python Code Examples
For C++ it's wxEVT_LEFT_UP. If you use Python it's wx.EVT_LEFT_UP.

Re: Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 5:23 pm
by Mungo1981
Ok,
Thanks for the Ansers on Ponit 2.) and 3.)

To Point 1.):
This Bind is in a Constructor of a superordinate wxPanel.
The Typ of the Object before ->Bind is a wxPanel,
in Because of: It is the Panel which should letter process a Drawing Action. In moment it should display a Message that it has receive a Event of cliked with the Left Mouse Button this Panel.
I will give you a lissting on the Error in one Moment:

Re: Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 5:54 pm
by Mungo1981
Hello back again.

Here I'm thinking are the Important Files:
The Errors
download/file.php?mode=view&id=5701
The Cpp Files with the most changes:
download/file.php?mode=view&id=5700
The corresponding .h File:
download/file.php?mode=view&id=5699

Re: Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 6:49 pm
by doublemax
A mouse event handler must have this signature:

Code: Select all

void TrackControl::OnGenTrack(wxMouseEvent &evt)

Re: Little Confusion with Bind Command for Panel is clicked

Posted: Sat Nov 16, 2019 8:55 pm
by Mungo1981
Thank you Doublemax,
Now it runs all to my greatest success.

A very happy,
Mungo1981
in greatest thanks until the next stupid question :D =D> :D