mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
DoubleSlider manipulation from preview scene
This commit is contained in:
parent
a9ee4ff4b5
commit
4712c5bbdf
5 changed files with 24 additions and 0 deletions
|
@ -1210,6 +1210,7 @@ wxDEFINE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
||||||
|
wxDEFINE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
|
|
||||||
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar)
|
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar)
|
||||||
: m_canvas(canvas)
|
: m_canvas(canvas)
|
||||||
|
@ -2469,6 +2470,20 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
|
||||||
}
|
}
|
||||||
else if (keyCode == WXK_CONTROL)
|
else if (keyCode == WXK_CONTROL)
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
|
// DoubleSlider navigation in Preview
|
||||||
|
else if (keyCode == WXK_LEFT ||
|
||||||
|
keyCode == WXK_RIGHT ||
|
||||||
|
keyCode == WXK_UP ||
|
||||||
|
keyCode == WXK_DOWN ||
|
||||||
|
keyCode == '+' ||
|
||||||
|
keyCode == WXK_NUMPAD_ADD ||
|
||||||
|
keyCode == '-' ||
|
||||||
|
keyCode == 390 ||
|
||||||
|
keyCode == WXK_DELETE ||
|
||||||
|
keyCode == WXK_BACK )
|
||||||
|
{
|
||||||
|
post_event(wxKeyEvent(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, evt));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ wxDECLARE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
||||||
|
wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
|
|
||||||
class GLCanvas3D
|
class GLCanvas3D
|
||||||
{
|
{
|
||||||
|
|
|
@ -414,6 +414,12 @@ void Preview::msw_rescale()
|
||||||
refresh_print();
|
refresh_print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preview::move_double_slider(wxKeyEvent& evt)
|
||||||
|
{
|
||||||
|
if (m_slider)
|
||||||
|
m_slider->OnKeyDown(evt);
|
||||||
|
}
|
||||||
|
|
||||||
void Preview::bind_event_handlers()
|
void Preview::bind_event_handlers()
|
||||||
{
|
{
|
||||||
this->Bind(wxEVT_SIZE, &Preview::on_size, this);
|
this->Bind(wxEVT_SIZE, &Preview::on_size, this);
|
||||||
|
|
|
@ -122,6 +122,7 @@ public:
|
||||||
void refresh_print();
|
void refresh_print();
|
||||||
|
|
||||||
void msw_rescale();
|
void msw_rescale();
|
||||||
|
void move_double_slider(wxKeyEvent& evt);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar, Model* model);
|
bool init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar, Model* model);
|
||||||
|
|
|
@ -1517,6 +1517,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_QUESTION_MARK, [this](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_QUESTION_MARK, [this](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&) { set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&) { set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values); });
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
|
||||||
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, [this](wxKeyEvent& evt) { preview->move_double_slider(evt); });
|
||||||
|
|
||||||
q->Bind(EVT_SLICING_COMPLETED, &priv::on_slicing_completed, this);
|
q->Bind(EVT_SLICING_COMPLETED, &priv::on_slicing_completed, this);
|
||||||
q->Bind(EVT_PROCESS_COMPLETED, &priv::on_process_completed, this);
|
q->Bind(EVT_PROCESS_COMPLETED, &priv::on_process_completed, this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue