ladybird/LibGUI/GDialog.h
Andreas Kling f88e550998 LibGUI: More work on GInputBox.
- If the GInputBox has a parent and the parent is a GWindow, center the
  input box window within the parent window. This looks quite nice.

- Stop processing events in a nested event loop immediately after it's
  been asked to quit.

- Fix GWidget::parent_widget() behavior for non-widget parents.
2019-03-19 02:22:49 +01:00

24 lines
442 B
C++

#pragma once
#include <LibGUI/GWindow.h>
#include <LibGUI/GEventLoop.h>
class GDialog : public GWindow {
public:
enum ExecResult { ExecOK = 0, ExecCancel = 1, ExecAborted = 2 };
virtual ~GDialog() override;
int exec();
int result() const { return m_result; }
void done(int result);
protected:
explicit GDialog(GObject* parent);
private:
OwnPtr<GEventLoop> m_event_loop;
int m_result { ExecAborted };
};