TDME2  1.9.200
GUIDropDown.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 #include <unordered_map>
5 
6 #include <tdme/tdme.h>
12 
14 
15 using std::string;
16 using std::unordered_map;
17 
23 
24 string GUIDropDown::NAME = "dropdown";
25 
26 GUIDropDown::GUIDropDown()
27 {
28 }
29 
30 const string& GUIDropDown::getName()
31 {
32  return NAME;
33 }
34 
35 const string GUIDropDown::getTemplate(const string& applicationPathName, const string& applicationSubPathName, const string& fileName)
36 {
37  return FileSystem::getInstance()->getContentAsString(applicationPathName + "/resources/" + applicationSubPathName + "/gui/definitions", fileName.empty() == true?"dropdown.xml":fileName);
38 }
39 
40 unordered_map<string, string> GUIDropDown::getAttributes(GUIScreenNode* screenNode)
41 {
42  unordered_map<string, string> attributes;
43  attributes["id"] = screenNode->allocateNodeId();
44  attributes["width"] = "100%";
45  attributes["height"] = "auto";
46  attributes["text"] = "10";
47  return attributes;
48 }
49 
51 {
52  return new GUIDropDownController(node);
53 }
54 
GUI drop down element.
Definition: GUIDropDown.h:27
GUINodeController * createController(GUINode *node) override
Create controller which is attached to this node.
Definition: GUIDropDown.cpp:50
unordered_map< string, string > getAttributes(GUIScreenNode *screenNode) override
Get default attributes.
Definition: GUIDropDown.cpp:40
const string & getName() override
Definition: GUIDropDown.cpp:30
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: GUIDropDown.cpp:35
static STATIC_DLL_IMPEXT string NAME
Definition: GUIDropDown.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