Add ctl and fix applying opencsg params on the fly.

This commit is contained in:
tamasmeszaros 2019-12-16 18:49:44 +01:00
parent d14ff000e0
commit bb3b39016f
4 changed files with 205 additions and 154 deletions

View file

@ -40,58 +40,6 @@ public:
}
m_context.reset(ctx);
Bind(
wxEVT_MOUSEWHEEL,
[this](wxMouseEvent &evt) {
on_scroll(evt.GetWheelRotation(), evt.GetWheelDelta(),
evt.GetWheelAxis() == wxMOUSE_WHEEL_VERTICAL ?
Slic3r::GL::MouseInput::waVertical :
Slic3r::GL::MouseInput::waHorizontal);
},
GetId());
Bind(
wxEVT_MOTION,
[this](wxMouseEvent &evt) {
on_moved_to(evt.GetPosition().x, evt.GetPosition().y);
},
GetId());
Bind(
wxEVT_RIGHT_DOWN,
[this](wxMouseEvent & /*evt*/) { on_right_click_down(); },
GetId());
Bind(
wxEVT_RIGHT_UP,
[this](wxMouseEvent & /*evt*/) { on_right_click_up(); },
GetId());
Bind(
wxEVT_LEFT_DOWN,
[this](wxMouseEvent & /*evt*/) { on_left_click_down(); },
GetId());
Bind(
wxEVT_LEFT_UP,
[this](wxMouseEvent & /*evt*/) { on_left_click_up(); },
GetId());
Bind(wxEVT_PAINT, [this](wxPaintEvent &) {
// This is required even though dc is not used otherwise.
wxPaintDC dc(this);
// Set the OpenGL viewport according to the client size of this
// canvas. This is done here rather than in a wxSizeEvent handler
// because our OpenGL rendering context (and thus viewport setting) is
// used with multiple canvases: If we updated the viewport in the
// wxSizeEvent handler, changing the size of one canvas causes a
// viewport setting that is wrong when next another canvas is
// repainted.
const wxSize ClientSize = GetClientSize();
repaint(ClientSize.x, ClientSize.y);
}, GetId());
}
};