FIX:fixed ams materials setting can not get event on mac

Change-Id: I80b9a8fc5e86df4b4e83e8ffecaa373caf856286
This commit is contained in:
tao wang 2022-08-03 11:28:16 +08:00 committed by Lane.Wei
parent e8787a4c12
commit 60e9c608a3
3 changed files with 107 additions and 144 deletions

View file

@ -15,11 +15,12 @@
#include "Widgets/TextInput.hpp"
#define AMS_MATERIALS_SETTING_DEF_COLOUR wxColour(255, 255, 255)
#define AMS_MATERIALS_SETTING_GREY900 wxColour(38, 46, 48)
#define AMS_MATERIALS_SETTING_GREY800 wxColour(50, 58, 61)
#define AMS_MATERIALS_SETTING_GREY700 wxColour(107, 107, 107)
#define AMS_MATERIALS_SETTING_GREY300 wxColour(174,174,174)
#define AMS_MATERIALS_SETTING_GREY200 wxColour(248, 248, 248)
#define AMS_MATERIALS_SETTING_BODY_WIDTH FromDIP(350)
#define AMS_MATERIALS_SETTING_BODY_WIDTH FromDIP(380)
#define AMS_MATERIALS_SETTING_LABEL_WIDTH FromDIP(80)
#define AMS_MATERIALS_SETTING_COMBOX_WIDTH wxSize(FromDIP(250), FromDIP(30))
#define AMS_MATERIALS_SETTING_BUTTON_SIZE wxSize(FromDIP(90), FromDIP(24))
@ -27,7 +28,7 @@
namespace Slic3r { namespace GUI {
class AMSMaterialsSetting : public wxPopupTransientWindow
class AMSMaterialsSetting : public DPIDialog
{
public:
AMSMaterialsSetting(wxWindow *parent, wxWindowID id);
@ -39,17 +40,13 @@ public:
void input_max_finish();
void update();
void enable_confirm_button(bool en);
void Dismiss() override;
bool Show(bool show) override;
void Popup(bool show, wxString filament = wxEmptyString, wxString sn = wxEmptyString, wxString temp_min = wxEmptyString, wxString temp_max = wxEmptyString);
void Popup(wxString filament = wxEmptyString, wxString sn = wxEmptyString, wxString temp_min = wxEmptyString, wxString temp_max = wxEmptyString);
void post_select_event();
void on_select_ok(wxMouseEvent &event);
void set_color(wxColour color);
void on_clr_picker(wxCommandEvent &event);
MachineObject *obj{nullptr};
int ams_id { 0 }; /* 0 ~ 3 */
int tray_id { 0 }; /* 0 ~ 3 */
@ -64,35 +61,35 @@ public:
std::string m_filament_type;
protected:
//void on_dpi_changed(const wxRect &suggested_rect) override;
void on_dpi_changed(const wxRect &suggested_rect) override;
void on_select_filament(wxCommandEvent& evt);
bool ProcessLeftDown(wxMouseEvent &evt);
void on_select_ok(wxCommandEvent &event);
void on_select_close(wxCommandEvent &event);
void on_clr_picker(wxCommandEvent &event);
protected:
StateColor m_btn_bg_green;
StateColor m_btn_bg_gray;
wxPanel * m_panel_SN;
wxStaticText * m_sn_number;
wxStaticText * warning_text;
wxPanel * m_panel_body;
//wxPanel * m_panel_body;
wxStaticText * m_title_filament;
ComboBox * m_comboBox_filament;
wxStaticText * m_title_colour;
#ifdef __APPLE__
wxButton * m_clr_picker;
#else
Button * m_clr_picker;
#endif
wxStaticText * m_title_temperature;
wxStaticText * m_label_other;
TextInput * m_input_nozzle_min;
TextInput* m_input_nozzle_max;
Button * m_button_confirm;
#ifdef __APPLE__
wxComboBox *m_comboBox_filament_mac;
#endif
Button * m_button_close;
Button * m_clr_picker;
wxColourData * m_clrData;
#ifdef __APPLE__
wxComboBox *m_comboBox_filament_mac;
#else
ComboBox *m_comboBox_filament;
#endif
};
}} // namespace Slic3r::GUI