GInputBox.h 525 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <LibGUI/GDialog.h>
  3. class GButton;
  4. class GTextEditor;
  5. class GInputBox : public GDialog {
  6. C_OBJECT(GInputBox)
  7. public:
  8. explicit GInputBox(const StringView& prompt, const StringView& title, CObject* parent = nullptr);
  9. virtual ~GInputBox() override;
  10. String text_value() const { return m_text_value; }
  11. private:
  12. void build();
  13. String m_prompt;
  14. String m_text_value;
  15. RefPtr<GButton> m_ok_button;
  16. RefPtr<GButton> m_cancel_button;
  17. RefPtr<GTextEditor> m_text_editor;
  18. };