#ifndef slic3r_GUI_DialogButtons_hpp_ #define slic3r_GUI_DialogButtons_hpp_ #include "wx/wx.h" #include "wx/sizer.h" #include "map" #include "set" #include "Button.hpp" #include "Label.hpp" #include "slic3r/GUI/GUI_App.hpp" namespace Slic3r { namespace GUI { class DialogButtons : public wxPanel{ public: DialogButtons(wxWindow* parent, std::vector non_translated_labels, const wxString& primary_btn_label = ""); wxBoxSizer* GetSizer() const { return m_sizer; } Button* GetButtonFromID(wxStandardID id); Button* GetButtonFromLabel(wxString label); Button* GetOK(); Button* GetYES(); Button* GetAPPLY(); Button* GetCONFIRM(); Button* GetNO(); Button* GetCANCEL(); Button* GetRETURN(); Button* GetNEXT(); void SetPrimaryButton(wxString label); void SetAlertButton(wxString label); void UpdateButtons(); ~DialogButtons(); private: wxWindow* m_parent; wxBoxSizer* m_sizer; std::vector m_buttons; wxString m_primary; wxString m_alert; // missing ones Transfer / Update / Create const std::map m_standardIDs = { // Choice {"ok" , wxID_OK}, {"yes" , wxID_YES}, {"apply" , wxID_APPLY}, {"confirm" , wxID_APPLY}, // no id for confirm, reusing wxID_APPLY {"no" , wxID_NO}, {"cancel" , wxID_CANCEL}, // Action {"open" , wxID_PRINT}, {"open" , wxID_OPEN}, {"add" , wxID_ADD}, {"copy" , wxID_COPY}, {"new" , wxID_NEW}, {"save" , wxID_SAVE}, {"save as" , wxID_SAVEAS}, {"refresh" , wxID_REFRESH}, {"retry" , wxID_RETRY}, {"ignore" , wxID_IGNORE}, {"help" , wxID_HELP}, {"clone" , wxID_DUPLICATE}, {"duplicate" , wxID_DUPLICATE}, {"select all" , wxID_SELECTALL}, {"replace" , wxID_REPLACE}, {"replace all", wxID_REPLACE_ALL}, // Navigation {"return" , wxID_BACKWARD}, // use return instead back. back mostly used as side of object in translations {"next" , wxID_FORWARD}, // Alert / Negative {"remove" , wxID_REMOVE}, {"delete" , wxID_DELETE}, {"abort" , wxID_ABORT}, {"stop" , wxID_STOP}, {"reset" , wxID_RESET}, {"clear" , wxID_CLEAR}, {"exit" , wxID_EXIT}, {"quit" , wxID_EXIT} }; std::set m_primaryIDs { wxID_OK, wxID_YES, wxID_APPLY, wxID_SAVE, wxID_PRINT }; std::set m_alertIDs { wxID_REMOVE, wxID_DELETE, wxID_ABORT, wxID_STOP, wxID_RESET, wxID_CLEAR, wxID_EXIT }; std::set m_left_align_IDs { wxID_DELETE, wxID_BACKWARD, wxID_FORWARD }; Button* PickFromList(std::set ID_list); int FromDIP(int d); void on_dpi_changed(wxDPIChangedEvent& event); void on_keydown(wxKeyEvent& event); }; }} // namespace Slic3r::GUI #endif // !slic3r_GUI_DialogButtons_hpp_