2019-03-19 00:01:02 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibGUI/GDialog.h>
|
|
|
|
|
|
|
|
|
|
class GMessageBox : public GDialog {
|
|
|
|
|
public:
|
2019-05-28 11:53:16 +02:00
|
|
|
enum class Type
|
|
|
|
|
{
|
2019-05-08 20:13:39 +02:00
|
|
|
None,
|
|
|
|
|
Information,
|
|
|
|
|
Warning,
|
|
|
|
|
Error,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
explicit GMessageBox(const String& text, const String& title, Type type = Type::None, CObject* parent = nullptr);
|
2019-03-19 00:01:02 +01:00
|
|
|
virtual ~GMessageBox() override;
|
|
|
|
|
|
2019-05-08 20:13:39 +02:00
|
|
|
static void show(const String& text, const String& title, Type type = Type::None, CObject* parent = nullptr);
|
|
|
|
|
|
2019-05-08 22:10:00 +02:00
|
|
|
virtual const char* class_name() const override { return "GMessageBox"; }
|
|
|
|
|
|
2019-03-19 01:41:00 +01:00
|
|
|
private:
|
2019-03-19 00:01:02 +01:00
|
|
|
void build();
|
2019-05-08 20:13:39 +02:00
|
|
|
RetainPtr<GraphicsBitmap> icon() const;
|
2019-03-19 00:01:02 +01:00
|
|
|
|
|
|
|
|
String m_text;
|
2019-05-08 20:13:39 +02:00
|
|
|
Type m_type { Type::None };
|
2019-03-19 00:01:02 +01:00
|
|
|
};
|