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