Skip to content

Commit

Permalink
1、修正xml中\n解析不正确的问题:使用{\n}来代替\n
Browse files Browse the repository at this point in the history
  • Loading branch information
qdtroy committed Mar 15, 2018
1 parent 9db4727 commit ddd5983
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions DuiLib/Core/UIControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ namespace DuiLib {
if( m_sText == pstrText ) return;

m_sText = pstrText;
// 解析xml换行符
m_sText.Replace(_T("{\\n}"), _T("\n"));
Invalidate();
}

Expand Down
2 changes: 1 addition & 1 deletion bin/skin/duidemo/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<Label text="Label演示" cursor="hand" textcolor="#FF000000" glowsize="0" font="font13" width="80"/>
<HorizontalLayout height="45" childpadding="12">
<Label text="Label标签控件自动换行测试" width="60" align="left" wordbreak="true" textcolor="#FFFF0000" />
<Button text="Button按钮控件自动换行测试" width="60" align="left" wordbreak="true" textcolor="#FF000000" textpadding="6,0,6,0" style="colorbtn_style"/>
<Button text="Button按钮{\n}控件自动换行测试" width="60" align="left" wordbreak="true" textcolor="#FF000000" textpadding="6,0,6,0" style="colorbtn_style"/>
<GroupBox text="Group控件" width="200" bkcolor="#FF666666" textcolor="#FF000000" bordercolor="#FF111111" bordersize="1" borderround="6,6"/>
</HorizontalLayout>
</HorizontalLayout>
Expand Down
2 changes: 1 addition & 1 deletion bin/skin/xlgamebox/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<VerticalLayout bkimage="file='mainwnd/mainbg.png' corner='2,2,2,2'" inset="1,1,1,1" bordercolor="#EE768D9B" bordersize="1" borderround="5,5" >
<HorizontalLayout name="sysbar" height="40">
<HorizontalLayout name="userbar" width="170" inset="78,10">
<Button name="login_btn" width="78" height="16" font="1" text="请先登录" textstyle="top,left" textcolor="#FFFFFFFF"/>
<Button name="login_btn" bkimage="file='button.png' corner='4,4,4,4'" width="78" height="16" font="1" text="请先登录" textstyle="top,left" textcolor="#FFFFFFFF"/>
</HorizontalLayout>

<HorizontalLayout name="main_tabbar" inset="0,10" childpadding="-20">
Expand Down

0 comments on commit ddd5983

Please sign in to comment.