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