2019-03-19 01:41:00 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/GDialog.h>
|
|
|
|
|
2019-03-19 02:20:00 +01:00
|
|
|
class GButton;
|
|
|
|
class GTextEditor;
|
|
|
|
|
2019-03-19 01:41:00 +01:00
|
|
|
class GInputBox : public GDialog {
|
|
|
|
public:
|
2019-06-02 14:58:02 +02:00
|
|
|
explicit GInputBox(const StringView& prompt, const StringView& title, CObject* parent = nullptr);
|
2019-03-19 01:41:00 +01:00
|
|
|
virtual ~GInputBox() override;
|
|
|
|
|
|
|
|
String text_value() const { return m_text_value; }
|
|
|
|
|
2019-05-08 22:10:00 +02:00
|
|
|
virtual const char* class_name() const override { return "GInputBox"; }
|
|
|
|
|
2019-03-19 01:41:00 +01:00
|
|
|
private:
|
|
|
|
void build();
|
|
|
|
String m_prompt;
|
|
|
|
String m_text_value;
|
2019-03-19 02:20:00 +01:00
|
|
|
|
|
|
|
GButton* m_ok_button { nullptr };
|
|
|
|
GButton* m_cancel_button { nullptr };
|
|
|
|
GTextEditor* m_text_editor { nullptr };
|
2019-03-19 01:41:00 +01:00
|
|
|
};
|