Changed some widget xml property names.

--HG--
branch : dev
This commit is contained in:
Martí­n Lucas Golini
2017-03-11 14:01:59 -03:00
parent 59cdda55d0
commit 1c77a512f9
8 changed files with 48 additions and 48 deletions

View File

@@ -1057,19 +1057,19 @@ void UIListBox::loadFromXmlNode(const pugi::xml_node & node) {
std::string name = ait->name();
String::toLowerInPlace( name );
if ( "row-height" == name || "rowheight" == name ) {
if ( "rowheight" == name ) {
setRowHeight( ait->as_int() );
} else if ( "font-color" == name ) {
} else if ( "textcolor" == name ) {
setFontColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-shadow-color" == name ) {
} else if ( "textshadowcolor" == name ) {
mFontStyleConfig.FontShadowColor = ( ColorA::fromString( ait->as_string() ) );
} else if ( "font-over-color" == name ) {
} else if ( "textovercolor" == name ) {
setFontOverColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-selected-color" == name ) {
} else if ( "textselectedcolor" == name ) {
setFontSelectedColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-selection-back-color" == name ) {
} else if ( "textselectionbackcolor" == name ) {
mFontStyleConfig.FontSelectionBackColor = ( ColorA::fromString( ait->as_string() ) );
} else if ( "font-name" == name ) {
} else if ( "fontfamily" == name || "fontname" == name ) {
Font * font = FontManager::instance()->getByName( ait->as_string() );
if ( NULL != font )
@@ -1077,27 +1077,27 @@ void UIListBox::loadFromXmlNode(const pugi::xml_node & node) {
} else if ( "padding" == name ) {
int val = ait->as_int();
setContainerPadding( Recti( val, val, val, val ) );
} else if ( "padding_left" == name ) {
} else if ( "paddingleft" == name ) {
setContainerPadding( Recti( ait->as_int(), mContainerPadding.Top, mContainerPadding.Right, mContainerPadding.Bottom ) );
} else if ( "padding_right" == name ) {
} else if ( "paddingright" == name ) {
setContainerPadding( Recti( mContainerPadding.Left, mContainerPadding.Top, ait->as_int(), mContainerPadding.Bottom ) );
} else if ( "padding_top" == name ) {
} else if ( "paddingtop" == name ) {
setContainerPadding( Recti( mContainerPadding.Left, ait->as_int(), mContainerPadding.Right, mContainerPadding.Bottom ) );
} else if ( "padding_bottom" == name ) {
} else if ( "paddingbottom" == name ) {
setContainerPadding( Recti( mContainerPadding.Left, mContainerPadding.Top, mContainerPadding.Right, ait->as_int() ) );
} else if ( "vertical-scroll-mode" == name || "vscroll-mode" == name ) {
} else if ( "verticalscrollmode" == name || "vscrollmode" == name ) {
std::string val = ait->as_string();
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );
else if ( "on" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_ON );
else if ( "off" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_OFF );
} else if ( "horizontal-scroll-mode" == name || "hscroll-mode" == name ) {
} else if ( "horizontalscrollmode" == name || "hscrollmode" == name ) {
std::string val = ait->as_string();
if ( "auto" == val ) setHorizontalScrollMode( UI_SCROLLBAR_AUTO );
else if ( "on" == val ) setHorizontalScrollMode( UI_SCROLLBAR_ALWAYS_ON );
else if ( "off" == val ) setHorizontalScrollMode( UI_SCROLLBAR_ALWAYS_OFF );
} else if ( "selected-index" == name || "selectedindex" == name ) {
} else if ( "selectedindex" == name ) {
setSelected( ait->as_uint() );
} else if ( "selected-text" == name || "selectedtext" == name ) {
} else if ( "selectedtext" == name ) {
setSelected( ait->as_string() );
}
}

View File

@@ -298,7 +298,7 @@ void UIPushButton::loadFromXmlNode(const pugi::xml_node & node) {
if ( "text" == name ) {
setText( ait->as_string() );
} else if ( "font-over-color" == name ) {
} else if ( "textovercolor" == name ) {
setFontOverColor( ColorA::fromString( ait->as_string() ) );
} else if ( "icon" == name ) {
std::string val = ait->as_string();

View File

@@ -174,7 +174,7 @@ void UISprite::loadFromXmlNode(const pugi::xml_node & node) {
std::string name = ait->name();
String::toLowerInPlace( name );
if ( "src" == name || "sprite" == name ) {
if ( "src" == name ) {
std::string val = ait->as_string();
if ( val.size() ) {

View File

@@ -445,14 +445,14 @@ void UITextEdit::loadFromXmlNode(const pugi::xml_node & node) {
if ( "text" == name ) {
setText( ait->as_string() );
} else if ( "allow-editing" == name ) {
} else if ( "allowediting" == name ) {
setAllowEditing( ait->as_bool() );
} else if ( "vertical-scroll-mode" == name || "vscroll-mode" == name ) {
} else if ( "verticalscrollmode" == name || "vscrollmode" == name ) {
std::string val = ait->as_string();
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );
else if ( "on" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_ON );
else if ( "off" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_OFF );
} else if ( "horizontal-scroll-mode" == name || "hscroll-mode" == name ) {
} else if ( "horizontalscrollmode" == name || "hscrollmode" == name ) {
std::string val = ait->as_string();
if ( "auto" == val ) setHorizontalScrollMode( UI_SCROLLBAR_AUTO );
else if ( "on" == val ) setHorizontalScrollMode( UI_SCROLLBAR_ALWAYS_ON );

View File

@@ -332,11 +332,11 @@ void UITextInput::loadFromXmlNode(const pugi::xml_node & node) {
if ( "text" == name ) {
setText( ait->as_string() );
} else if ( "allow-editing" == name ) {
} else if ( "allowediting" == name ) {
setAllowEditing( ait->as_bool() );
} else if ( "max-length" == name ) {
} else if ( "maxlength" == name ) {
setMaxLength( ait->as_uint() );
} else if ( "free-editing" == name ) {
} else if ( "freeediting" == name ) {
setFreeEditing( ait->as_bool() );
}
}

View File

@@ -402,17 +402,17 @@ void UITextView::loadFromXmlNode(const pugi::xml_node & node) {
if ( "text" == name ) {
setText( ait->as_string() );
} else if ( "font-color" == name ) {
} else if ( "textcolor" == name ) {
setFontColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-shadow-color" == name ) {
} else if ( "textshadowcolor" == name ) {
setFontShadowColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-over-color" == name ) {
} else if ( "textovercolor" == name ) {
mFontStyleConfig.FontOverColor = ColorA::fromString( ait->as_string() );
} else if ( "font-selected-color" == name ) {
} else if ( "textselectedcolor" == name ) {
mFontStyleConfig.FontSelectedColor = ColorA::fromString( ait->as_string() );
} else if ( "font-selection-back-color" == name ) {
} else if ( "textselectionbackcolor" == name ) {
setSelectionBackColor( ColorA::fromString( ait->as_string() ) );
} else if ( "font-name" == name ) {
} else if ( "fontfamily" == name || "fontname" == name ) {
Font * font = FontManager::instance()->getByName( ait->as_string() );
if ( NULL != font )
@@ -420,13 +420,13 @@ void UITextView::loadFromXmlNode(const pugi::xml_node & node) {
} else if ( "padding" == name ) {
int val = ait->as_int();
setPadding( Recti( val, val, val, val ) );
} else if ( "padding_left" == name ) {
} else if ( "paddingleft" == name ) {
setPadding( Recti( ait->as_int(), mPadding.Top, mPadding.Right, mPadding.Bottom ) );
} else if ( "padding_right" == name ) {
} else if ( "paddingright" == name ) {
setPadding( Recti( mPadding.Left, mPadding.Top, ait->as_int(), mPadding.Bottom ) );
} else if ( "padding_top" == name ) {
} else if ( "paddingtop" == name ) {
setPadding( Recti( mPadding.Left, ait->as_int(), mPadding.Right, mPadding.Bottom ) );
} else if ( "padding_bottom" == name ) {
} else if ( "paddingbottom" == name ) {
setPadding( Recti( mPadding.Left, mPadding.Top, mPadding.Right, ait->as_int() ) );
}
}

View File

@@ -355,11 +355,11 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) {
} else if ( "height" == name ) {
setInternalHeight( ait->as_int() );
notifyLayoutAttrChange();
} else if ( "background-color" == name ) {
} else if ( "backgroundcolor" == name ) {
setBackgroundFillEnabled( true )->setColor( ColorA::fromString( ait->as_string() ) );
} else if ( "border-color" == name ) {
} else if ( "bordercolor" == name ) {
setBorderEnabled( true )->setColor( ColorA::fromString( ait->as_string() ) );
} else if ( "border-width" == name ) {
} else if ( "borderwidth" == name ) {
setBorderEnabled( true )->setWidth( ait->as_uint(1) );
} else if ( "visible" == name ) {
setVisible( ait->as_bool() );
@@ -423,7 +423,7 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) {
} else if ( "auto_padding" == cur || "autopadding" == cur ) {
setFlags( UI_AUTO_PADDING );
notifyLayoutAttrChange();
} else if ( "report_size_change_to_childs" == cur ) {
} else if ( "reportsizechangetochilds" == cur || "report_size_change_to_childs" == cur ) {
setFlags( UI_REPORT_SIZE_CHANGE_TO_CHILDS );
}
}
@@ -431,13 +431,13 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) {
} else if ( "layout_margin" == name ) {
int val = ait->as_int();
setLayoutMargin( Recti( val, val, val, val ) );
} else if ( "layout_margin_left" == name ) {
} else if ( "layout_marginleft" == name ) {
setLayoutMargin( Recti( ait->as_int(), mLayoutMargin.Top, mLayoutMargin.Right, mLayoutMargin.Bottom ) );
} else if ( "layout_margin_right" == name ) {
} else if ( "layout_marginright" == name ) {
setLayoutMargin( Recti( mLayoutMargin.Left, mLayoutMargin.Top, ait->as_int(), mLayoutMargin.Bottom ) );
} else if ( "layout_margin_top" == name ) {
} else if ( "layout_margintop" == name ) {
setLayoutMargin( Recti( mLayoutMargin.Left, ait->as_int(), mLayoutMargin.Right, mLayoutMargin.Bottom ) );
} else if ( "layout_margin_bottom" == name ) {
} else if ( "layout_marginbottom" == name ) {
setLayoutMargin( Recti( mLayoutMargin.Left, mLayoutMargin.Top, mLayoutMargin.Right, ait->as_int() ) );
} else if ( "tooltip" == name ) {
setTooltipText( ait->as_string() );
@@ -495,12 +495,12 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) {
} else if ( "fixed" == val ) {
setLayoutHeightRules( FIXED );
}
} else if ( String::startsWith( name, "layout_to_" ) ) {
} else if ( String::startsWith( name, "layout_to_" ) || String::startsWith( name, "layoutto" ) ) {
LayoutPositionRules rule = NONE;
if ( "layout_to_left_of" == name ) rule = LEFT_OF;
else if ( "layout_to_right_of" == name ) rule = RIGHT_OF;
else if ( "layout_to_top_of" == name ) rule = TOP_OF;
else if ( "layout_to_bottom_of" == name ) rule = BOTTOM_OF;
if ( "layout_to_left_of" == name || "layouttoleftof" == name ) rule = LEFT_OF;
else if ( "layout_to_right_of" == name || "layouttorightof" == name ) rule = RIGHT_OF;
else if ( "layout_to_top_of" == name || "layouttotopof" == name ) rule = TOP_OF;
else if ( "layout_to_bottom_of" == name || "layouttobottomof" == name ) rule = BOTTOM_OF;
std::string id = ait->as_string();

View File

@@ -711,12 +711,12 @@ void EETest::createNewUI() {
UIManager::instance()->loadLayoutFromString(
"<window width='300' height='300' winflags='default|maximize'>"
" <LinearLayout id='testlayout' orientation='vertical' layout_width='match_parent' layout_height='match_parent' layout_margin='8'>"
" <TextView text='Hello World!' gravity='center' layout_gravity='center_horizontal' layout_width='match_parent' layout_height='wrap_content' background-color='000000FF' />"
" <TextView text='Hello World!' gravity='center' layout_gravity='center_horizontal' layout_width='match_parent' layout_height='wrap_content' backgroundColor='000000FF' />"
" <PushButton text='OK!' icon='ok' gravity='center' layout_gravity='center_horizontal' layout_width='match_parent' layout_height='wrap_content' />"
" <Image src='thecircle' layout_width='match_parent' layout_height='fixed' height='32' flags='clip' />"
" <Sprite src='gn' />"
" <TextInput text='test' layout_width='match_parent' layout_height='wrap_content' />"
" <DropDownList layout_width='match_parent' layout_height='wrap_content' selected-index='0'>"
" <DropDownList layout_width='match_parent' layout_height='wrap_content' selectedIndex='0'>"
" <item>Test Item</item>"
" <item>Test Item 2</item>"
" </DropDownList>"