mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-22 19:50:44 +00:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
34
src/slic3r/GUI/Widgets/RoundedRectangle.cpp
Normal file
34
src/slic3r/GUI/Widgets/RoundedRectangle.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#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.DrawRoundedRectangle(0, 0, GetSize().GetWidth(), GetSize().GetHeight(), m_radius);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user