Easy way to get wxTextCtrl click event?

Is there an easy way to handle it when the user clicks on wxTextCtrl? After reading the docs wxTextCtrl, I see that there is no click event or double click event. I understand that there are no events in wxWidgets such as the β€œclick” from the wxWidgets question : Detecting a click event on user controls , so this will result in a simple mouse event.

Answer example:

From: wx wiki

textCtrl->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MyClass::OnClick), NULL, this ); 
+4
source share
1 answer

Have you tried to handle the wxEVT_LEFT_DOWN and wxEVT_LEFT_UP events for your text control? Either by adding them to the static message map, or by calling Connect () for the handler methods.

Edit:

Not all events are listed in the class documentation. You also need to go up in the hierarchy, from wxTextCtrl to wxControl to wxWindow. Unfortunately, I cannot find documentation for mouse events in any class. Their processing should be allowed, even if it is not documented.

+3
source

All Articles