mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 12:17:54 -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
122
src/slic3r/GUI/SavePresetDialog.hpp
Normal file
122
src/slic3r/GUI/SavePresetDialog.hpp
Normal file
|
@ -0,0 +1,122 @@
|
|||
#ifndef slic3r_SavePresetDialog_hpp_
|
||||
#define slic3r_SavePresetDialog_hpp_
|
||||
|
||||
//#include <wx/gdicmn.h>
|
||||
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "Widgets/RadioBox.hpp"
|
||||
#include "Widgets/Button.hpp"
|
||||
#include "Widgets/RoundedRectangle.hpp"
|
||||
#include "Widgets/Label.hpp"
|
||||
|
||||
class wxString;
|
||||
class wxStaticText;
|
||||
class wxComboBox;
|
||||
class wxStaticBitmap;
|
||||
|
||||
#define SAVE_PRESET_DIALOG_DEF_COLOUR wxColour(255, 255, 255)
|
||||
#define SAVE_PRESET_DIALOG_INPUT_SIZE wxSize(FromDIP(360), FromDIP(32))
|
||||
#define SAVE_PRESET_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
class SavePresetDialog : public DPIDialog
|
||||
{
|
||||
enum ActionType
|
||||
{
|
||||
ChangePreset,
|
||||
AddPreset,
|
||||
Switch,
|
||||
UndefAction
|
||||
};
|
||||
|
||||
class Item : public wxWindow
|
||||
{
|
||||
public:
|
||||
enum ValidationType
|
||||
{
|
||||
Valid,
|
||||
NoValid,
|
||||
Warning
|
||||
};
|
||||
|
||||
Item(Preset::Type type, const std::string& suffix, wxBoxSizer* sizer, SavePresetDialog* parent);
|
||||
|
||||
void update_valid_bmp();
|
||||
void accept();
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
bool is_valid() const { return m_valid_type != NoValid; }
|
||||
Preset::Type type() const { return m_type; }
|
||||
std::string preset_name() const { return m_preset_name; }
|
||||
//BBS: add project embedded preset relate logic
|
||||
bool save_to_project() const { return m_save_to_project; }
|
||||
|
||||
RoundedRectangle* m_input_area {nullptr};
|
||||
Preset::Type m_type;
|
||||
ValidationType m_valid_type;
|
||||
std::string m_preset_name;
|
||||
|
||||
SavePresetDialog* m_parent {nullptr};
|
||||
wxStaticBitmap* m_valid_bmp {nullptr};
|
||||
wxComboBox* m_combo {nullptr};
|
||||
wxTextCtrl* m_input_ctrl {nullptr};
|
||||
wxStaticText* m_valid_label {nullptr};
|
||||
|
||||
PresetCollection* m_presets {nullptr};
|
||||
|
||||
//BBS: add project embedded preset relate logic
|
||||
RadioBox * m_radio_user{nullptr};
|
||||
RadioBox * m_radio_project{nullptr};
|
||||
bool m_save_to_project {false};
|
||||
|
||||
void update();
|
||||
};
|
||||
|
||||
std::vector<Item*> m_items;
|
||||
|
||||
Button* m_confirm {nullptr};
|
||||
Button* m_cancel {nullptr};
|
||||
wxBoxSizer* m_presets_sizer {nullptr};
|
||||
wxStaticText* m_label {nullptr};
|
||||
wxBoxSizer* m_radio_sizer {nullptr};
|
||||
ActionType m_action {UndefAction};
|
||||
|
||||
std::string m_ph_printer_name;
|
||||
std::string m_old_preset_name;
|
||||
|
||||
public:
|
||||
SavePresetDialog(wxWindow *parent, Preset::Type type, std::string suffix = "");
|
||||
SavePresetDialog(wxWindow* parent, std::vector<Preset::Type> types, std::string suffix = "");
|
||||
~SavePresetDialog();
|
||||
|
||||
void AddItem(Preset::Type type, const std::string& suffix);
|
||||
|
||||
std::string get_name();
|
||||
std::string get_name(Preset::Type type);
|
||||
|
||||
bool enable_ok_btn() const;
|
||||
void add_info_for_edit_ph_printer(wxBoxSizer *sizer);
|
||||
void update_info_for_edit_ph_printer(const std::string &preset_name);
|
||||
void layout();
|
||||
//BBS: add project embedded preset relate logic
|
||||
bool get_save_to_project_selection(Preset::Type type);
|
||||
|
||||
protected:
|
||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void on_sys_color_changed() override {}
|
||||
|
||||
private:
|
||||
void build(std::vector<Preset::Type> types, std::string suffix = "");
|
||||
void on_select_cancel(wxMouseEvent &event);
|
||||
void update_physical_printers(const std::string &preset_name);
|
||||
void accept(wxMouseEvent &event);
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue