duilb常用xml

2016/08/27 duilib 共 5068 字,约 15 分钟

参考:Duilib总结与心得 简书

Edit的边框两种设置方法

  • 设置背景图
    bkimage="res='search_bg.png' corner='6,6,6,6'"
    
  • 设置边框颜色
    bordersize="1" bkcolor="#FFFFFFFF" bordercolor="#FF4EA0D1"
    

Button背景图:

hotimage="res='button_hover.png' corner='6,6,6,6'" pushedimage="res='button_pushed' corner='6,6,6,6'"

duilib-combo

CComboUI  *m_cmbConverTo;

m_cmbConverTo = static_cast<CComboUI*>(m_PaintManager.FindControl(_T("cmbConverTo")));


pElementCtrl = new CListLabelElementUI; pElementCtrl->SetText(".MP4");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".3GP");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".MPG");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AVI");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WMV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".FLV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".SWF");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".TGA");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".MP3");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WMA");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AMR");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".OGG");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AAC");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WAV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
//根据配置设置文本
if ( g_config->nDownMode==1 ) {
	m_cmbConverTo->SelectItem(1);
}else{
	m_cmbConverTo->SelectItem(0);
}

导航栏与窗体

<!--导航栏-->
<HorizontalLayout height="113" bkcolor="#FF267FFC" bkcolor2="#FF0782FB">
    <HorizontalLayout width="920">
        <Option name="AdSafe1"  text="净网首页" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option1m.png' dest='36,36,76,76'"   hotimage="file='Option\Option1w.png' dest='36,36,76,76'" pushedimage="file='Option\Option1w.png' dest='36,36,76,76'" selectedimage="file='Option\Option1w.png' dest='36,36,76,76'" group="AdSafeOption" selected="true"/>
        <Option name="AdSafe2"  text="深度优化" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option2m.png' dest='36,36,76,76'"   hotimage="file='Option\Option2w.png' dest='36,36,76,76'" pushedimage="file='Option\Option2w.png' dest='36,36,76,76'" selectedimage="file='Option\Option2w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe3"  text="弹窗抓取" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option3m.png' dest='36,36,76,76'"   hotimage="file='Option\Option3w.png' dest='36,36,76,76'" pushedimage="file='Option\Option3w.png' dest='36,36,76,76'" selectedimage="file='Option\Option3w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe4"  text="拦截记录" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option4m.png' dest='36,36,76,76'"   hotimage="file='Option\Option4w.png' dest='36,36,76,76'" pushedimage="file='Option\Option4w.png' dest='36,36,76,76'" selectedimage="file='Option\Option4w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe5"  text="移动净网版" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option5m.png' dest='32,36,62,76'"   hotimage="file='Option\Option5w.png' dest='32,36,62,76'" pushedimage="file='Option\Option5w.png' dest='32,36,62,76'" selectedimage="file='Option\Option5w.png' dest='32,36,62,76'" group="AdSafeOption" />
    </HorizontalLayout>
    <HorizontalLayout />
</HorizontalLayout>
<!--窗体-->
<TabLayout name="AdSafeContent" bkcolor="#FFFFFFFF">
    <!-- <ChildLayout xmlfile="PageOne.xml" />
    <ChildLayout xmlfile="PageTwo.xml" />
    <ChildLayout xmlfile="PageThree.xml" />
    <ChildLayout xmlfile="PageFour.xml" />
    <ChildLayout xmlfile="PageFive.xml" /> -->
    <Include source="PageOne.xml" />
    <Include source="PageTwo.xml" />
    <Include source="PageThree.xml" />
    <Include source="PageFour.xml" /> 
    <Include source="PageFive.xml" />
</TabLayout>

文档信息

Search

    Table of Contents