mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
BedShapeDialog and Bed_2D (as a part of it) are completed.
Added new_scale function to Polyline. Fixed small bug in PointCtrl. Extended change_opt_value for coPoints case.
This commit is contained in:
parent
f90ea5060d
commit
7d29a7b45a
8 changed files with 239 additions and 172 deletions
|
@ -9,25 +9,30 @@ class Bed_2D : public wxPanel
|
|||
bool m_user_drawn_background = false;
|
||||
|
||||
bool m_painted = false;
|
||||
bool m_interactive = false;
|
||||
double m_scale_factor;
|
||||
Pointf m_shift;
|
||||
Point m_pos;
|
||||
Pointf m_pos;
|
||||
std::function<void(Pointf)> m_on_move = nullptr;
|
||||
|
||||
Point to_pixels(Pointf point);
|
||||
Pointf to_units(Point point);
|
||||
void repaint();
|
||||
void mouse_event(wxMouseEvent event);
|
||||
void set_pos(Pointf pos);
|
||||
|
||||
public:
|
||||
Bed_2D(wxWindow* parent)
|
||||
{
|
||||
Create(parent, wxID_ANY, wxDefaultPosition, wxSize(250, -1), wxTAB_TRAVERSAL);
|
||||
// m_user_drawn_background = $^O ne 'darwin';
|
||||
m_user_drawn_background = true;
|
||||
Bind(wxEVT_PAINT, ([this](wxPaintEvent e)
|
||||
{
|
||||
repaint();
|
||||
}));
|
||||
Bind(wxEVT_PAINT, ([this](wxPaintEvent e) { repaint(); }));
|
||||
// EVT_ERASE_BACKGROUND($self, sub{}) if $self->{user_drawn_background};
|
||||
// Bind(wxEVT_MOUSE_EVENTS, ([this](wxCommandEvent){/*mouse_event()*/; }));
|
||||
Bind(wxEVT_SIZE, ([this](wxSizeEvent){Refresh(); }));
|
||||
// Bind(EVT_MOUSE_EVENTS, ([this](wxMouseEvent event){/*mouse_event()*/; }));
|
||||
Bind(wxEVT_LEFT_DOWN, ([this](wxMouseEvent event){ mouse_event(event); }));
|
||||
Bind(wxEVT_MOTION, ([this](wxMouseEvent event){ mouse_event(event); }));
|
||||
Bind(wxEVT_SIZE, ([this](wxSizeEvent e) { Refresh(); }));
|
||||
}
|
||||
~Bed_2D(){}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue