new layout system, new UI state/styles system

This commit is contained in:
Eduardo Bart
2011-08-26 12:06:52 -03:00
parent d31d32bf82
commit 7359370251
57 changed files with 1097 additions and 1099 deletions

View File

@@ -9,7 +9,7 @@ typedef uint32 RGBA;
class Color
{
public:
Color() : color(0xFFFFFFFF) { }
Color() : color(0x0) { }
Color(uint8 r, uint8 g, uint8 b, uint8 a = 0xFF) : color(((a & 0xff)<<24) | ((b & 0xff)<<16) | ((g & 0xff)<<8) | (r & 0xff)) { }
Color(const Color& other) : color(other.color) { }
Color(RGBA rgba) : color(rgba) { }

View File

@@ -21,23 +21,26 @@ AlignmentFlag fw::translateAlignment(std::string aligment)
return AlignTopCenter;
else if(aligment == "bottom")
return AlignBottomCenter;
else
else if(aligment == "center")
return AlignCenter;
return AlignNone;
}
AnchorEdge fw::translateAnchorEdge(const std::string& anchorPoint)
AnchorEdge fw::translateAnchorEdge(std::string anchorEdge)
{
if(anchorPoint == "left")
boost::to_lower(anchorEdge);
boost::erase_all(anchorEdge, " ");
if(anchorEdge == "left")
return AnchorLeft;
else if(anchorPoint == "right")
else if(anchorEdge == "right")
return AnchorRight;
else if(anchorPoint == "top")
else if(anchorEdge == "top")
return AnchorTop;
else if(anchorPoint == "bottom")
else if(anchorEdge == "bottom")
return AnchorBottom;
else if(anchorPoint == "horizontalCenter")
else if(anchorEdge == "horizontalcenter")
return AnchorHorizontalCenter;
else if(anchorPoint == "verticalCenter")
else if(anchorEdge == "verticalcenter")
return AnchorVerticalCenter;
return AnchorNone;
}

View File

@@ -7,7 +7,7 @@
namespace fw {
AlignmentFlag translateAlignment(std::string aligment);
AnchorEdge translateAnchorEdge(const std::string& anchorPoint);
AnchorEdge translateAnchorEdge(std::string anchorEdge);
};