mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 16:38:43 +03:00
Calibratioon
This commit is contained in:
35
src/slic3r/GUI/Widgets/RoundedRectangle.cpp
Normal file
35
src/slic3r/GUI/Widgets/RoundedRectangle.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "RoundedRectangle.hpp"
|
||||
#include "../wxExtensions.hpp"
|
||||
#include <wx/dcgraph.h>
|
||||
|
||||
BEGIN_EVENT_TABLE(RoundedRectangle, wxPanel)
|
||||
EVT_PAINT(RoundedRectangle::OnPaint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
RoundedRectangle::RoundedRectangle(wxWindow *parent, wxColour col, wxPoint pos, wxSize size, double radius, int type)
|
||||
: wxWindow(parent, wxID_ANY, pos, size, wxBORDER_NONE)
|
||||
{
|
||||
SetBackgroundColour(wxColour(255,255,255));
|
||||
m_type = type;
|
||||
m_color = col;
|
||||
m_radius = radius;
|
||||
}
|
||||
|
||||
void RoundedRectangle::OnPaint(wxPaintEvent &evt)
|
||||
{
|
||||
//draw RoundedRectangle
|
||||
if (m_type == 0) {
|
||||
wxPaintDC dc(this);
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(wxBrush(m_color));
|
||||
dc.DrawRoundedRectangle(0, 0, GetSize().GetWidth(), GetSize().GetHeight(), m_radius);
|
||||
}
|
||||
|
||||
//draw RoundedRectangle only board
|
||||
if (m_type == 1) {
|
||||
wxPaintDC dc(this);
|
||||
dc.SetPen(m_color);
|
||||
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
|
||||
dc.DrawRoundedRectangle(0, 0, GetSize().GetWidth(), GetSize().GetHeight(), m_radius);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user