mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-18 07:32:01 -06:00
FIX: handle mouseCaptureLost in common ctrls
Change-Id: Ifde2406911a628fa61acf41c0e7a5120612d73bf
This commit is contained in:
parent
e2d10baea0
commit
3d7d2badf7
6 changed files with 42 additions and 3 deletions
|
@ -7,6 +7,7 @@ BEGIN_EVENT_TABLE(Button, StaticBox)
|
|||
|
||||
EVT_LEFT_DOWN(Button::mouseDown)
|
||||
EVT_LEFT_UP(Button::mouseReleased)
|
||||
EVT_MOUSE_CAPTURE_LOST(Button::mouseCaptureLost)
|
||||
EVT_KEY_DOWN(Button::keyDownUp)
|
||||
EVT_KEY_UP(Button::keyDownUp)
|
||||
|
||||
|
@ -242,12 +243,19 @@ void Button::mouseReleased(wxMouseEvent& event)
|
|||
event.Skip();
|
||||
if (pressedDown) {
|
||||
pressedDown = false;
|
||||
ReleaseMouse();
|
||||
if (HasCapture())
|
||||
ReleaseMouse();
|
||||
if (wxRect({0, 0}, GetSize()).Contains(event.GetPosition()))
|
||||
sendButtonEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void Button::mouseCaptureLost(wxMouseCaptureLostEvent &event)
|
||||
{
|
||||
wxMouseEvent evt;
|
||||
mouseReleased(evt);
|
||||
}
|
||||
|
||||
void Button::keyDownUp(wxKeyEvent &event)
|
||||
{
|
||||
if (event.GetKeyCode() == WXK_SPACE || event.GetKeyCode() == WXK_RETURN) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue