Files
OrcaSlicer/src/slic3r/GUI/Widgets/ProgressBar.hpp
T
Kris Austin 56f9edc572 build: mark missing overrides and drop unused lambda captures (1,156 clang warnings) (#15334)
* chore: mark every declaration that overrides a base virtual

clang-cl reports 42 member functions across 28 files that override a
base virtual without being marked `override`, inside classes that
already mark their other overrides. That is every occurrence of
-Winconsistent-missing-override in the tree, so the category drops to
zero and -Werror=inconsistent-missing-override becomes available as a
guard against it coming back.

Behaviour is unchanged. Each keyword goes only where clang had already
resolved the declaration to a base virtual, so it records what the
compiler already worked out and cannot affect overload resolution or
dispatch. If any of these signatures had not really overridden a base
method, the build would have failed rather than warned.

Where a declaration already carried `virtual` it is left alone and the
keyword appended, matching the surrounding declarations. Plain
`override` is used rather than the wxWidgets `wxOVERRIDE` macro, which
wx/defs.h defines as `override` beneath a comment marking it obsolete,
and which the rest of src/slic3r already avoids by 1742 occurrences to
113.

A full clang-cl build takes -Winconsistent-missing-override from 1,146
warning lines to 0. Those 42 declarations produce that many lines
because a header is re-diagnosed in every translation unit that
includes it. CalibrationWizardStartPage.hpp alone accounts for 336 of
them from 4 declarations.

* chore: drop unused lambda captures in GUI/Widgets

clang-cl reports 10 lambda captures in src/slic3r/GUI/Widgets that are
never read. Removing them changes nothing at runtime.

Every capture removed is `this` or a raw pointer. clang does not report
a capture whose type has a non-trivial destructor, since such a capture
can be held purely for its effect on an object's lifetime, so nothing
that owns or extends a lifetime is touched. The std::weak_ptr captured
beside the removed `this` in MultiNozzleSync.cpp stays.

This clears the category in GUI/Widgets only. A full clang-cl build
takes -Wunused-lambda-capture from 312 warning lines to 302, leaving
235 sites in other directories for a follow-up.
2026-08-25 08:18:48 -03:00

66 lines
2.1 KiB
C++

#ifndef slic3r_GUI_ProgressBar_hpp_
#define slic3r_GUI_ProgressBar_hpp_
#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_