TDME2  1.9.200
GUIMenuHeaderItem.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 GUIMenuHeaderItem::NAME = "menu-header-item";
25 
26 GUIMenuHeaderItem::GUIMenuHeaderItem()
27 {
28 }
29 
31 {
32  return NAME;
33 }
34 
35 const string GUIMenuHeaderItem::getTemplate(const string& applicationPathName, const string& applicationSubPathName, const string& fileName)
36 {
37  return FileSystem::getInstance()->getContentAsString(applicationPathName + "/resources/" + applicationSubPathName + "/gui/definitions", fileName.empty() == true?"menu-header-item.xml":fileName);
38 }
39 
40 unordered_map<string, string> GUIMenuHeaderItem::getAttributes(GUIScreenNode* screenNode)
41 {
42  unordered_map<string, string> attributes;
43  attributes["id"] = screenNode->allocateNodeId();
44  attributes["text"] = "10";
45  return attributes;
46 }
47 
49 {
50  return new GUIMenuHeaderItemController(node);
51 }
52 
GUI menu header item element.
GUINodeController * createController(GUINode *node) override
Create controller which is attached to this node.
unordered_map< string, string > getAttributes(GUIScreenNode *screenNode) override
Get default attributes.
const string getTemplate(const string &applicationPathName, const string &applicationSubPathName, const string &fileName=string()) override
Retrieve template from given path name and optional file name.
static STATIC_DLL_IMPEXT string NAME
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