summaryrefslogtreecommitdiff
path: root/scene/gui/dialogs.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/dialogs.h')
-rw-r--r--scene/gui/dialogs.h56
1 files changed, 22 insertions, 34 deletions
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index dd75b76c8e..a729a8f907 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -29,20 +29,19 @@
#ifndef DIALOGS_H
#define DIALOGS_H
-#include "scene/gui/label.h"
+#include "box_container.h"
#include "scene/gui/button.h"
-#include "scene/gui/texture_button.h"
+#include "scene/gui/label.h"
#include "scene/gui/panel.h"
#include "scene/gui/popup.h"
-#include "box_container.h"
+#include "scene/gui/texture_button.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-
class WindowDialog : public Popup {
- GDCLASS(WindowDialog,Popup);
+ GDCLASS(WindowDialog, Popup);
enum DRAG_TYPE {
DRAG_NONE = 0,
@@ -60,22 +59,22 @@ class WindowDialog : public Popup {
Point2 drag_offset_far;
bool resizable;
- void _gui_input(const InputEvent& p_event);
+ void _gui_input(const InputEvent &p_event);
void _closed();
- int _drag_hit_test(const Point2& pos) const;
+ int _drag_hit_test(const Point2 &pos) const;
protected:
virtual void _post_popup();
virtual void _fix_size();
- virtual void _close_pressed() {}
- virtual bool has_point(const Point2& p_point) const;
+ virtual void _close_pressed() {}
+ virtual bool has_point(const Point2 &p_point) const;
void _notification(int p_what);
static void _bind_methods();
-public:
+public:
TextureButton *get_close_button();
- void set_title(const String& p_title);
+ void set_title(const String &p_title);
String get_title() const;
void set_resizable(bool p_resizable);
bool get_resizable() const;
@@ -84,28 +83,25 @@ public:
WindowDialog();
~WindowDialog();
-
};
class PopupDialog : public Popup {
- GDCLASS(PopupDialog,Popup);
+ GDCLASS(PopupDialog, Popup);
protected:
void _notification(int p_what);
-public:
+public:
PopupDialog();
~PopupDialog();
-
};
-
class LineEdit;
class AcceptDialog : public WindowDialog {
- GDCLASS(AcceptDialog,WindowDialog);
+ GDCLASS(AcceptDialog, WindowDialog);
HBoxContainer *hbc;
Label *label;
@@ -113,39 +109,33 @@ class AcceptDialog : public WindowDialog {
//Button *cancel; no more cancel (there is X on tht titlebar)
bool hide_on_ok;
-
- void _custom_action(const String& p_action);
+ void _custom_action(const String &p_action);
void _ok_pressed();
void _close_pressed();
- void _builtin_text_entered(const String& p_text);
+ void _builtin_text_entered(const String &p_text);
void _update_child_rects();
static bool swap_ok_cancel;
-
-
protected:
-
virtual void _post_popup();
void _notification(int p_what);
static void _bind_methods();
virtual void ok_pressed() {}
virtual void cancel_pressed() {}
- virtual void custom_action(const String&) {}
-public:
+ virtual void custom_action(const String &) {}
+public:
Size2 get_minimum_size() const;
Label *get_label() { return label; }
static void set_swap_ok_cancel(bool p_swap);
-
void register_text_enter(Node *p_line_edit);
Button *get_ok() { return ok; }
- Button* add_button(const String& p_text,bool p_right=false,const String& p_action="");
- Button* add_cancel(const String &p_cancel="");
-
+ Button *add_button(const String &p_text, bool p_right = false, const String &p_action = "");
+ Button *add_cancel(const String &p_cancel = "");
void set_hide_on_ok(bool p_hide);
bool get_hide_on_ok() const;
@@ -155,21 +145,19 @@ public:
AcceptDialog();
~AcceptDialog();
-
};
-
class ConfirmationDialog : public AcceptDialog {
- GDCLASS(ConfirmationDialog,AcceptDialog);
+ GDCLASS(ConfirmationDialog, AcceptDialog);
Button *cancel;
+
protected:
static void _bind_methods();
-public:
+public:
Button *get_cancel();
ConfirmationDialog();
-
};
#endif