TDME2  1.9.200
GUIInput.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 #include <unordered_map>
5 
6 #include <tdme/tdme.h>
11 
13 
14 using std::string;
15 using std::unordered_map;
16 
21 
22 string GUIInput::NAME = "input";
23 
24 GUIInput::GUIInput()
25 {
26 }
27 
28 const string& GUIInput::getName()
29 {
30  return NAME;
31 }
32 
33 const string GUIInput::getTemplate(const string& applicationPathName, const string& applicationSubPathName, const string& fileName)
34 {
35  return FileSystem::getInstance()->getContentAsString(applicationPathName + "/resources/" + applicationSubPathName + "/gui/definitions", fileName.empty() == true?"input.xml":fileName);
36 }
37 
38 unordered_map<string, string> GUIInput::getAttributes(GUIScreenNode* screenNode)
39 {
40  unordered_map<string, string> attributes;
41  attributes["id"] = screenNode->allocateNodeId();
42  attributes["width"] = "auto";
43  attributes["height"] = "auto";
44  attributes["maxlength"] = "0";
45  return attributes;
46 }
47 
49 {
50  return new GUIInputController(node);
51 }
52 
GUI input element.
Definition: GUIInput.h:27
GUINodeController * createController(GUINode *node) override
Create controller which is attached to this node.
Definition: GUIInput.cpp:48
unordered_map< string, string > getAttributes(GUIScreenNode *screenNode) override
Get default attributes.
Definition: GUIInput.cpp:38
const string & getName() override
Definition: GUIInput.cpp:28
const string getTemplate(const string &applicationPathName, const string &applicationSubPathName, const string &fileName=string()) override
Retrieve template from given path name and optional file name.
Definition: GUIInput.cpp:33
static STATIC_DLL_IMPEXT string NAME
Definition: GUIInput.h:30
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:64
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
const string allocateNodeId()
Allocate node id.
File system singleton class.
Definition: FileSystem.h:17