TDME2
1.9.200
src
tdme
tools
editor
controllers
InputDialogScreenController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <memory>
4
#include <string>
5
6
#include <
tdme/tdme.h
>
7
#include <
tdme/gui/events/fwd-tdme.h
>
8
#include <
tdme/gui/events/GUIActionListener.h
>
9
#include <
tdme/gui/events/GUIChangeListener.h
>
10
#include <
tdme/gui/events/GUIFocusListener.h
>
11
#include <
tdme/gui/events/GUITooltipRequestListener.h
>
12
#include <
tdme/gui/nodes/fwd-tdme.h
>
13
#include <
tdme/tools/editor/misc/fwd-tdme.h
>
14
#include <
tdme/tools/editor/controllers/ScreenController.h
>
15
#include <
tdme/utilities/fwd-tdme.h
>
16
17
using
std::string;
18
using
std::unique_ptr;
19
20
using
tdme::gui::events::GUIActionListener
;
21
using
tdme::gui::events::GUIActionListenerType
;
22
using
tdme::gui::events::GUIChangeListener
;
23
using
tdme::gui::events::GUIFocusListener
;
24
using
tdme::gui::events::GUITooltipRequestListener
;
25
using
tdme::gui::nodes::GUINode
;
26
using
tdme::gui::nodes::GUIElementNode
;
27
using
tdme::gui::nodes::GUIScreenNode
;
28
using
tdme::tools::editor::misc::PopUps
;
29
using
tdme::tools::editor::controllers::ScreenController
;
30
using
tdme::utilities::Action
;
31
32
/**
33
* Input dialog screen controller
34
* @author Andreas Drewke
35
*/
36
class
tdme::tools::editor::controllers::InputDialogScreenController
final
37
:
public
ScreenController
38
,
public
virtual
GUIActionListener
39
,
public
virtual
GUIChangeListener
40
,
public
virtual
GUIFocusListener
41
,
public
virtual
GUITooltipRequestListener
42
{
43
44
private
:
45
PopUps
*
popUps
{
nullptr
};
46
GUIScreenNode
*
screenNode
{
nullptr
};
47
GUIElementNode
*
tabsHeaderNode
{
nullptr
};
48
GUIElementNode
*
inputNode
{
nullptr
};
49
unique_ptr<Action>
applyAction
;
50
unique_ptr<Action>
cancelAction
;
51
52
public
:
53
// forbid class copy
54
FORBID_CLASS_COPY
(
InputDialogScreenController
)
55
56
/**
57
* Public constructor
58
* @param popUps pop ups
59
*/
60
InputDialogScreenController
(
PopUps
*
popUps
);
61
62
/**
63
* Destructor
64
*/
65
virtual
~InputDialogScreenController
();
66
67
// overridden methods
68
GUIScreenNode
*
getScreenNode
()
override
;
69
70
/**
71
* @return input text
72
*/
73
const
string
getInputText
();
74
75
/**
76
* Shows the input dialog pop up
77
* @param captionText caption text
78
* @param inputText input text
79
* @param applyAction apply action
80
* @param cancelAction cancel action
81
*/
82
void
show
(
const
string
& captionText,
const
string
& inputText,
Action
*
applyAction
,
Action
*
cancelAction
=
nullptr
);
83
84
/**
85
* Abort the file dialog pop up
86
*/
87
void
close
();
88
89
// overridden methods
90
void
initialize
()
override
;
91
void
dispose
()
override
;
92
void
onChange
(
GUIElementNode
* node)
override
;
93
void
onAction
(
GUIActionListenerType
type,
GUIElementNode
* node)
override
;
94
void
onFocus
(
GUIElementNode
* node)
override
;
95
void
onUnfocus
(
GUIElementNode
* node)
override
;
96
void
onTooltipShowRequest
(
GUINode
* node,
int
mouseX,
int
mouseY)
override
;
97
void
onTooltipCloseRequest
()
override
;
98
99
};
GUIActionListener.h
GUIChangeListener.h
GUIFocusListener.h
GUITooltipRequestListener.h
ScreenController.h
tdme::gui::nodes::GUIElementNode
GUI element node.
Definition:
GUIElementNode.h:37
tdme::gui::nodes::GUINode
GUI node base class.
Definition:
GUINode.h:64
tdme::gui::nodes::GUIScreenNode
GUI screen node that represents a screen that can be rendered via GUI system.
Definition:
GUIScreenNode.h:72
tdme::tools::editor::controllers::InputDialogScreenController
Input dialog screen controller.
Definition:
InputDialogScreenController.h:42
tdme::tools::editor::controllers::InputDialogScreenController::dispose
void dispose() override
Dispose.
Definition:
InputDialogScreenController.cpp:82
tdme::tools::editor::controllers::InputDialogScreenController::initialize
void initialize() override
Init.
Definition:
InputDialogScreenController.cpp:66
tdme::tools::editor::controllers::InputDialogScreenController::onChange
void onChange(GUIElementNode *node) override
On change.
Definition:
InputDialogScreenController.cpp:106
tdme::tools::editor::controllers::InputDialogScreenController::getScreenNode
GUIScreenNode * getScreenNode() override
Definition:
InputDialogScreenController.cpp:56
tdme::tools::editor::controllers::InputDialogScreenController::close
void close()
Abort the file dialog pop up.
Definition:
InputDialogScreenController.cpp:99
tdme::tools::editor::controllers::InputDialogScreenController::InputDialogScreenController
InputDialogScreenController(PopUps *popUps)
Public constructor.
Definition:
InputDialogScreenController.cpp:48
tdme::tools::editor::controllers::InputDialogScreenController::onUnfocus
void onUnfocus(GUIElementNode *node) override
On unfocus.
Definition:
InputDialogScreenController.cpp:132
tdme::tools::editor::controllers::InputDialogScreenController::applyAction
unique_ptr< Action > applyAction
Definition:
InputDialogScreenController.h:49
tdme::tools::editor::controllers::InputDialogScreenController::onTooltipCloseRequest
void onTooltipCloseRequest() override
On tooltip close request.
Definition:
InputDialogScreenController.cpp:139
tdme::tools::editor::controllers::InputDialogScreenController::screenNode
GUIScreenNode * screenNode
Definition:
InputDialogScreenController.h:46
tdme::tools::editor::controllers::InputDialogScreenController::onFocus
void onFocus(GUIElementNode *node) override
On focus.
Definition:
InputDialogScreenController.cpp:128
tdme::tools::editor::controllers::InputDialogScreenController::show
void show(const string &captionText, const string &inputText, Action *applyAction, Action *cancelAction=nullptr)
Shows the input dialog pop up.
Definition:
InputDialogScreenController.cpp:88
tdme::tools::editor::controllers::InputDialogScreenController::~InputDialogScreenController
virtual ~InputDialogScreenController()
Destructor.
Definition:
InputDialogScreenController.cpp:53
tdme::tools::editor::controllers::InputDialogScreenController::inputNode
GUIElementNode * inputNode
Definition:
InputDialogScreenController.h:48
tdme::tools::editor::controllers::InputDialogScreenController::getInputText
const string getInputText()
Definition:
InputDialogScreenController.cpp:61
tdme::tools::editor::controllers::InputDialogScreenController::popUps
PopUps * popUps
Definition:
InputDialogScreenController.h:45
tdme::tools::editor::controllers::InputDialogScreenController::onAction
void onAction(GUIActionListenerType type, GUIElementNode *node) override
Definition:
InputDialogScreenController.cpp:110
tdme::tools::editor::controllers::InputDialogScreenController::tabsHeaderNode
GUIElementNode * tabsHeaderNode
Definition:
InputDialogScreenController.h:47
tdme::tools::editor::controllers::InputDialogScreenController::onTooltipShowRequest
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
Definition:
InputDialogScreenController.cpp:135
tdme::tools::editor::controllers::InputDialogScreenController::cancelAction
unique_ptr< Action > cancelAction
Definition:
InputDialogScreenController.h:50
tdme::tools::editor::misc::PopUps
Pop ups controller accessor class.
Definition:
PopUps.h:29
fwd-tdme.h
fwd-tdme.h
tdme::gui::events::GUIActionListenerType
GUIActionListenerType
Definition:
GUIActionListener.h:12
tdme::gui::events::GUIActionListener
GUI action listener interface.
Definition:
GUIActionListener.h:25
tdme::gui::events::GUIChangeListener
GUI change listener interface.
Definition:
GUIChangeListener.h:14
tdme::gui::events::GUIFocusListener
GUI focus listener interface.
Definition:
GUIFocusListener.h:14
tdme::gui::events::GUITooltipRequestListener
GUI tooltip request listener.
Definition:
GUITooltipRequestListener.h:14
tdme::tools::editor::controllers::ScreenController
Screen controller, which connects GUI screen definition with code.
Definition:
ScreenController.h:14
tdme::utilities::Action
Action Interface.
Definition:
Action.h:11
tdme.h
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
fwd-tdme.h
fwd-tdme.h
Generated by
1.9.1