2019-03-19 02:01:02 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/GWindow.h>
|
2019-03-19 04:20:00 +03:00
|
|
|
#include <LibGUI/GEventLoop.h>
|
2019-03-19 02:01:02 +03:00
|
|
|
|
|
|
|
class GDialog : public GWindow {
|
|
|
|
public:
|
2019-03-19 04:20:00 +03:00
|
|
|
enum ExecResult { ExecOK = 0, ExecCancel = 1, ExecAborted = 2 };
|
|
|
|
|
2019-03-19 02:01:02 +03:00
|
|
|
virtual ~GDialog() override;
|
|
|
|
|
|
|
|
int exec();
|
|
|
|
|
|
|
|
int result() const { return m_result; }
|
|
|
|
void done(int result);
|
|
|
|
|
2019-05-08 23:10:00 +03:00
|
|
|
virtual const char* class_name() const override { return "GDialog"; }
|
|
|
|
|
2019-03-19 02:01:02 +03:00
|
|
|
protected:
|
2019-04-10 18:01:54 +03:00
|
|
|
explicit GDialog(CObject* parent);
|
2019-03-19 02:01:02 +03:00
|
|
|
|
|
|
|
private:
|
2019-03-19 04:20:00 +03:00
|
|
|
OwnPtr<GEventLoop> m_event_loop;
|
|
|
|
int m_result { ExecAborted };
|
2019-03-19 02:01:02 +03:00
|
|
|
};
|