mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 11:51:33 +00:00
* Add Missing Includes Across src/slic3r/GUI Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained. * Drop the OS-Specific Includes Added Outside Their Platform Guards GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build. * Add the clang-tidy Configuration That Generated These Includes Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly. * Match Windows Paths in the clang-tidy Ignore List Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
80 lines
2.1 KiB
C++
80 lines
2.1 KiB
C++
#ifndef slic3r_GUI_LabeledStaticBox_hpp_
|
|
#define slic3r_GUI_LabeledStaticBox_hpp_
|
|
|
|
#include <wx/string.h>
|
|
#include <wx/gdicmn.h>
|
|
#include "slic3r/GUI/Widgets/StateColor.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);
|
|
|
|
bool SetFont(const wxFont &set_font) override;
|
|
|
|
bool Enable(bool enable) override;
|
|
|
|
// Only meant to be used by inspector, not public API
|
|
int GetCornerRadius() const { return m_radius; }
|
|
int GetBorderWidth() const { return m_border_width; }
|
|
StateColor GetBorderColor() const { return border_color; }
|
|
float GetScale() const { return m_scale; }
|
|
|
|
private:
|
|
void PickDC(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;
|
|
|
|
virtual void DrawBorderAndLabel(wxDC& dc);
|
|
void GetBordersForSizer(int *borderTop, int *borderOther) const override;
|
|
|
|
};
|
|
|
|
#endif // !slic3r_GUI_LabeledStaticBox_hpp_
|