Files
OrcaSlicer/src/slic3r/GUI/PrimitiveSizeDialog.hpp
yw4zandNoisyfox ff93256eff LabeledCheckBox class (#15761)
* init

* extend feature set

* update

* fix tidy

* fix tidy

* Update calib_dlg.cpp

* simplify class

* update

* align labels with RadioGroup

* replace ImportCheckBox

* Update LabeledCheckBox.cpp

* apply to more dialog

* add to ai skills

* update

* fix Tooltip only reaches the children on the first call

* fix Label can stay grey after a theme switch

* Update release dialog

* change focus target for all platforms

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-11-16 11:24:56 +08:00

51 lines
1.4 KiB
C++

#pragma once
#include "GUI_Utils.hpp"
#include <cstddef>
#include <vector>
#include <wx/gdicmn.h>
#include <wx/string.h>
class LabeledCheckBox;
class TextInput;
class wxSizer;
class wxWindow;
namespace Slic3r { namespace GUI {
// Asks for the dimensions of a primitive shape, in mm, before it is generated.
class PrimitiveSizeDialog : public DPIDialog
{
public:
struct Field
{
wxString label;
double value;
};
PrimitiveSizeDialog(wxWindow* parent, const wxString& title, const std::vector<Field>& fields);
const std::vector<double>& get_values() const { return m_values; }
bool save_as_default() const;
bool dont_show_again() const;
protected:
void on_dpi_changed(const wxRect& suggested_rect) override;
private:
LabeledCheckBox* add_checkbox(wxSizer* sizer, const wxString& label, const wxString& tooltip);
void on_input_changed(size_t idx);
bool read_values();
std::vector<::TextInput*> m_inputs;
// The last valid value of each input, which uniform scaling multiplies.
std::vector<double> m_last_values;
LabeledCheckBox* m_uniform_scale{nullptr};
LabeledCheckBox* m_save_default{nullptr};
LabeledCheckBox* m_dont_show{nullptr};
std::vector<double> m_values;
};
}} // namespace Slic3r::GUI