TDME2  1.9.200
GUIProgressBar.cpp
Go to the documentation of this file.
2 
3 #include <tdme/tdme.h>
4 #include <string>
10 #include <unordered_map>
11 
12 using std::string;
13 using std::unordered_map;
14 
21 
22 string GUIProgressBar::NAME = "progress-bar";
23 
24 GUIProgressBar::GUIProgressBar()
25 {
26 }
27 
28 const string& GUIProgressBar::getName()
29 {
30  return NAME;
31 }
32 
33 const string GUIProgressBar::getTemplate(const string& applicationPathName, const string& applicationSubPathName, const string& fileName)
34 {
35  return FileSystem::getInstance()->getContentAsString(applicationPathName + "/resources/" + applicationSubPathName + "/gui/definitions", fileName.empty() == true?"progressbar.xml":fileName);
36 }
37 
38 unordered_map<string, string> GUIProgressBar::getAttributes(GUIScreenNode* screenNode)
39 {
40  unordered_map<string, string> attributes;
41  attributes["id"] = screenNode->allocateNodeId();
42  attributes["disabled"] = "false";
43  attributes["value"] = "0.0";
44  attributes["width"] = "223"; // TODO: a.drewke
45  return attributes;
46 }
47 
49 {
50  return new GUIProgressBarController(node);
51 }
52 
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 & getName() override
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