mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 21:00:06 +00:00
LibGUI: Add input types to GMessageBox.
Currently the two available input types are: - GMessageBox::InputType::OK (default) - GMessageBox::InputType::OKCancel Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
This commit is contained in:
@@ -11,17 +11,25 @@ public:
|
||||
Error,
|
||||
};
|
||||
|
||||
explicit GMessageBox(const StringView& text, const StringView& title, Type type = Type::None, CObject* parent = nullptr);
|
||||
enum class InputType {
|
||||
OK,
|
||||
OKCancel,
|
||||
};
|
||||
|
||||
explicit GMessageBox(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, CObject* parent = nullptr);
|
||||
virtual ~GMessageBox() override;
|
||||
|
||||
static void show(const StringView& text, const StringView& title, Type type = Type::None, CObject* parent = nullptr);
|
||||
static void show(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, CObject* parent = nullptr);
|
||||
|
||||
virtual const char* class_name() const override { return "GMessageBox"; }
|
||||
|
||||
private:
|
||||
bool should_include_ok_button() const;
|
||||
bool should_include_cancel_button() const;
|
||||
void build();
|
||||
RefPtr<GraphicsBitmap> icon() const;
|
||||
|
||||
String m_text;
|
||||
Type m_type { Type::None };
|
||||
InputType m_input_type { InputType::OK };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user