TDME2  1.9.200
GUITableCellNode.cpp
Go to the documentation of this file.
2 
3 #include <set>
4 #include <string>
5 
6 #include <tdme/tdme.h>
11 
12 using std::set;
13 using std::string;
14 
19 
20 GUITableCellNode::GUITableCellNode(
21  GUIScreenNode* screenNode,
22  GUIParentNode* parentNode,
23  const string& id,
24  GUINode_Flow* flow,
25  GUIParentNode_Overflow* overflowX,
26  GUIParentNode_Overflow* overflowY,
27  const GUINode_Alignments& alignments,
28  const GUINode_RequestedConstraints& requestedConstraints,
29  const GUIColor& backgroundColor,
30  const string& backgroundImage,
31  const GUINode_Scale9Grid& backgroundImageScale9Grid,
32  const GUIColor& backgroundImageEffectColorMul,
33  const GUIColor& backgroundImageEffectColorAdd,
34  const GUINode_Border& border,
35  const GUINode_Padding& padding,
36  const GUINodeConditions& showOn,
37  const GUINodeConditions& hideOn,
38  const string& tooltip,
39  GUILayoutNode_Alignment* alignment
40 ) :
41  GUILayoutNode(screenNode, parentNode, id, flow, overflowX, overflowY, alignments, requestedConstraints, backgroundColor, backgroundImage, backgroundImageScale9Grid, backgroundImageEffectColorMul, backgroundImageEffectColorAdd, border, padding, showOn, hideOn, tooltip, alignment)
42 {
43 }
44 
46 {
47  return "table-cell";
48 }
49 
50 GUINode_RequestedConstraints GUITableCellNode::createRequestedConstraints(const string& left, const string& top, const string& width, const string& height, int factor)
51 {
52  GUINode_RequestedConstraints constraints;
54  constraints.left = getRequestedConstraintsValue(StringTools::trim(left), 0);
56  constraints.top = getRequestedConstraintsValue(StringTools::trim(top), 0);
58  constraints.width = getRequestedConstraintsValue(StringTools::trim(width), -1);
60  constraints.height = getRequestedConstraintsValue(StringTools::trim(height), -1);
61  if (constraints.leftType == GUINode_RequestedConstraints_RequestedConstraintsType::PIXEL) constraints.left*= factor;
62  if (constraints.topType == GUINode_RequestedConstraints_RequestedConstraintsType::PIXEL) constraints.top*= factor;
63  if (constraints.widthType == GUINode_RequestedConstraints_RequestedConstraintsType::PIXEL) constraints.width*= factor;
65  return constraints;
66 }
67 
GUI element node conditions.
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * TABLECELL
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * NONE
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * PIXEL
static GUINode_RequestedConstraints_RequestedConstraintsType * getRequestedConstraintsType(const string &constraint, GUINode_RequestedConstraints_RequestedConstraintsType *defaultConstraintsType)
Get requested constraints type.
Definition: GUINode.cpp:288
static int getRequestedConstraintsValue(const string &constraint, int defaultConstraintsValue)
Get requested constraints value.
Definition: GUINode.cpp:306
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
const string getNodeType() override
static GUINode_RequestedConstraints createRequestedConstraints(const string &left, const string &top, const string &width, const string &height, int factor)
Create requested constraints.
String tools class.
Definition: StringTools.h:22
GUI node border entity.
GUI node padding entity.
GUINode_RequestedConstraints_RequestedConstraintsType * topType
GUINode_RequestedConstraints_RequestedConstraintsType * widthType
GUINode_RequestedConstraints_RequestedConstraintsType * leftType
GUINode_RequestedConstraints_RequestedConstraintsType * heightType
GUI node scale 9 grid entity.