int height = pFont->getSize();
- pLayout->addControl( pText, Position( rData.m_xPos, rData.m_yPos,
- rData.m_xPos + rData.m_width,
- rData.m_yPos + height, *pLayout ),
- rData.m_layer );
+ // Compute the position of the control
+ const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
+ rData.m_xPos, rData.m_yPos,
+ rData.m_width, height,
+ *pLayout );
+
+ pLayout->addControl( pText, pos, rData.m_layer );
m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pText );
}
Button id:string xPos:int yPos:int leftTop:string rightBottom:string visible:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string
Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string visible:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string
Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:string bmpId:string actionId:string help:string layer:int windowId:string layoutId:string
-Text id:string xPos:int yPos:int visible:string fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string
+Text id:string xPos:int yPos:int visible:string fontId:string text:string width:int leftTop:string rightBottom:string color:uint32_t help:string layer:int windowId:string layoutId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string
List id:string xPos:int yPos:int visible:string width:int height:int leftTop:string rightBottom:string fontId:string var:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string
/// Type definition
struct Text
{
- Text( const string & id, int xPos, int yPos, const string & visible, const string & fontId, const string & text, int width, uint32_t color, const string & help, int layer, const string & windowId, const string & layoutId ):
-m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( fontId ), m_text( text ), m_width( width ), m_color( color ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
+ Text( const string & id, int xPos, int yPos, const string & visible, const string & fontId, const string & text, int width, const string & leftTop, const string & rightBottom, uint32_t color, const string & help, int layer, const string & windowId, const string & layoutId ):
+m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( fontId ), m_text( text ), m_width( width ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_color( color ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
int m_xPos;
const string m_fontId;
const string m_text;
int m_width;
+ const string m_leftTop;
+ const string m_rightBottom;
uint32_t m_color;
const string m_help;
int m_layer;
CheckDefault( "text", "" );
CheckDefault( "color", "#000000" );
CheckDefault( "width", "0" );
+ CheckDefault( "lefttop", "lefttop" );
+ CheckDefault( "rightbottom", "lefttop" );
CheckDefault( "help", "" );
const BuilderData::Text textData( uniqueId( attr["id"] ),
atoi( attr["x"] ) + m_xOffset, atoi( attr["y"] ) + m_yOffset,
attr["visible"], attr["font"],
attr["text"], atoi( attr["width"] ),
+ attr["lefttop"], attr["rightbottom"],
convertColor( attr["color"] ), attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
m_curLayer++;
visible CDATA "true"
x CDATA "0"
y CDATA "0"
+ width CDATA "0"
+ lefttop CDATA "lefttop"
+ rightbottom CDATA "lefttop"
text CDATA ""
font CDATA #REQUIRED
color CDATA "#000000"
- width CDATA "0"
help CDATA ""
>
<!ELEMENT Playlist (Slider)?>