mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Yet another tweak to the logic for releasing mouse capture into GLToolbar::on_mouse()
This commit is contained in:
parent
03aeb0d386
commit
dd3ac4017a
2 changed files with 54 additions and 7 deletions
|
@ -413,14 +413,60 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
|
||||||
|
|
||||||
// mouse anywhere
|
// mouse anywhere
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
if (evt.Moving() || evt.LeftDown() || evt.MiddleDown() || evt.RightDown() || evt.LeftDClick() || evt.RightDClick())
|
if (!evt.Dragging() && !evt.Leaving() && !evt.Entering() && (m_mouse_capture.parent != nullptr))
|
||||||
{
|
{
|
||||||
if ((m_mouse_capture.parent != nullptr) && (m_mouse_capture.parent != &parent))
|
if (m_mouse_capture.any() && (evt.LeftUp() || evt.MiddleUp() || evt.RightUp()))
|
||||||
{
|
// prevents loosing selection into the scene if mouse down was done inside the toolbar and mouse up was down outside it,
|
||||||
m_mouse_capture.reset();
|
// as when switching between views
|
||||||
std::cout << "Dragging restored by toolbar" << std::endl;
|
processed = true;
|
||||||
}
|
|
||||||
|
m_mouse_capture.reset();
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "Dragging restored by toolbar [";
|
||||||
|
if (evt.Entering())
|
||||||
|
std::cout << "Entering";
|
||||||
|
else if (evt.Leaving())
|
||||||
|
std::cout << "Leaving";
|
||||||
|
else if (evt.Dragging())
|
||||||
|
std::cout << "Dragging";
|
||||||
|
else if (evt.Moving())
|
||||||
|
std::cout << "Moving";
|
||||||
|
else if (evt.Magnify())
|
||||||
|
std::cout << "Magnify";
|
||||||
|
else if (evt.LeftDown())
|
||||||
|
std::cout << "LeftDown";
|
||||||
|
else if (evt.LeftUp())
|
||||||
|
std::cout << "LeftUp";
|
||||||
|
else if (evt.LeftDClick())
|
||||||
|
std::cout << "LeftDClick";
|
||||||
|
else if (evt.MiddleDown())
|
||||||
|
std::cout << "MiddleDown";
|
||||||
|
else if (evt.MiddleUp())
|
||||||
|
std::cout << "MiddleUp";
|
||||||
|
else if (evt.MiddleDClick())
|
||||||
|
std::cout << "MiddleDClick";
|
||||||
|
else if (evt.RightDown())
|
||||||
|
std::cout << "RightDown";
|
||||||
|
else if (evt.RightUp())
|
||||||
|
std::cout << "RightUp";
|
||||||
|
else if (evt.RightDClick())
|
||||||
|
std::cout << "RightDClick";
|
||||||
|
else
|
||||||
|
std::cout << "UNKNOWN ";
|
||||||
|
std::cout << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// if (evt.Moving() || evt.LeftDown() || evt.MiddleDown() || evt.RightDown() || evt.LeftDClick() || evt.RightDClick())
|
||||||
|
// {
|
||||||
|
// std::cout << m_name << " - " << (void*)m_mouse_capture.parent << std::endl;
|
||||||
|
// if ((m_mouse_capture.parent != nullptr) && (m_mouse_capture.parent != &parent))
|
||||||
|
// {
|
||||||
|
// m_mouse_capture.reset();
|
||||||
|
// std::cout << "Dragging restored by toolbar" << std::endl;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
if (evt.Moving())
|
if (evt.Moving())
|
||||||
|
@ -444,6 +490,7 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
|
||||||
{
|
{
|
||||||
std::cout << "Dragging prevented by toolbar" << std::endl;
|
std::cout << "Dragging prevented by toolbar" << std::endl;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
// if the button down was done on this toolbar, prevent from dragging into the scene
|
||||||
processed = true;
|
processed = true;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,7 @@ private:
|
||||||
GLCanvas3D* parent;
|
GLCanvas3D* parent;
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
MouseCapture() { reset(); }
|
MouseCapture() { reset(); }
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
bool any() const { return left || middle || right; }
|
bool any() const { return left || middle || right; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue