mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
79
src/slic3r/GUI/ParamsDialog.cpp
Normal file
79
src/slic3r/GUI/ParamsDialog.cpp
Normal file
|
@ -0,0 +1,79 @@
|
|||
#include "ParamsDialog.hpp"
|
||||
#include "I18N.hpp"
|
||||
#include "ParamsPanel.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
#include "Tab.hpp"
|
||||
|
||||
#include "libslic3r/Utils.hpp"
|
||||
|
||||
namespace pt = boost::property_tree;
|
||||
typedef pt::ptree JSON;
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
|
||||
ParamsDialog::ParamsDialog(wxWindow * parent)
|
||||
: DPIDialog(parent, wxID_ANY, _L(""), wxDefaultPosition,
|
||||
wxDefaultSize, wxCAPTION | wxCLOSE_BOX | wxRESIZE_BORDER)
|
||||
{
|
||||
m_panel = new ParamsPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL);
|
||||
|
||||
auto* topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
topsizer->Add(m_panel, 1, wxALL | wxEXPAND, 5, NULL);
|
||||
topsizer->Add(-1, 5);
|
||||
|
||||
SetSizerAndFit(topsizer);
|
||||
SetSize({100 * em_unit(), 60 * em_unit()});
|
||||
|
||||
Layout();
|
||||
Center();
|
||||
Bind(wxEVT_SHOW, [this](auto &event) {
|
||||
if (IsShown()) {
|
||||
m_winDisabler = new wxWindowDisabler(this);
|
||||
} else {
|
||||
delete m_winDisabler;
|
||||
m_winDisabler = nullptr;
|
||||
}
|
||||
});
|
||||
Bind(wxEVT_CLOSE_WINDOW, [this](auto& event) {
|
||||
#if 0
|
||||
auto tab = dynamic_cast<Tab *>(m_panel->get_current_tab());
|
||||
if (event.CanVeto() && tab->m_presets->current_is_dirty()) {
|
||||
bool ok = tab->may_discard_current_dirty_preset();
|
||||
if (!ok)
|
||||
event.Veto();
|
||||
else {
|
||||
tab->m_presets->discard_current_changes();
|
||||
tab->load_current_preset();
|
||||
Hide();
|
||||
}
|
||||
} else {
|
||||
Hide();
|
||||
}
|
||||
#else
|
||||
Hide();
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
void ParamsDialog::Popup()
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
Reparent(wxGetApp().mainframe);
|
||||
#endif
|
||||
Center();
|
||||
Show();
|
||||
}
|
||||
|
||||
void ParamsDialog::on_dpi_changed(const wxRect &suggested_rect)
|
||||
{
|
||||
Fit();
|
||||
SetSize({100 * em_unit(), 60 * em_unit()});
|
||||
m_panel->msw_rescale();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
Loading…
Add table
Add a link
Reference in a new issue