mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-16 04:11:13 +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.
70 lines
2.2 KiB
C++
70 lines
2.2 KiB
C++
#ifndef slic3r_GUI_ProgressBar_hpp_
|
|
#define slic3r_GUI_ProgressBar_hpp_
|
|
|
|
#include <wx/event.h>
|
|
#include <wx/gdicmn.h>
|
|
#include <wx/colour.h>
|
|
#include <wx/string.h>
|
|
#include <wx/window.h>
|
|
#include "../wxExtensions.hpp"
|
|
|
|
class ProgressBar : public wxWindow
|
|
{
|
|
public:
|
|
ProgressBar();
|
|
ProgressBar(wxWindow * parent,
|
|
wxWindowID id = wxID_ANY,
|
|
int max = 100,
|
|
const wxPoint & pos = wxDefaultPosition,
|
|
const wxSize & size = wxDefaultSize,
|
|
bool shown = false);
|
|
|
|
|
|
void create(wxWindow *parent, wxWindowID id, const wxPoint &pos, wxSize &size);
|
|
|
|
~ProgressBar();
|
|
|
|
public:
|
|
bool m_shownumber = {false};
|
|
int m_disable = {false};
|
|
int m_max = {100};
|
|
int m_step = {0};
|
|
int m_miniHeight = {0};
|
|
const int miniHeight = {14};
|
|
double m_radius = {7};
|
|
double m_proportion = {0};
|
|
wxColour m_progress_background_colour = {233, 233, 233};
|
|
wxColour m_progress_colour = {0, 150, 136};
|
|
wxColour m_progress_colour_disable = {255, 111, 0};
|
|
wxString m_disable_text;
|
|
|
|
|
|
public:
|
|
void ShowNumber(bool shown);
|
|
void Disable(wxString text);
|
|
void SetValue(int step);
|
|
void Reset();
|
|
void SetProgress(int step);
|
|
void SetRadius(double radius);
|
|
void SetProgressForedColour(wxColour colour);
|
|
void SetProgressBackgroundColour(wxColour colour);
|
|
void Rescale();
|
|
void SetHeight(int height) {
|
|
m_minHeight = height;
|
|
m_radius = m_minHeight / 2;
|
|
SetSize(GetSize().x, height);
|
|
}
|
|
virtual void SetMinSize(const wxSize &size) override;
|
|
|
|
protected:
|
|
void paintEvent(wxPaintEvent &evt);
|
|
void render(wxDC &dc);
|
|
void doRender(wxDC &dc);
|
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) override;
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
};
|
|
|
|
#endif // !slic3r_GUI_ProgressBar_hpp_
|