class for DialogButtons (#9639)

* init

* match code

* update

* Update DialogButtons.hpp

* make Ok uppercase

* update

* fix and cleanup

* Update DialogButtons.cpp

* update

* Update DialogButtons.cpp

* update

* Update CreatePresetsDialog.cpp

* update

* update

* update
This commit is contained in:
yw4z 2025-06-04 04:30:36 +03:00 committed by GitHub
parent 91ffc79c7b
commit dd549a6c52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 486 additions and 548 deletions

View file

@ -19,6 +19,8 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "Widgets/DialogButtons.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "MainFrame.hpp"
@ -94,20 +96,17 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
m_optgroup = new ConfigOptionsGroup(this, _L("Print Host upload"), m_config);
build_printhost_settings(m_optgroup);
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxOK | wxCANCEL);
btnOK = static_cast<wxButton*>(this->FindWindowById(wxID_OK, this));
wxGetApp().UpdateDarkUI(btnOK);
btnOK->Bind(wxEVT_BUTTON, &PhysicalPrinterDialog::OnOK, this);
auto dlg_btns = new DialogButtons(this, {"OK"});
wxGetApp().UpdateDarkUI(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)));
(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)))->Hide();
btnOK = dlg_btns->GetOK();
btnOK->Bind(wxEVT_BUTTON, &PhysicalPrinterDialog::OnOK, this);
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
// topSizer->Add(label_top , 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, BORDER_W);
topSizer->Add(input_sizer , 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(m_optgroup->sizer , 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, BORDER_W);
topSizer->Add(btns , 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(dlg_btns, 0, wxEXPAND);
Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->EndModal(wxID_NO);});
@ -736,8 +735,6 @@ void PhysicalPrinterDialog::on_dpi_changed(const wxRect& suggested_rect)
m_optgroup->msw_rescale();
msw_buttons_rescale(this, em, { wxID_OK, wxID_CANCEL });
const wxSize& size = wxSize(45 * em, 35 * em);
SetMinSize(size);