mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
WIP: Plater, build fixes
This commit is contained in:
parent
99fe5761d8
commit
1f926964ee
15 changed files with 511 additions and 143 deletions
54
src/slic3r/GUI/GUI_Utils.cpp
Normal file
54
src/slic3r/GUI/GUI_Utils.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
#include "GUI_Utils.hpp"
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/checkbox.h>
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
|
||||
CheckboxFileDialog::CheckboxFileDialog(wxWindow *parent,
|
||||
const wxString &checkbox_label,
|
||||
bool checkbox_value,
|
||||
const wxString &message,
|
||||
const wxString &default_dir,
|
||||
const wxString &default_file,
|
||||
const wxString &wildcard,
|
||||
long style,
|
||||
const wxPoint &pos,
|
||||
const wxSize &size,
|
||||
const wxString &name
|
||||
)
|
||||
: wxFileDialog(parent, message, default_dir, default_file, wildcard, style, pos, size, name)
|
||||
, cbox(nullptr)
|
||||
{
|
||||
if (checkbox_label.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
extra_control_creator = [this, checkbox_label](wxWindow *parent) -> wxWindow* {
|
||||
wxPanel* panel = new wxPanel(parent, -1);
|
||||
wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
this->cbox = new wxCheckBox(panel, wxID_HIGHEST + 1, checkbox_label);
|
||||
this->cbox->SetValue(true);
|
||||
sizer->AddSpacer(5);
|
||||
sizer->Add(this->cbox, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, 5);
|
||||
panel->SetSizer(sizer);
|
||||
sizer->SetSizeHints(panel);
|
||||
|
||||
return panel;
|
||||
};
|
||||
|
||||
SetExtraControlCreator(*extra_control_creator.target<ExtraControlCreatorFunction>());
|
||||
}
|
||||
|
||||
bool CheckboxFileDialog::get_checkbox_value() const
|
||||
{
|
||||
return this->cbox != nullptr ? cbox->IsChecked() : false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue