mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-06-06 05:42:59 -04:00
* MSW specific: Dark Mode: First implementation * Use menu instead of NoteBook * Implemented MessageDialog + Fixed DarkMode for all dialogs and ColorPicker * MSW DarkMode: Added missed updates for the switching between modes * MSW DarkMode: Updated all existed context menus after switching of the mode + Added markers for the menu item witch is related to the selected tab * Used wxFrame instead of wxDialog for SettingsDialog (this change allow us to use menu bar in SettingsDialog) + fix for #6548 - Prusa Slicer 2.3.1 not activating non-modal settings window if settings window is minimized * Implemented "Always use Dark mode colors" preference option * Fixes for non_MSW build * Next fixes for non-MSW builds * Preferences: Fixed selection of the Settings Layout for non-MSW platforms + Updated DarkMode for colorpickers * Windows DarkMode next fixes * MSWDarkMode: Suppress to use system color to the PrusaSlicer Select "Preferences -> Use Dark color mode (experimental)" to allow dark mode for the application * Fixed MSW build * MSWDarkMode: Upadteed color mode for ExtruderSequenceDialog and for dialogs related to the DoubleSlider * Implemented Auto recreation of the PrusaSlicer when color mode is changed. * Preferences: Added option "Set settings tabs as menu items (experimental)"
107 lines
2.8 KiB
C++
107 lines
2.8 KiB
C++
#ifndef slic3r_MsgDialog_hpp_
|
|
#define slic3r_MsgDialog_hpp_
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
#include <wx/dialog.h>
|
|
#include <wx/font.h>
|
|
#include <wx/bitmap.h>
|
|
|
|
class wxBoxSizer;
|
|
class wxCheckBox;
|
|
class wxStaticBitmap;
|
|
|
|
namespace Slic3r {
|
|
|
|
namespace GUI {
|
|
|
|
|
|
// A message / query dialog with a bitmap on the left and any content on the right
|
|
// with buttons underneath.
|
|
struct MsgDialog : wxDialog
|
|
{
|
|
MsgDialog(MsgDialog &&) = delete;
|
|
MsgDialog(const MsgDialog &) = delete;
|
|
MsgDialog &operator=(MsgDialog &&) = delete;
|
|
MsgDialog &operator=(const MsgDialog &) = delete;
|
|
virtual ~MsgDialog() = default;
|
|
|
|
// TODO: refactor with CreateStdDialogButtonSizer usage
|
|
|
|
protected:
|
|
enum {
|
|
CONTENT_WIDTH = 70,//50,
|
|
CONTENT_MAX_HEIGHT = 60,
|
|
BORDER = 30,
|
|
VERT_SPACING = 15,
|
|
HORIZ_SPACING = 5,
|
|
};
|
|
|
|
// button_id is an id of a button that can be added by default, use wxID_NONE to disable
|
|
MsgDialog(wxWindow *parent, const wxString &title, const wxString &headline, wxWindowID button_id = wxID_OK, wxBitmap bitmap = wxNullBitmap);
|
|
|
|
void add_btn(wxWindowID btn_id, bool set_focus = false);
|
|
|
|
wxFont boldfont;
|
|
wxBoxSizer *content_sizer;
|
|
wxBoxSizer *btn_sizer;
|
|
wxStaticBitmap *logo;
|
|
};
|
|
|
|
|
|
// Generic error dialog, used for displaying exceptions
|
|
class ErrorDialog : public MsgDialog
|
|
{
|
|
public:
|
|
// If monospaced_font is true, the error message is displayed using html <code><pre></pre></code> tags,
|
|
// so that the code formatting will be preserved. This is useful for reporting errors from the placeholder parser.
|
|
ErrorDialog(wxWindow *parent, const wxString &msg, bool courier_font);
|
|
ErrorDialog(ErrorDialog &&) = delete;
|
|
ErrorDialog(const ErrorDialog &) = delete;
|
|
ErrorDialog &operator=(ErrorDialog &&) = delete;
|
|
ErrorDialog &operator=(const ErrorDialog &) = delete;
|
|
virtual ~ErrorDialog() = default;
|
|
|
|
private:
|
|
wxString msg;
|
|
};
|
|
|
|
|
|
// Generic warning dialog, used for displaying exceptions
|
|
class WarningDialog : public MsgDialog
|
|
{
|
|
public:
|
|
WarningDialog( wxWindow *parent,
|
|
const wxString& message,
|
|
const wxString& caption = wxEmptyString,
|
|
long style = wxOK);
|
|
WarningDialog(WarningDialog&&) = delete;
|
|
WarningDialog(const WarningDialog&) = delete;
|
|
WarningDialog &operator=(WarningDialog&&) = delete;
|
|
WarningDialog &operator=(const WarningDialog&) = delete;
|
|
virtual ~WarningDialog() = default;
|
|
};
|
|
|
|
|
|
// Generic message dialog, used intead of wxMessageDialog
|
|
class MessageDialog : public MsgDialog
|
|
{
|
|
public:
|
|
MessageDialog( wxWindow *parent,
|
|
const wxString& message,
|
|
const wxString& caption = wxEmptyString,
|
|
long style = wxOK);
|
|
MessageDialog(MessageDialog&&) = delete;
|
|
MessageDialog(const MessageDialog&) = delete;
|
|
MessageDialog &operator=(MessageDialog&&) = delete;
|
|
MessageDialog &operator=(const MessageDialog&) = delete;
|
|
virtual ~MessageDialog() = default;
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif
|