wxMouseEvent ControlDown is a variable that represents whether the control key is being held down during a mouse event in a wxWidgets application. It is a Boolean variable that can be true or false, depending on whether the control key is pressed or not.
Here are some examples of how wxMouseEvent ControlDown can be used in C++ wxWidgets code:
Example 1: Checking if the control key is pressed during a mouse event
void MyFrame::OnMouse(wxMouseEvent& event) { bool ctrlDown = event.ControlDown(); // get control key state
if (ctrlDown) { // do something with the mouse event when control key is being held down } }
Example 2: Setting the cursor depending on the control key state
SetCursor(cursor); // set cursor to hand or arrow depending on control key state }
Example 3: Using control key state to implement drag-and-drop
void MyFrame::OnMouse(wxMouseEvent& event) { if (event.LeftDown()) { if (event.ControlDown()) { // perform drag-and-drop operation if control key is being held down wxTextDataObject* data = new wxTextDataObject("Hello World!"); wxDropSource dragSource(this); dragSource.SetData(*data); dragSource.DoDragDrop(); } else { // perform regular left-click operation if control key is not being held down // ... } } }
These examples demonstrate how wxMouseEvent ControlDown can be used in different ways to implement various mouse event actions in a wxWidgets application. The wxMouseEvent ControlDown variable is a part of the wxWidgets package library.
C++ (Cpp) wxMouseEvent::ControlDown - 22 examples found. These are the top rated real world C++ (Cpp) examples of wxMouseEvent::ControlDown extracted from open source projects. You can rate examples to help us improve the quality of examples.