2018-04-30 12:31:57 +00:00
|
|
|
#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;
|
2019-04-05 16:53:02 +00:00
|
|
|
class wxStaticBitmap;
|
2018-04-30 12:31:57 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
2018-05-23 10:47:39 +00:00
|
|
|
// TODO: refactor with CreateStdDialogButtonSizer usage
|
|
|
|
|
2018-04-30 12:31:57 +00:00
|
|
|
protected:
|
|
|
|
enum {
|
2019-02-21 17:59:21 +00:00
|
|
|
CONTENT_WIDTH = 50,
|
|
|
|
CONTENT_MAX_HEIGHT = 60,
|
2018-04-30 12:31:57 +00:00
|
|
|
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
|
2019-04-05 16:53:02 +00:00
|
|
|
MsgDialog(wxWindow *parent, const wxString &title, const wxString &headline, wxWindowID button_id = wxID_OK, wxBitmap bitmap = wxNullBitmap);
|
2018-04-30 12:31:57 +00:00
|
|
|
|
|
|
|
wxFont boldfont;
|
|
|
|
wxBoxSizer *content_sizer;
|
|
|
|
wxBoxSizer *btn_sizer;
|
2019-04-05 16:53:02 +00:00
|
|
|
wxStaticBitmap *logo;
|
2018-04-30 12:31:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Generic error dialog, used for displaying exceptions
|
2018-12-18 17:40:35 +00:00
|
|
|
class ErrorDialog : public MsgDialog
|
2018-04-30 12:31:57 +00:00
|
|
|
{
|
2018-12-18 17:40:35 +00:00
|
|
|
public:
|
2018-04-30 12:31:57 +00:00
|
|
|
ErrorDialog(wxWindow *parent, const wxString &msg);
|
|
|
|
ErrorDialog(ErrorDialog &&) = delete;
|
|
|
|
ErrorDialog(const ErrorDialog &) = delete;
|
|
|
|
ErrorDialog &operator=(ErrorDialog &&) = delete;
|
|
|
|
ErrorDialog &operator=(const ErrorDialog &) = delete;
|
|
|
|
virtual ~ErrorDialog();
|
2018-12-18 17:40:35 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
wxString msg;
|
2018-04-30 12:31:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|