TDME2  1.9.200
GUIInputInternalNode.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
6 #include <tdme/gui/fwd-tdme.h>
14 
15 using std::string;
16 
32 
33 /**
34  * GUI input internal node
35  * @author Andreas Drewke
36  */
38  : public GUINode
39 {
40  friend class tdme::gui::GUIParser;
41 
42 public:
43 
44  /**
45  * Create max length
46  * @param s s
47  * @return max length
48  */
49  static int createMaxLength(const string& s);
50 
51 private:
52  GUIFont* font { nullptr };
56  int maxLength;
57 
58 protected:
59  // forbid class copy
61 
62  /**
63  * Constructor
64  * @param screenNode screen node
65  * @param parentNode parent node
66  * @param id id
67  * @param flow flow
68  * @param alignments alignments
69  * @param requestedConstraints requested constraints
70  * @param backgroundColor background color
71  * @param backgroundImage background image
72  * @param backgroundImageScale9Grid background image scale 9 grid
73  * @param backgroundImageEffectColorMul background image effect color mul
74  * @param backgroundImageEffectColorAdd background image effect color add
75  * @param border border
76  * @param padding padding
77  * @param showOn show on
78  * @param hideOn hide on
79  * @param tooltip tooltip
80  * @param font font
81  * @param size font size
82  * @param color color
83  * @param colorDisabled color disabled
84  * @param text text
85  * @param maxLength max length
86  */
90  const string& id,
95  const string& backgroundImage,
99  const GUINode_Border& border,
100  const GUINode_Padding& padding,
101  const GUINodeConditions& showOn,
102  const GUINodeConditions& hideOn,
103  const string& tooltip,
104  const string& font,
105  int size,
106  const string& color,
107  const string& colorDisabled,
108  const MutableString& text,
109  int maxLength
110  );
111 
112  // overridden methods
113  const string getNodeType() override;
114  bool isContentNode() override;
115 
116 public:
117  // overridden methods
118  int getContentWidth() override;
119  int getContentHeight() override;
120  void dispose() override;
121  void render(GUIRenderer* guiRenderer) override;
122 
123  /**
124  * @return font
125  */
126  inline GUIFont* getFont() {
127  return font;
128  }
129 
130  /**
131  * @return text
132  */
133  inline MutableString& getText() {
134  return text;
135  }
136 
137  /**
138  * @return max length
139  */
140  inline int getMaxLength() {
141  return maxLength;
142  }
143 
144 };
GUI parser.
Definition: GUIParser.h:40
GUIInputInternalNode(GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn, const string &tooltip, const string &font, int size, const string &color, const string &colorDisabled, const MutableString &text, int maxLength)
Constructor.
static int createMaxLength(const string &s)
Create max length.
void render(GUIRenderer *guiRenderer) override
Render.
GUI element node conditions.
GUI node base class.
Definition: GUINode.h:64
GUINodeConditions hideOn
Definition: GUINode.h:162
GUIColor backgroundImageEffectColorMul
Definition: GUINode.h:157
GUINode_Border border
Definition: GUINode.h:160
GUINode_Scale9Grid backgroundImageScale9Grid
Definition: GUINode.h:156
GUIColor backgroundImageEffectColorAdd
Definition: GUINode.h:158
GUIParentNode * parentNode
Definition: GUINode.h:148
GUINode_Padding padding
Definition: GUINode.h:159
GUIScreenNode * screenNode
Definition: GUINode.h:147
GUINode_RequestedConstraints requestedConstraints
Definition: GUINode.h:151
GUINode_Alignments alignments
Definition: GUINode.h:150
GUINodeConditions showOn
Definition: GUINode.h:161
GUINode_Flow * flow
Definition: GUINode.h:86
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
GUI font class.
Definition: GUIFont.h:41
Mutable utf8 aware string class.
Definition: MutableString.h:23
std::exception Exception
Exception base class.
Definition: Exception.h:18
GUI node border entity.
GUI node padding entity.
GUI node scale 9 grid entity.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6