19#ifndef HEADER_CONFIRM_DIALOG_HPP
20#define HEADER_CONFIRM_DIALOG_HPP
22#include "guiengine/modaldialog.hpp"
23#include "utils/cpp2011.hpp"
24#include "utils/leak_check.hpp"
51 virtual void onConfirm() { ModalDialog::dismiss(); };
57 virtual void onCancel() { ModalDialog::dismiss(); };
65 enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM,
66 MESSAGE_DIALOG_OK_CANCEL, MESSAGE_DIALOG_YESNO,
67 MESSAGE_DIALOG_OK_DONTSHOWAGAIN };
69 MessageDialogType m_type;
73 IConfirmDialogListener* m_listener;
75 irr::core::stringw m_msg;
76 void doInit(
bool from_queue);
90 MessageDialog(
const irr::core::stringw &msg, MessageDialogType type,
92 bool from_queue =
false,
float width = 0.6f,
float height = 0.6f,
93 bool focus_on_cancel =
false);
99 MessageDialog(
const irr::core::stringw &msg,
bool from_queue =
false,
100 bool focus_on_cancel =
false);
104 virtual void onEnterPressedInternal() OVERRIDE;
105 virtual
void onUpdate(
float dt) OVERRIDE;
106 virtual
void load() OVERRIDE;
115 virtual void init() OVERRIDE;
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:56
Listener interface to get notified of whether the user chose to confirm or cancel.
Definition: message_dialog.hpp:39
virtual void onDialogUpdate(float dt)
Optional callback.
Definition: message_dialog.hpp:62
virtual void onConfirm()
Implement to be notified of dialog confirmed.
Definition: message_dialog.hpp:51
virtual void onCancel()
Implement to be notified of dialog cancelled.
Definition: message_dialog.hpp:57
Generic dialog to ask the user to confirm something, or to show a simple message box.
Definition: message_dialog.hpp:31
virtual void onUpdate(float dt) OVERRIDE
Override to be notified of updates.
Definition: message_dialog.cpp:193
void doInit(bool from_queue)
If necessary schedules a pause, and loads the xml file if necessary.
Definition: message_dialog.cpp:87
GUIEngine::EventPropagation processEvent(const std::string &eventSource) OVERRIDE
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: message_dialog.cpp:157
bool m_focus_on_cancel
If set this will set the focus on 'cancel'/'no' instead of "yes"/"ok".
Definition: message_dialog.hpp:80
virtual void init() OVERRIDE
Optional callback invoked after widgets have been add()ed.
Definition: message_dialog.cpp:200
virtual void loadedFromFile() OVERRIDE
Callback invoked when the dialog was loaded from the XML file (if the constructor that takes a XML fi...
Definition: message_dialog.cpp:112
void setFocusCancel()
Calling this will make sure that the focus is set on the 'cancel' or 'no'.
Definition: message_dialog.hpp:114
virtual void load() OVERRIDE
Called from the DialogQueue, used to load the actual xml file and init the dialog.
Definition: message_dialog.cpp:77
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33