TDME2  1.9.200
SoundTabController.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
12 #include <tdme/gui/GUI.h>
13 #include <tdme/gui/GUIParser.h>
23 #include <tdme/utilities/Action.h>
24 #include <tdme/utilities/Console.h>
27 
28 #include <ext/tinyxml/tinyxml.h>
29 
31 
32 using std::string;
33 
39 using tdme::gui::GUI;
54 
58 
59 #define AVOID_NULLPTR_STRING(arg) (arg == nullptr?"":arg)
60 
61 SoundTabController::SoundTabController(SoundTabView* view)
62 {
63  this->view = view;
64  this->popUps = view->getPopUps();
65 }
66 
68 }
69 
71 {
72  this->screenNode = screenNode;
73 }
74 
76 {
77 }
78 
80 {
81  showInfoPopUp("Warning", "This command is not supported yet");
82 }
83 
84 void SoundTabController::onDrop(const string& payload, int mouseX, int mouseY) {
85  showInfoPopUp("Warning", "You can not drop a file here");
86 }
87 
88 void SoundTabController::showInfoPopUp(const string& caption, const string& message)
89 {
90  popUps->getInfoDialogScreenController()->show(caption, message);
91 }
92 
94 {
95 }
96 
98 }
99 
101 }
102 
103 void SoundTabController::onContextMenuRequest(GUIElementNode* node, int mouseX, int mouseY) {
104 }
105 
106 void SoundTabController::onTooltipShowRequest(GUINode* node, int mouseX, int mouseY) {
107  int tooltipLeft, tooltipTop;
108  if (view->getEditorView()->getCurrentTabTooltipPosition(screenNode, mouseX, mouseY, tooltipLeft, tooltipTop) == false) return;
109  //
110  popUps->getTooltipScreenController()->show(tooltipLeft, tooltipTop, node->getToolTip());
111 }
112 
115 }
116 
118  string xml;
119  xml+= "<selectbox-option text=\"Sound\" value=\"sound\" />\n";
121 }
122 
125 }
126 
128 {
129  if (type != GUIActionListenerType::PERFORMED) return;
130  if (node->getId() == "play") {
131  view->play();
132  } else
133  if (node->getId() == "stop") {
134  view->stop();
135  }
136 }
GUI parser.
Definition: GUIParser.h:40
GUI module class.
Definition: GUI.h:64
GUI node base class.
Definition: GUINode.h:64
const string & getToolTip()
Definition: GUINode.h:346
const string & getId()
Definition: GUINode.h:339
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
File system singleton class.
Definition: FileSystem.h:17
void show(const string &caption, const string &message)
Shows the pop up.
void show(int mouseX, int mouseY, const string &tooltip)
Show tooltip.
Pop ups controller accessor class.
Definition: PopUps.h:29
TooltipScreenController * getTooltipScreenController()
Definition: PopUps.h:131
InfoDialogScreenController * getInfoDialogScreenController()
Definition: PopUps.h:75
void onContextMenuRequest(GUIElementNode *node, int mouseX, int mouseY) override
On context menu request.
void onDrop(const string &payload, int mouseX, int mouseY) override
On drop.
void setOutlinerAddDropDownContent()
Set outliner add drop down content.
void onChange(GUIElementNode *node) override
On change.
void onCommand(TabControllerCommand command) override
On command.
void onUnfocus(GUIElementNode *node) override
On unfocus.
void onTooltipCloseRequest() override
On tooltip close request.
void onFocus(GUIElementNode *node) override
On focus.
void initialize(GUIScreenNode *screenNode) override
Init.
void showInfoPopUp(const string &caption, const string &message)
Show the information pop up / modal.
void onAction(GUIActionListenerType type, GUIElementNode *node) override
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
void setOutlinerAddDropDownContent(const string &xml)
Set outliner add drop down content.
Definition: EditorView.cpp:400
void setOutlinerContent(const string &xml)
Set outliner content.
Definition: EditorView.cpp:396
bool getCurrentTabTooltipPosition(GUIScreenNode *screenNode, int mouseX, int mouseY, int &tooltipLeft, int &tooltipTop)
Determine current tab tooltip position.
Definition: EditorView.cpp:439
Console class.
Definition: Console.h:29
Exception base class.
Definition: ExceptionBase.h:19
An attribute is a name-value pair.
Definition: tinyxml.h:734
Always the top level node.
Definition: tinyxml.h:1317
The element is a container class.
Definition: tinyxml.h:886
std::exception Exception
Exception base class.
Definition: Exception.h:18
Tab controller, which connects UI with logic.
Definition: TabController.h:34
Action Interface.
Definition: Action.h:11