mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-21 04:23:15 +08:00
ENH: calibration pages adapt to the screen dpi
Jira: STUDIO-3420 Change-Id: Ib816476aec68398714d7ea74c0fc13e6616cc698
This commit is contained in:
parent
276025a27f
commit
64146d8386
@ -101,27 +101,27 @@ void CalibrationCaliPage::set_cali_img()
|
|||||||
{
|
{
|
||||||
if (m_cali_mode == CalibMode::Calib_PA_Line) {
|
if (m_cali_mode == CalibMode::Calib_PA_Line) {
|
||||||
if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual", 400));
|
||||||
}
|
}
|
||||||
else if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
|
else if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_auto", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_auto", 400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_cali_mode == CalibMode::Calib_Flow_Rate) {
|
else if (m_cali_mode == CalibMode::Calib_Flow_Rate) {
|
||||||
if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||||
if (m_page_type == CaliPageType::CALI_PAGE_CALI)
|
if (m_page_type == CaliPageType::CALI_PAGE_CALI)
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_coarse", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse", 400));
|
||||||
if (m_page_type == CaliPageType::CALI_PAGE_FINE_CALI)
|
if (m_page_type == CaliPageType::CALI_PAGE_FINE_CALI)
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_fine", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_fine", 400));
|
||||||
else
|
else
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_coarse", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse", 400));
|
||||||
}
|
}
|
||||||
else if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
|
else if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_auto", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_auto", 400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_cali_mode == CalibMode::Calib_Vol_speed_Tower) {
|
else if (m_cali_mode == CalibMode::Calib_Vol_speed_Tower) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("max_volumetric_speed_calibration", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "max_volumetric_speed_calibration", 400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,9 +129,9 @@ void CalibrationCaliPage::set_pa_cali_image(int stage)
|
|||||||
{
|
{
|
||||||
if (m_cali_mode == CalibMode::Calib_PA_Line && m_cali_method == CALI_METHOD_MANUAL) {
|
if (m_cali_mode == CalibMode::Calib_PA_Line && m_cali_method == CALI_METHOD_MANUAL) {
|
||||||
if (stage == 0) {
|
if (stage == 0) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual", 400));
|
||||||
} else if (stage == 1) {
|
} else if (stage == 1) {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual", nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual", 400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,6 +481,12 @@ bool CalibrationCaliPage::Show(bool show /*= true*/)
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationCaliPage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
float CalibrationCaliPage::get_selected_calibration_nozzle_dia(MachineObject* obj)
|
float CalibrationCaliPage::get_selected_calibration_nozzle_dia(MachineObject* obj)
|
||||||
{
|
{
|
||||||
// return selected if this is set
|
// return selected if this is set
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
|
|
||||||
void set_cali_method(CalibrationMethod method) override;
|
void set_cali_method(CalibrationMethod method) override;
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float get_selected_calibration_nozzle_dia(MachineObject* obj);
|
float get_selected_calibration_nozzle_dia(MachineObject* obj);
|
||||||
|
@ -249,6 +249,13 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri
|
|||||||
SetCornerRadius(FromDIP(12));
|
SetCornerRadius(FromDIP(12));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliPageButton::msw_rescale()
|
||||||
|
{
|
||||||
|
SetMinSize(wxSize(-1, FromDIP(24)));
|
||||||
|
SetCornerRadius(FromDIP(12));
|
||||||
|
Rescale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FilamentComboBox::FilamentComboBox(wxWindow* parent, const wxPoint& pos, const wxSize& size)
|
FilamentComboBox::FilamentComboBox(wxWindow* parent, const wxPoint& pos, const wxSize& size)
|
||||||
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL)
|
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL)
|
||||||
@ -343,6 +350,14 @@ void FilamentComboBox::SetValue(bool value, bool send_event) {
|
|||||||
m_checkBox->SetValue(value);
|
m_checkBox->SetValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FilamentComboBox::msw_rescale()
|
||||||
|
{
|
||||||
|
//m_checkBox->Rescale();
|
||||||
|
m_comboBox->SetSize(CALIBRATION_FILAMENT_COMBOX_SIZE);
|
||||||
|
m_comboBox->SetMinSize(CALIBRATION_FILAMENT_COMBOX_SIZE);
|
||||||
|
m_comboBox->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
|
CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
|
||||||
@ -460,6 +475,11 @@ void CaliPageCaption::on_sys_color_changed()
|
|||||||
m_prev_btn->msw_rescale();
|
m_prev_btn->msw_rescale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliPageCaption::msw_rescale()
|
||||||
|
{
|
||||||
|
m_prev_btn->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CaliPageStepGuide::CaliPageStepGuide(wxWindow* parent, wxArrayString steps,
|
CaliPageStepGuide::CaliPageStepGuide(wxWindow* parent, wxArrayString steps,
|
||||||
wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: wxPanel(parent, id, pos, size, style),
|
: wxPanel(parent, id, pos, size, style),
|
||||||
@ -541,9 +561,16 @@ CaliPagePicture::CaliPagePicture(wxWindow* parent, wxWindowID id, const wxPoint&
|
|||||||
top_sizer->Fit(this);
|
top_sizer->Fit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaliPagePicture::set_img(const wxBitmap& bmp)
|
void CaliPagePicture::set_bmp(const ScalableBitmap& bmp)
|
||||||
{
|
{
|
||||||
m_img->SetBitmap(bmp);
|
m_bmp = bmp;
|
||||||
|
m_img->SetBitmap(m_bmp.bmp());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CaliPagePicture::msw_rescale()
|
||||||
|
{
|
||||||
|
m_bmp.msw_rescale();
|
||||||
|
m_img->SetBitmap(m_bmp.bmp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -582,6 +609,13 @@ PAPageHelpPanel::PAPageHelpPanel(wxWindow* parent, bool ground_panel, wxWindowID
|
|||||||
top_sizer->Fit(this);
|
top_sizer->Fit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PAPageHelpPanel::msw_rescale()
|
||||||
|
{
|
||||||
|
m_help_btn->msw_rescale();
|
||||||
|
m_bmp.msw_rescale();
|
||||||
|
m_img->SetBitmap(m_bmp.bmp());
|
||||||
|
}
|
||||||
|
|
||||||
void PAPageHelpPanel::create_pop_window()
|
void PAPageHelpPanel::create_pop_window()
|
||||||
{
|
{
|
||||||
m_pop_win = new PopupWindow(this);
|
m_pop_win = new PopupWindow(this);
|
||||||
@ -589,13 +623,10 @@ void PAPageHelpPanel::create_pop_window()
|
|||||||
wxBoxSizer* pop_sizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* pop_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
m_pop_win->SetSizer(pop_sizer);
|
m_pop_win->SetSizer(pop_sizer);
|
||||||
|
|
||||||
wxStaticBitmap* img = new wxStaticBitmap(m_pop_win, wxID_ANY, wxNullBitmap);
|
m_img = new wxStaticBitmap(m_pop_win, wxID_ANY, wxNullBitmap);
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
m_bmp = ScalableBitmap(this, "cali_fdc_editing_diagram", 206);
|
||||||
img->SetBitmap(ScalableBitmap(this, "cali_fdc_editing_diagram_CN", 206).bmp());
|
m_img->SetBitmap(m_bmp.bmp());
|
||||||
} else {
|
pop_sizer->Add(m_img, 1, wxEXPAND | wxALL, FromDIP(20));
|
||||||
img->SetBitmap(ScalableBitmap(this, "cali_fdc_editing_diagram", 206).bmp());
|
|
||||||
}
|
|
||||||
pop_sizer->Add(img, 1, wxEXPAND | wxALL, FromDIP(20));
|
|
||||||
|
|
||||||
m_pop_win->Layout();
|
m_pop_win->Layout();
|
||||||
m_pop_win->Fit();
|
m_pop_win->Fit();
|
||||||
@ -754,6 +785,13 @@ void CaliPageActionPanel::enable_button(CaliPageActionType action_type, bool ena
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliPageActionPanel::msw_rescale()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_action_btns.size(); i++) {
|
||||||
|
m_action_btns[i]->msw_rescale();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CaliPageSendingPanel::CaliPageSendingPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CaliPageSendingPanel::CaliPageSendingPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: wxPanel(parent, id, pos, size, style)
|
: wxPanel(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -914,6 +952,8 @@ CalibrationWizardPage::CalibrationWizardPage(wxWindow* parent, wxWindowID id, co
|
|||||||
|
|
||||||
void CalibrationWizardPage::msw_rescale()
|
void CalibrationWizardPage::msw_rescale()
|
||||||
{
|
{
|
||||||
|
m_page_caption->msw_rescale();
|
||||||
|
m_action_panel->msw_rescale();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibrationWizardPage::on_sys_color_changed()
|
void CalibrationWizardPage::on_sys_color_changed()
|
||||||
|
@ -96,6 +96,7 @@ public:
|
|||||||
virtual bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
virtual bool Enable(bool enable);
|
virtual bool Enable(bool enable);
|
||||||
virtual void SetValue(bool value, bool send_event = true);
|
virtual void SetValue(bool value, bool send_event = true);
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_tray_id { -1 };
|
int m_tray_id { -1 };
|
||||||
@ -123,6 +124,7 @@ public:
|
|||||||
void show_prev_btn(bool show = true);
|
void show_prev_btn(bool show = true);
|
||||||
void show_help_icon(bool show = true);
|
void show_help_icon(bool show = true);
|
||||||
void on_sys_color_changed();
|
void on_sys_color_changed();
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ScalableButton* m_prev_btn;
|
ScalableButton* m_prev_btn;
|
||||||
@ -167,9 +169,12 @@ public:
|
|||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTAB_TRAVERSAL);
|
long style = wxTAB_TRAVERSAL);
|
||||||
|
|
||||||
void set_img(const wxBitmap& bmp);
|
void set_bmp(const ScalableBitmap& bmp);
|
||||||
void paint_on_img();
|
void paint_on_img();
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
ScalableBitmap m_bmp;
|
||||||
wxStaticBitmap* m_img;
|
wxStaticBitmap* m_img;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -182,12 +187,14 @@ public:
|
|||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTAB_TRAVERSAL);
|
long style = wxTAB_TRAVERSAL);
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void create_pop_window();
|
void create_pop_window();
|
||||||
|
|
||||||
ScalableButton* m_help_btn;
|
ScalableButton* m_help_btn;
|
||||||
PopupWindow* m_pop_win;
|
PopupWindow* m_pop_win;
|
||||||
|
ScalableBitmap m_bmp;
|
||||||
wxStaticBitmap* m_img;
|
wxStaticBitmap* m_img;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -218,6 +225,9 @@ public:
|
|||||||
CaliPageButton(wxWindow* parent, CaliPageActionType type, wxString text = wxEmptyString);
|
CaliPageButton(wxWindow* parent, CaliPageActionType type, wxString text = wxEmptyString);
|
||||||
|
|
||||||
CaliPageActionType get_action_type() { return m_action_type; }
|
CaliPageActionType get_action_type() { return m_action_type; }
|
||||||
|
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CaliPageActionType m_action_type;
|
CaliPageActionType m_action_type;
|
||||||
};
|
};
|
||||||
@ -261,6 +271,7 @@ public:
|
|||||||
void bind_button(CaliPageActionType action_type, bool is_block);
|
void bind_button(CaliPageActionType action_type, bool is_block);
|
||||||
void show_button(CaliPageActionType action_type, bool show = true);
|
void show_button(CaliPageActionType action_type, bool show = true);
|
||||||
void enable_button(CaliPageActionType action_type, bool enable = true);
|
void enable_button(CaliPageActionType action_type, bool enable = true);
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<CaliPageButton*> m_action_btns;
|
std::vector<CaliPageButton*> m_action_btns;
|
||||||
@ -302,7 +313,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void msw_rescale();
|
virtual void msw_rescale();
|
||||||
void on_sys_color_changed();
|
void on_sys_color_changed();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -445,6 +445,16 @@ CalibrationPresetPage::CalibrationPresetPage(
|
|||||||
m_top_sizer->Fit(this);
|
m_top_sizer->Fit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationPresetPage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_ams_sync_button->msw_rescale();
|
||||||
|
m_virtual_tray_comboBox->msw_rescale();
|
||||||
|
for (auto& comboBox : m_filament_comboBox_list) {
|
||||||
|
comboBox->msw_rescale();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
|
void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
|
||||||
{
|
{
|
||||||
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
|
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
@ -206,6 +206,9 @@ public:
|
|||||||
CalibMode get_pa_cali_method();
|
CalibMode get_pa_cali_method();
|
||||||
|
|
||||||
CaliPresetPageStatus get_page_status() { return m_page_status; }
|
CaliPresetPageStatus get_page_status() { return m_page_status; }
|
||||||
|
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void create_selection_panel(wxWindow* parent);
|
void create_selection_panel(wxWindow* parent);
|
||||||
void create_filament_list_panel(wxWindow* parent);
|
void create_filament_list_panel(wxWindow* parent);
|
||||||
|
@ -519,9 +519,9 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
|
|||||||
|
|
||||||
void CaliPASaveManualPanel::set_save_img() {
|
void CaliPASaveManualPanel::set_save_img() {
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual_result_CN", nullptr, 330));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result_CN", 330));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual_result", nullptr, 330));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result", 330));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,9 +533,9 @@ void CaliPASaveManualPanel::set_pa_cali_method(ManualPaCaliMethod method)
|
|||||||
} else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
} else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
||||||
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result_CN", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result_CN", 350));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result", 350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -606,6 +606,11 @@ bool CaliPASaveManualPanel::Show(bool show) {
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliPASaveManualPanel::msw_rescale()
|
||||||
|
{
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CaliPASaveP1PPanel::CaliPASaveP1PPanel(
|
CaliPASaveP1PPanel::CaliPASaveP1PPanel(
|
||||||
wxWindow* parent,
|
wxWindow* parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
@ -675,9 +680,9 @@ void CaliPASaveP1PPanel::create_panel(wxWindow* parent)
|
|||||||
|
|
||||||
void CaliPASaveP1PPanel::set_save_img() {
|
void CaliPASaveP1PPanel::set_save_img() {
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual_result_CN", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result_CN", 350));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual_result", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result", 350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,9 +695,9 @@ void CaliPASaveP1PPanel::set_pa_cali_method(ManualPaCaliMethod method)
|
|||||||
else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
||||||
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result_CN", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result_CN", 350));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result", 350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -715,6 +720,11 @@ bool CaliPASaveP1PPanel::Show(bool show) {
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliPASaveP1PPanel::msw_rescale()
|
||||||
|
{
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CaliSavePresetValuePanel::CaliSavePresetValuePanel(
|
CaliSavePresetValuePanel::CaliSavePresetValuePanel(
|
||||||
wxWindow *parent,
|
wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
@ -763,7 +773,7 @@ void CaliSavePresetValuePanel::create_panel(wxWindow *parent)
|
|||||||
|
|
||||||
void CaliSavePresetValuePanel::set_img(const std::string& bmp_name_in)
|
void CaliSavePresetValuePanel::set_img(const std::string& bmp_name_in)
|
||||||
{
|
{
|
||||||
m_picture_panel->set_img(create_scaled_bitmap(bmp_name_in, nullptr, 400));
|
m_picture_panel->set_bmp(ScalableBitmap(this, bmp_name_in, 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaliSavePresetValuePanel::set_value_title(const wxString& title) {
|
void CaliSavePresetValuePanel::set_value_title(const wxString& title) {
|
||||||
@ -789,6 +799,11 @@ void CaliSavePresetValuePanel::set_save_name(const std::string& name)
|
|||||||
m_input_name->GetTextCtrl()->SetValue(name);
|
m_input_name->GetTextCtrl()->SetValue(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaliSavePresetValuePanel::msw_rescale()
|
||||||
|
{
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationPASavePage::CalibrationPASavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationPASavePage::CalibrationPASavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -913,6 +928,14 @@ bool CalibrationPASavePage::Show(bool show) {
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationPASavePage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_manual_panel->msw_rescale();
|
||||||
|
m_p1p_panel->msw_rescale();
|
||||||
|
m_help_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationFlowX1SavePage::CalibrationFlowX1SavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationFlowX1SavePage::CalibrationFlowX1SavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -1152,6 +1175,11 @@ bool CalibrationFlowX1SavePage::Show(bool show) {
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationFlowX1SavePage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationFlowCoarseSavePage::CalibrationFlowCoarseSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationFlowCoarseSavePage::CalibrationFlowCoarseSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -1286,9 +1314,9 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||||||
|
|
||||||
void CalibrationFlowCoarseSavePage::set_save_img() {
|
void CalibrationFlowCoarseSavePage::set_save_img() {
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_coarse_result_CN", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse_result_CN", 350));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_coarse_result", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse_result", 350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1384,6 +1412,12 @@ void CalibrationFlowCoarseSavePage::on_cali_cancel_job()
|
|||||||
Fit();
|
Fit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationFlowCoarseSavePage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationFlowFineSavePage::CalibrationFlowFineSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationFlowFineSavePage::CalibrationFlowFineSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
: CalibrationCommonSavePage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -1466,9 +1500,9 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
|
|||||||
|
|
||||||
void CalibrationFlowFineSavePage::set_save_img() {
|
void CalibrationFlowFineSavePage::set_save_img() {
|
||||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_fine_result_CN", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_fine_result_CN", 350));
|
||||||
} else {
|
} else {
|
||||||
m_picture_panel->set_img(create_scaled_bitmap("flow_rate_calibration_fine_result", nullptr, 350));
|
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_fine_result", 350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1516,6 +1550,12 @@ bool CalibrationFlowFineSavePage::Show(bool show) {
|
|||||||
return wxPanel::Show(show);
|
return wxPanel::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationFlowFineSavePage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_picture_panel->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationMaxVolumetricSpeedSavePage::CalibrationMaxVolumetricSpeedSavePage(
|
CalibrationMaxVolumetricSpeedSavePage::CalibrationMaxVolumetricSpeedSavePage(
|
||||||
wxWindow *parent,
|
wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
void get_value(double& value);
|
void get_value(double& value);
|
||||||
void get_save_name(std::string& name);
|
void get_save_name(std::string& name);
|
||||||
void set_save_name(const std::string& name);
|
void set_save_name(const std::string& name);
|
||||||
|
void msw_rescale();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -129,6 +130,8 @@ public:
|
|||||||
|
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxBoxSizer* m_top_sizer;
|
wxBoxSizer* m_top_sizer;
|
||||||
Label * m_complete_text;
|
Label * m_complete_text;
|
||||||
@ -157,6 +160,8 @@ public:
|
|||||||
|
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
|
||||||
|
void msw_rescale();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxBoxSizer* m_top_sizer;
|
wxBoxSizer* m_top_sizer;
|
||||||
Label * m_complete_text;
|
Label * m_complete_text;
|
||||||
@ -187,12 +192,14 @@ public:
|
|||||||
|
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CaliPageStepGuide* m_step_panel { nullptr };
|
CaliPageStepGuide* m_step_panel { nullptr };
|
||||||
CaliPASaveAutoPanel* m_auto_panel { nullptr };
|
CaliPASaveAutoPanel* m_auto_panel { nullptr };
|
||||||
CaliPASaveManualPanel* m_manual_panel { nullptr };
|
CaliPASaveManualPanel* m_manual_panel { nullptr };
|
||||||
CaliPASaveP1PPanel* m_p1p_panel{ nullptr };
|
CaliPASaveP1PPanel* m_p1p_panel{ nullptr };
|
||||||
PAPageHelpPanel* m_help_panel;
|
PAPageHelpPanel* m_help_panel{ nullptr };
|
||||||
|
|
||||||
CaliSaveStyle m_save_style;
|
CaliSaveStyle m_save_style;
|
||||||
};
|
};
|
||||||
@ -212,6 +219,8 @@ public:
|
|||||||
|
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CaliPageStepGuide* m_step_panel{ nullptr };
|
CaliPageStepGuide* m_step_panel{ nullptr };
|
||||||
wxPanel* m_complete_text_panel;
|
wxPanel* m_complete_text_panel;
|
||||||
@ -251,6 +260,8 @@ public:
|
|||||||
return m_sending_panel->get_sending_progress_bar();
|
return m_sending_panel->get_sending_progress_bar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CaliPageStepGuide* m_step_panel{ nullptr };
|
CaliPageStepGuide* m_step_panel{ nullptr };
|
||||||
CaliPagePicture* m_picture_panel;
|
CaliPagePicture* m_picture_panel;
|
||||||
@ -283,6 +294,8 @@ public:
|
|||||||
|
|
||||||
virtual bool Show(bool show = true) override;
|
virtual bool Show(bool show = true) override;
|
||||||
|
|
||||||
|
void msw_rescale() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CaliPageStepGuide* m_step_panel{ nullptr };
|
CaliPageStepGuide* m_step_panel{ nullptr };
|
||||||
CaliPagePicture* m_picture_panel;
|
CaliPagePicture* m_picture_panel;
|
||||||
|
@ -35,30 +35,37 @@ void CalibrationStartPage::create_about(wxWindow* parent, wxString title, wxStri
|
|||||||
|
|
||||||
void CalibrationStartPage::create_bitmap(wxWindow* parent, const wxBitmap& before_img, const wxBitmap& after_img)
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, const wxBitmap& before_img, const wxBitmap& after_img)
|
||||||
{
|
{
|
||||||
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
if (!m_before_bmp)
|
||||||
m_before_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
m_before_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
||||||
m_before_bmp->SetBitmap(before_img);
|
m_before_bmp->SetBitmap(before_img);
|
||||||
m_images_sizer->Add(m_before_bmp, 0, wxALL, 0);
|
if (!m_after_bmp)
|
||||||
m_images_sizer->AddSpacer(FromDIP(20));
|
m_after_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
||||||
m_after_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
|
||||||
m_after_bmp->SetBitmap(after_img);
|
m_after_bmp->SetBitmap(after_img);
|
||||||
m_images_sizer->Add(m_after_bmp, 0, wxALL, 0);
|
if (!m_images_sizer) {
|
||||||
|
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
m_images_sizer->Add(m_before_bmp, 0, wxALL, 0);
|
||||||
|
m_images_sizer->AddSpacer(FromDIP(20));
|
||||||
|
m_images_sizer->Add(m_after_bmp, 0, wxALL, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string before_img, std::string after_img)
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string before_img, std::string after_img)
|
||||||
{
|
{
|
||||||
wxBitmap before_bmp = create_scaled_bitmap(before_img, nullptr, 350);
|
wxBitmap before_bmp = create_scaled_bitmap(before_img, this, 350);
|
||||||
wxBitmap after_bmp = create_scaled_bitmap(after_img, nullptr, 350);
|
wxBitmap after_bmp = create_scaled_bitmap(after_img, this, 350);
|
||||||
|
|
||||||
create_bitmap(parent, before_bmp, after_bmp);
|
create_bitmap(parent, before_bmp, after_bmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string img) {
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string img) {
|
||||||
wxBitmap before_bmp = create_scaled_bitmap(img, nullptr, 350);
|
wxBitmap before_bmp = create_scaled_bitmap(img, this, 350);
|
||||||
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
if (!m_bmp_intro)
|
||||||
m_bmp_intro = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
m_bmp_intro = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
||||||
m_bmp_intro->SetBitmap(before_bmp);
|
m_bmp_intro->SetBitmap(before_bmp);
|
||||||
m_images_sizer->Add(m_bmp_intro, 0, wxALL, 0);
|
if (!m_images_sizer) {
|
||||||
|
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
m_images_sizer->Add(m_bmp_intro, 0, wxALL, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CalibrationPAStartPage::CalibrationPAStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationPAStartPage::CalibrationPAStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
@ -97,7 +104,7 @@ void CalibrationPAStartPage::create_page(wxWindow* parent)
|
|||||||
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
|
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
|
||||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||||
|
|
||||||
PAPageHelpPanel* m_help_panel = new PAPageHelpPanel(parent, false);
|
m_help_panel = new PAPageHelpPanel(parent, false);
|
||||||
m_top_sizer->Add(m_help_panel, 0, wxALL, 0);
|
m_top_sizer->Add(m_help_panel, 0, wxALL, 0);
|
||||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||||
|
|
||||||
@ -169,6 +176,17 @@ void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationPAStartPage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
m_help_panel->msw_rescale();
|
||||||
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
|
create_bitmap(this, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
||||||
|
} else {
|
||||||
|
create_bitmap(this, "cali_page_before_pa", "cali_page_after_pa");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationFlowRateStartPage::CalibrationFlowRateStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationFlowRateStartPage::CalibrationFlowRateStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationStartPage(parent, id, pos, size, style)
|
: CalibrationStartPage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -291,6 +309,16 @@ void CalibrationFlowRateStartPage::on_device_connected(MachineObject* obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationFlowRateStartPage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
|
create_bitmap(this, "cali_page_flow_introduction_CN");
|
||||||
|
} else {
|
||||||
|
create_bitmap(this, "cali_page_flow_introduction");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CalibrationMaxVolumetricSpeedStartPage::CalibrationMaxVolumetricSpeedStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
CalibrationMaxVolumetricSpeedStartPage::CalibrationMaxVolumetricSpeedStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||||
: CalibrationStartPage(parent, id, pos, size, style)
|
: CalibrationStartPage(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
@ -343,4 +371,14 @@ void CalibrationMaxVolumetricSpeedStartPage::create_page(wxWindow* parent)
|
|||||||
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
|
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationMaxVolumetricSpeedStartPage::msw_rescale()
|
||||||
|
{
|
||||||
|
CalibrationWizardPage::msw_rescale();
|
||||||
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||||
|
create_bitmap(this, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
||||||
|
} else {
|
||||||
|
create_bitmap(this, "cali_page_before_pa", "cali_page_after_pa");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
@ -19,15 +19,16 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
CalibMode m_cali_mode;
|
CalibMode m_cali_mode;
|
||||||
|
|
||||||
wxBoxSizer* m_top_sizer;
|
wxBoxSizer* m_top_sizer{ nullptr };
|
||||||
wxBoxSizer* m_images_sizer;
|
wxBoxSizer* m_images_sizer{ nullptr };
|
||||||
Label* m_when_title;
|
Label* m_when_title{ nullptr };
|
||||||
Label* m_when_content;
|
Label* m_when_content{ nullptr };
|
||||||
Label* m_about_title;
|
Label* m_about_title{ nullptr };
|
||||||
Label* m_about_content;
|
Label* m_about_content{ nullptr };
|
||||||
wxStaticBitmap* m_before_bmp{ nullptr };
|
wxStaticBitmap* m_before_bmp{ nullptr };
|
||||||
wxStaticBitmap* m_after_bmp{ nullptr };
|
wxStaticBitmap* m_after_bmp{ nullptr };
|
||||||
wxStaticBitmap* m_bmp_intro{ nullptr };
|
wxStaticBitmap* m_bmp_intro{ nullptr };
|
||||||
|
PAPageHelpPanel* m_help_panel{ nullptr };
|
||||||
|
|
||||||
void create_when(wxWindow* parent, wxString title, wxString content);
|
void create_when(wxWindow* parent, wxString title, wxString content);
|
||||||
void create_about(wxWindow* parent, wxString title, wxString content);
|
void create_about(wxWindow* parent, wxString title, wxString content);
|
||||||
@ -49,6 +50,7 @@ public:
|
|||||||
|
|
||||||
void on_reset_page();
|
void on_reset_page();
|
||||||
void on_device_connected(MachineObject* obj);
|
void on_device_connected(MachineObject* obj);
|
||||||
|
void msw_rescale() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalibrationFlowRateStartPage : public CalibrationStartPage
|
class CalibrationFlowRateStartPage : public CalibrationStartPage
|
||||||
@ -63,6 +65,7 @@ public:
|
|||||||
void create_page(wxWindow* parent);
|
void create_page(wxWindow* parent);
|
||||||
void on_reset_page();
|
void on_reset_page();
|
||||||
void on_device_connected(MachineObject* obj);
|
void on_device_connected(MachineObject* obj);
|
||||||
|
void msw_rescale() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalibrationMaxVolumetricSpeedStartPage : public CalibrationStartPage
|
class CalibrationMaxVolumetricSpeedStartPage : public CalibrationStartPage
|
||||||
@ -75,6 +78,7 @@ public:
|
|||||||
long style = wxTAB_TRAVERSAL);
|
long style = wxTAB_TRAVERSAL);
|
||||||
|
|
||||||
void create_page(wxWindow* parent);
|
void create_page(wxWindow* parent);
|
||||||
|
void msw_rescale() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace Slic3r::GUI
|
}} // namespace Slic3r::GUI
|
||||||
|
@ -1393,7 +1393,7 @@ GUI::CalibrateFilamentComboBox::CalibrateFilamentComboBox(wxWindow *parent)
|
|||||||
: PlaterPresetComboBox(parent, Preset::TYPE_FILAMENT)
|
: PlaterPresetComboBox(parent, Preset::TYPE_FILAMENT)
|
||||||
{
|
{
|
||||||
clr_picker->SetBackgroundColour(*wxWHITE);
|
clr_picker->SetBackgroundColour(*wxWHITE);
|
||||||
clr_picker->SetBitmap(*get_extruder_color_icon("#FFFFFFFF", "", 20, 20));
|
clr_picker->SetBitmap(*get_extruder_color_icon("#FFFFFFFF", "", FromDIP(20), FromDIP(20)));
|
||||||
clr_picker->SetToolTip("");
|
clr_picker->SetToolTip("");
|
||||||
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {});
|
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {});
|
||||||
}
|
}
|
||||||
@ -1411,7 +1411,7 @@ void GUI::CalibrateFilamentComboBox::load_tray(DynamicPrintConfig &config)
|
|||||||
m_filament_color = config.opt_string("filament_colour", 0u);
|
m_filament_color = config.opt_string("filament_colour", 0u);
|
||||||
m_filament_exist = config.opt_bool("filament_exist", 0u);
|
m_filament_exist = config.opt_bool("filament_exist", 0u);
|
||||||
wxColor clr(m_filament_color);
|
wxColor clr(m_filament_color);
|
||||||
clr_picker->SetBitmap(*get_extruder_color_icon(m_filament_color, m_tray_name, 20, 20));
|
clr_picker->SetBitmap(*get_extruder_color_icon(m_filament_color, m_tray_name, FromDIP(20), FromDIP(20)));
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
clr_picker->SetLabel(clr_picker->GetLabel()); // Let setBezelStyle: be called
|
clr_picker->SetLabel(clr_picker->GetLabel()); // Let setBezelStyle: be called
|
||||||
clr_picker->Refresh();
|
clr_picker->Refresh();
|
||||||
@ -1420,7 +1420,7 @@ void GUI::CalibrateFilamentComboBox::load_tray(DynamicPrintConfig &config)
|
|||||||
SetValue(_L("Empty"));
|
SetValue(_L("Empty"));
|
||||||
m_selected_preset = nullptr;
|
m_selected_preset = nullptr;
|
||||||
m_is_compatible = false;
|
m_is_compatible = false;
|
||||||
clr_picker->SetBitmap(*get_extruder_color_icon("#F0F0F0FF", m_tray_name, 20, 20));
|
clr_picker->SetBitmap(*get_extruder_color_icon("#F0F0F0FF", m_tray_name, FromDIP(20), FromDIP(20)));
|
||||||
} else {
|
} else {
|
||||||
auto &filaments = m_collection->get_presets();
|
auto &filaments = m_collection->get_presets();
|
||||||
auto iter = std::find_if(filaments.begin(), filaments.end(), [this](auto &f) {
|
auto iter = std::find_if(filaments.begin(), filaments.end(), [this](auto &f) {
|
||||||
@ -1521,6 +1521,17 @@ void GUI::CalibrateFilamentComboBox::update()
|
|||||||
SetToolTip(NULL);
|
SetToolTip(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::CalibrateFilamentComboBox::msw_rescale()
|
||||||
|
{
|
||||||
|
if (clr_picker) {
|
||||||
|
clr_picker->SetSize(FromDIP(20), FromDIP(20));
|
||||||
|
clr_picker->SetBitmap(*get_extruder_color_icon(m_filament_color, m_tray_name, FromDIP(20), FromDIP(20)));
|
||||||
|
}
|
||||||
|
// BBS
|
||||||
|
if (edit_btn != nullptr)
|
||||||
|
edit_btn->msw_rescale();
|
||||||
|
}
|
||||||
|
|
||||||
void GUI::CalibrateFilamentComboBox::OnSelect(wxCommandEvent &evt)
|
void GUI::CalibrateFilamentComboBox::OnSelect(wxCommandEvent &evt)
|
||||||
{
|
{
|
||||||
auto marker = reinterpret_cast<Marker>(this->GetClientData(evt.GetSelection()));
|
auto marker = reinterpret_cast<Marker>(this->GetClientData(evt.GetSelection()));
|
||||||
|
@ -228,6 +228,7 @@ public:
|
|||||||
void load_tray(DynamicPrintConfig & config);
|
void load_tray(DynamicPrintConfig & config);
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
|
void msw_rescale() override;
|
||||||
void OnSelect(wxCommandEvent &evt) override;
|
void OnSelect(wxCommandEvent &evt) override;
|
||||||
const Preset* get_selected_preset() { return m_selected_preset; }
|
const Preset* get_selected_preset() { return m_selected_preset; }
|
||||||
std::string get_tray_name() { return m_tray_name; }
|
std::string get_tray_name() { return m_tray_name; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user