mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-29 21:07:11 +00:00
Class for RadioGroup & LabeledStaticBox and improvements for Calibration Dialogs, Windows with wxStaticBoxSizer (#9797)
* update * Update calib_dlg.cpp * Update LabeledStaticBox.hpp * Update calib_dlg.cpp * update * update * RadioGroup fix * update * update * update * update * RadioGroup * Fix render issue when position is set to default (-1) * Fix macOS render issue by removing default NSBox border * Fix compile --------- Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
68
src/slic3r/GUI/Widgets/LabeledStaticBox.hpp
Normal file
68
src/slic3r/GUI/Widgets/LabeledStaticBox.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef slic3r_GUI_LabeledStaticBox_hpp_
|
||||
#define slic3r_GUI_LabeledStaticBox_hpp_
|
||||
|
||||
#include <wx/window.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/dcgraph.h>
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/dcbuffer.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/pen.h>
|
||||
|
||||
#include "libslic3r/Utils.hpp"
|
||||
|
||||
#include "slic3r/GUI/wxExtensions.hpp"
|
||||
#include "slic3r/GUI/Widgets/StateHandler.hpp"
|
||||
|
||||
class LabeledStaticBox : public wxStaticBox
|
||||
{
|
||||
public:
|
||||
LabeledStaticBox();
|
||||
|
||||
LabeledStaticBox(
|
||||
wxWindow* parent,
|
||||
const wxString& label = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0
|
||||
);
|
||||
|
||||
bool Create(
|
||||
wxWindow* parent,
|
||||
const wxString& label = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0
|
||||
);
|
||||
|
||||
void SetCornerRadius(int radius);
|
||||
|
||||
void SetBorderWidth(int width);
|
||||
|
||||
void SetBorderColor(StateColor const &color);
|
||||
|
||||
void SetFont(wxFont set_font);
|
||||
|
||||
bool Enable(bool enable) override;
|
||||
|
||||
private:
|
||||
void PickDC(wxDC& dc);
|
||||
virtual void DrawBorderAndLabel(wxDC& dc);
|
||||
|
||||
protected:
|
||||
StateHandler state_handler;
|
||||
StateColor text_color;
|
||||
StateColor border_color;
|
||||
StateColor background_color;
|
||||
int m_border_width;
|
||||
int m_radius;
|
||||
wxFont m_font;
|
||||
wxString m_label;
|
||||
int m_label_height;
|
||||
int m_label_width;
|
||||
float m_scale;
|
||||
wxPoint m_pos;
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_LabeledStaticBox_hpp_
|
||||
Reference in New Issue
Block a user