基于duilib实现的可滑动tab标签控件

时间:2022-02-03 08:35:16

  最近一直在忙棋牌游戏大厅的开发,使用了duilib界面库,在大厅界面游戏菜单的展现上需要用到滑动的效果,类似悠扬棋牌,jj棋牌的菜单左右(上下)滑动的效果。通过自己的设计思路完善了一个可滑动的tab标签控件。效果如下:

基于duilib实现的可滑动tab标签控件

基于duilib实现的可滑动tab标签控件

控件实现部分

code:

UISliderTabLayout.h

 #ifndef __SLIDERTABLAYOUT_H__
#define __SLIDERTABLAYOUT_H__ #pragma once namespace DuiLib { class UILIB_API CSliderTabLayoutUI : public CTabLayoutUI
{
public:
CSliderTabLayoutUI(); LPCTSTR GetClass() const;
LPVOID GetInterface(LPCTSTR pstrName);
void DoEvent(TEventUI& event);
void OnTimer( int nTimerID ); bool SelectItem( int iIndex ); void OnSliderStep(); void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); protected:
int m_iCurFrame;
bool m_bIsVertical;
int m_nPositiveDirection; RECT m_rcCurPos;
RECT m_rcNextPos; CControlUI* m_pCurPage; // 保存当前显示的页面
CControlUI* m_pNextPage; // 保存下一页面 enum
{
TIMER_ANIMATION_ID = ,
ANIMATION_ELLAPSE = ,
ANIMATION_FRAME_COUNT =
};
}; class UILIB_API CSliderTabLayoutUI2 : public CTabLayoutUI
{
public:
CSliderTabLayoutUI2(); LPCTSTR GetClass() const;
LPVOID GetInterface(LPCTSTR pstrName);
void DoEvent(TEventUI& event);
void OnTimer( int nTimerID ); bool SelectItem( int iIndex ); void OnSliderStep(); void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); protected:
int m_iCurFrame;
bool m_bIsVertical;
int m_nPositiveDirection; RECT m_rcCurPos;
RECT m_rcNextPos;
RECT m_SldItem; CControlUI* m_pCurPage; // 保存当前显示的页面
CControlUI* m_pNextPage; // 保存下一页面
CHorizontalLayoutUI* m_pTabSlider;
CVerticalLayoutUI* m_pVTabSlider; enum
{
TIMER_ANIMATION_ID = ,
ANIMATION_ELLAPSE = ,
ANIMATION_FRAME_COUNT =
};
}; class UILIB_API CSliderTabLayoutUI3 : public CTabLayoutUI
{
public:
CSliderTabLayoutUI3(); LPCTSTR GetClass() const;
LPVOID GetInterface(LPCTSTR pstrName);
void DoEvent(TEventUI& event);
void OnTimer( int nTimerID ); void SetPos(RECT rc);
bool SelectItem( int iIndex ); void OnSliderStep(); void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); protected:
int m_iCurFrame;
bool m_bIsVertical;
int m_nPositiveDirection; bool m_bAnimating; RECT m_rcCurPos;
RECT m_rcNextPos; CControlUI* m_pCurPage; // 保存当前显示的页面
CControlUI* m_pNextPage; // 保存下一页面 enum
{
TIMER_ANIMATION_ID = ,
ANIMATION_ELLAPSE = ,
ANIMATION_FRAME_COUNT =
};
}; } // namespace DuiLib #endif // __UISlider_H__

UISliderTabLayout.cpp

 #include "StdAfx.h"
#include "UISliderTabLayout.h" namespace DuiLib { //////////////////////////////////////////////////////////////////////////
// CSliderTabLayoutUI
CSliderTabLayoutUI::CSliderTabLayoutUI() :
m_bIsVertical( false ),
m_iCurFrame( )
{
} LPCTSTR CSliderTabLayoutUI::GetClass() const
{
return _T("SliderTabLayoutUI");
} LPVOID CSliderTabLayoutUI::GetInterface(LPCTSTR pstrName)
{
if( _tcscmp(pstrName, _T("SliderTabLayoutUI")) == )
return static_cast<CSliderTabLayoutUI*>(this);
return CTabLayoutUI::GetInterface(pstrName);
} bool CSliderTabLayoutUI::SelectItem( int iIndex )
{
if( iIndex < || iIndex >= m_items.GetSize() ) return false;
if( iIndex == m_iCurSel ) return true;
if( iIndex > m_iCurSel ) m_nPositiveDirection = -;
if( iIndex < m_iCurSel ) m_nPositiveDirection = ; m_iCurFrame = ;
m_rcNextPos = m_rcCurPos = m_rcItem;
if( !m_bIsVertical ) //横向
{
m_rcNextPos.left = m_rcCurPos.left - (m_rcCurPos.right - m_rcCurPos.left) * m_nPositiveDirection;
m_rcNextPos.right = m_rcCurPos.right - (m_rcCurPos.right - m_rcCurPos.left) * m_nPositiveDirection;
}
else
{
m_rcNextPos.top = m_rcCurPos.top - (m_rcCurPos.bottom - m_rcCurPos.top) * m_nPositiveDirection;
m_rcNextPos.bottom = m_rcCurPos.bottom - (m_rcCurPos.bottom - m_rcCurPos.top) * m_nPositiveDirection;
} int iOldSel = m_iCurSel;
m_iCurSel = iIndex;
for( int it = ; it < m_items.GetSize(); it++ )
{
if( it == iIndex ) {
m_pNextPage = GetItemAt(it);
m_pNextPage->SetPos(m_rcNextPos);
m_pNextPage->SetVisible(true);
}
else if( it == iOldSel )
{
m_pCurPage = GetItemAt(it);
m_pCurPage->SetVisible(true);
}
else
GetItemAt(it)->SetVisible(false);
} m_pManager->SetTimer( this, TIMER_ANIMATION_ID, ANIMATION_ELLAPSE );
if( m_pManager != NULL ) {
//m_pManager->SetNextTabControl();
m_pManager->SendNotify(this, _T("tabselect"), m_iCurSel, iOldSel);
}
return true;
} void CSliderTabLayoutUI::DoEvent(TEventUI& event)
{
if( event.Type == UIEVENT_TIMER )
{
OnTimer( event.wParam );
}
else
CContainerUI::DoEvent(event);
//__super::DoEvent( event );
} void CSliderTabLayoutUI::OnTimer( int nTimerID )
{
OnSliderStep();
} void CSliderTabLayoutUI::OnSliderStep()
{
int iStepLen = ;
if( !m_bIsVertical ) //横向
{
iStepLen = ( m_rcItem.right - m_rcItem.left ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
//当前窗体位置
m_rcCurPos.left = m_rcCurPos.left + iStepLen;
m_rcCurPos.right = m_rcCurPos.right +iStepLen;
//下一个窗体位置
m_rcNextPos.left = m_rcNextPos.left + iStepLen;
m_rcNextPos.right = m_rcNextPos.right +iStepLen;
m_pCurPage->SetPos(m_rcCurPos);
m_pNextPage->SetPos(m_rcNextPos);
}
else
{
m_pCurPage->SetVisible(false);
m_pNextPage->SetPos(m_rcItem);
}
}
else //竖向
{
iStepLen = ( m_rcItem.bottom - m_rcItem.top ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
//当前窗体位置
m_rcCurPos.top = m_rcCurPos.top + iStepLen;
m_rcCurPos.bottom = m_rcCurPos.bottom +iStepLen;
//下一个窗体位置
m_rcNextPos.top = m_rcNextPos.top + iStepLen;
m_rcNextPos.bottom = m_rcNextPos.bottom +iStepLen;
m_pCurPage->SetPos(m_rcCurPos);
m_pNextPage->SetPos(m_rcNextPos);
}
else
{
m_pCurPage->SetVisible(false);
m_pNextPage->SetPos(m_rcItem);
}
} //NeedParentUpdate(); if( m_iCurFrame == ANIMATION_FRAME_COUNT )
{
NeedParentUpdate();
m_pManager->KillTimer( this, TIMER_ANIMATION_ID );
}
m_iCurFrame ++;
} void CSliderTabLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
if( _tcscmp(pstrName, _T("direction")) == && _tcscmp( pstrValue, _T("vertical")) == ) m_bIsVertical = true; // pstrValue = "vertical" or "horizontal"
return CTabLayoutUI::SetAttribute(pstrName, pstrValue);
} //////////////////////////////////////////////////////////////////////////
// CSliderTabLayoutUI2
CSliderTabLayoutUI2::CSliderTabLayoutUI2() :
m_bIsVertical( false ),
m_iCurFrame( )
{
} LPCTSTR CSliderTabLayoutUI2::GetClass() const
{
return _T("SliderTabLayoutUI2");
} LPVOID CSliderTabLayoutUI2::GetInterface(LPCTSTR pstrName)
{
if( _tcscmp(pstrName, _T("SliderTabLayoutUI2")) == )
return static_cast<CSliderTabLayoutUI2*>(this);
return CTabLayoutUI::GetInterface(pstrName);
} bool CSliderTabLayoutUI2::SelectItem( int iIndex )
{
if( iIndex < || iIndex >= m_items.GetSize() ) return false;
if( iIndex == m_iCurSel ) return true; m_iCurFrame = ; int iOldSel = m_iCurSel;
m_iCurSel = iIndex;
for( int it = ; it < m_items.GetSize(); it++ )
{
if( it == iIndex ) {
m_pNextPage = GetItemAt(it);
}
else if( it == iOldSel )
{
m_pCurPage = GetItemAt(it);
m_pCurPage->SetVisible(true);
}
else
GetItemAt(it)->SetVisible(false);
} if( !m_bIsVertical ) //横向
{
m_pTabSlider = new CHorizontalLayoutUI;
m_pTabSlider->ApplyAttributeList("bkcolor=\"#FFFFFFFF\"");
m_pTabSlider->SetFloat(true);
m_SldItem = m_rcItem;
if( m_iCurSel > iOldSel )
{
m_nPositiveDirection = -;
m_SldItem.left = m_rcItem.left;
m_SldItem.right = m_rcItem.left + (m_rcItem.right - m_rcItem.left) * ;
m_pTabSlider->SetPos(m_SldItem);
m_pTabSlider->SetVisible(true);
m_pTabSlider->Add(m_pCurPage);
m_pTabSlider->Add(m_pNextPage);
}
else
{
m_nPositiveDirection = ;
m_SldItem.left = m_rcItem.left - (m_rcItem.right - m_rcItem.left);
m_SldItem.right = m_rcItem.left + (m_rcItem.right - m_rcItem.left);;
m_pTabSlider->SetPos(m_SldItem);
m_pTabSlider->SetVisible(true);
m_pTabSlider->Add(m_pNextPage);
m_pTabSlider->Add(m_pCurPage);
}
}
else
{
m_pVTabSlider = new CVerticalLayoutUI;
m_pVTabSlider->SetFloat(true);
m_SldItem = m_rcItem;
if( m_iCurSel > iOldSel )
{
m_nPositiveDirection = -;
m_SldItem.top = m_rcItem.top;
m_SldItem.bottom = m_rcItem.bottom + (m_rcItem.bottom - m_rcItem.top);
m_pVTabSlider->SetPos(m_SldItem);
m_pVTabSlider->SetVisible(true);
m_pVTabSlider->Add(m_pCurPage);
m_pVTabSlider->Add(m_pNextPage);
}
else
{
m_nPositiveDirection = ;
m_SldItem.top = m_rcItem.top - (m_rcItem.bottom - m_rcItem.top);
m_SldItem.bottom = m_rcItem.bottom;
m_pVTabSlider->SetPos(m_SldItem);
m_pVTabSlider->SetVisible(true);
m_pVTabSlider->Add(m_pNextPage);
m_pVTabSlider->Add(m_pCurPage);
}
} RECT rcTmp = {};
m_pNextPage->SetPos(rcTmp);
m_pNextPage->SetFixedWidth();
m_pNextPage->SetFixedHeight();
m_pNextPage->SetVisible(true);
//m_pNextPage->NeedUpdate(); m_pManager->SetTimer( this, TIMER_ANIMATION_ID, ANIMATION_ELLAPSE );
if( m_pManager != NULL ) {
//m_pManager->SetNextTabControl();
m_pManager->SendNotify(this, _T("tabselect"), m_iCurSel, iOldSel);
}
return true;
} void CSliderTabLayoutUI2::DoEvent(TEventUI& event)
{
if( event.Type == UIEVENT_TIMER )
{
OnTimer( event.wParam );
}
else
CContainerUI::DoEvent(event);
//__super::DoEvent( event );
} void CSliderTabLayoutUI2::OnTimer( int nTimerID )
{
OnSliderStep();
} void CSliderTabLayoutUI2::OnSliderStep()
{ int iStepLen = ;
if( !m_bIsVertical ) //横向
{
iStepLen = ( m_rcItem.right - m_rcItem.left ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
m_SldItem.left = m_SldItem.left + iStepLen;
m_SldItem.right = m_SldItem.right +iStepLen;
m_pTabSlider->SetPos(m_SldItem);
}
else
{
m_pCurPage->SetVisible(false);
m_pNextPage->SetPos(m_rcItem);
m_pNextPage->SetFixedWidth(m_rcItem.right - m_rcItem.left);
m_pNextPage->SetFixedHeight(m_rcItem.bottom - m_rcItem.top);
}
}
else //竖向
{
iStepLen = ( m_rcItem.bottom - m_rcItem.top ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
m_SldItem.top = m_SldItem.top + iStepLen;
m_SldItem.bottom = m_SldItem.bottom +iStepLen;
m_pVTabSlider->SetPos(m_SldItem);
}
else
{
m_pCurPage->SetVisible(false);
m_pNextPage->SetPos(m_rcItem);
}
} if( m_iCurFrame == ANIMATION_FRAME_COUNT )
{
NeedParentUpdate();
m_pManager->KillTimer( this, TIMER_ANIMATION_ID );
}
m_iCurFrame ++;
} void CSliderTabLayoutUI2::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
if( _tcscmp(pstrName, _T("direction")) == && _tcscmp( pstrValue, _T("vertical")) == ) m_bIsVertical = true; // pstrValue = "vertical" or "horizontal"
return CTabLayoutUI::SetAttribute(pstrName, pstrValue);
} //////////////////////////////////////////////////////////////////////////
// CSliderTabLayoutUI3
CSliderTabLayoutUI3::CSliderTabLayoutUI3() :
m_bIsVertical( false ),
m_bAnimating(false),
m_iCurFrame( )
{
} LPCTSTR CSliderTabLayoutUI3::GetClass() const
{
return _T("SliderTabLayoutUI3");
} LPVOID CSliderTabLayoutUI3::GetInterface(LPCTSTR pstrName)
{
if( _tcscmp(pstrName, _T("SliderTabLayoutUI3")) == )
return static_cast<CSliderTabLayoutUI3*>(this);
return CTabLayoutUI::GetInterface(pstrName);
} bool CSliderTabLayoutUI3::SelectItem( int iIndex )
{
if( iIndex < || iIndex >= m_items.GetSize() ) return false;
if( iIndex == m_iCurSel ) return true;
if( iIndex > m_iCurSel ) m_nPositiveDirection = -;
if( iIndex < m_iCurSel ) m_nPositiveDirection = ; m_bAnimating = true;
m_iCurFrame = ; RECT rcInset = GetInset();
m_rcCurPos = GetPos(); m_rcCurPos.left += rcInset.left;
m_rcCurPos.top += rcInset.top;
m_rcCurPos.right -= rcInset.right;
m_rcCurPos.bottom -= rcInset.bottom; m_rcNextPos = m_rcCurPos; if( !m_bIsVertical ) //横向
{
m_rcNextPos.left = m_rcCurPos.left - (m_rcCurPos.right - m_rcCurPos.left) * m_nPositiveDirection;
m_rcNextPos.right = m_rcCurPos.right - (m_rcCurPos.right - m_rcCurPos.left) * m_nPositiveDirection;
}
else
{
m_rcNextPos.top = m_rcCurPos.top - (m_rcCurPos.bottom - m_rcCurPos.top) * m_nPositiveDirection;
m_rcNextPos.bottom = m_rcCurPos.bottom - (m_rcCurPos.bottom - m_rcCurPos.top) * m_nPositiveDirection;
} int iOldSel = m_iCurSel;
m_iCurSel = iIndex;
for( int it = ; it < m_items.GetSize(); it++ )
{
if( it == iIndex ) {
m_pNextPage = GetItemAt(it);
m_pNextPage->SetPos(m_rcNextPos);
m_pNextPage->SetVisible(true);
}
else if( it == iOldSel )
{
m_pCurPage = GetItemAt(it);
m_pCurPage->SetVisible(true);
}
else
GetItemAt(it)->SetVisible(false);
} m_pManager->SetTimer( this, TIMER_ANIMATION_ID, ANIMATION_ELLAPSE );
if( m_pManager != NULL ) {
//m_pManager->SetNextTabControl();
m_pManager->SendNotify(this, _T("tabselect"), m_iCurSel, iOldSel);
}
return true;
} void CSliderTabLayoutUI3::DoEvent(TEventUI& event)
{
if( event.Type == UIEVENT_TIMER )
{
OnTimer( event.wParam );
}
else
CContainerUI::DoEvent(event);
} void CSliderTabLayoutUI3::OnTimer( int nTimerID )
{
NeedParentUpdate();
} void CSliderTabLayoutUI3::SetPos(RECT rc)
{
CControlUI::SetPos(rc); RECT rcInset = GetInset();
rc.left += rcInset.left;
rc.top += rcInset.top;
rc.right -= rcInset.right;
rc.bottom -= rcInset.bottom; if(m_bAnimating)
{
int iStepLen = ;
if( !m_bIsVertical ) //横向
{
iStepLen = ( rc.right - rc.left ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
//当前窗体位置
::OffsetRect(&m_rcCurPos,iStepLen,);
m_pCurPage->SetPos(m_rcCurPos);
//下一个窗体位置
::OffsetRect(&m_rcNextPos,iStepLen,);
m_pNextPage->SetPos(m_rcNextPos);
}
else
{
m_pCurPage->SetVisible(false);
::OffsetRect(&m_rcCurPos,iStepLen,);
m_pCurPage->SetPos(m_rcCurPos);
m_pNextPage->SetPos(rc);
}
}
else //竖向
{
iStepLen = ( rc.bottom - rc.top ) * m_nPositiveDirection / ANIMATION_FRAME_COUNT;
if( m_iCurFrame != ANIMATION_FRAME_COUNT )
{
//当前窗体位置
::OffsetRect(&m_rcCurPos,,iStepLen);
m_pCurPage->SetPos(m_rcCurPos);
//下一个窗体位置
::OffsetRect(&m_rcNextPos,,iStepLen);
m_pNextPage->SetPos(m_rcNextPos);
}
else
{
m_pCurPage->SetVisible(false);
::OffsetRect(&m_rcCurPos,,iStepLen);
m_pCurPage->SetPos(m_rcCurPos);
m_pNextPage->SetPos(rc);
}
}
if( m_iCurFrame == ANIMATION_FRAME_COUNT )
{
m_iCurFrame = ;
m_bAnimating = false;
m_pManager->KillTimer( this, TIMER_ANIMATION_ID );
}
m_iCurFrame ++;
}
else
{
for (int it = ; it < GetCount(); it++) {
CControlUI* pControl = GetItemAt(it);
if (!pControl->IsVisible()) continue;
if (pControl->IsFloat()) {
SetFloatPos(it);
continue;
} if (it != GetCurSel()) continue; RECT rcPadding = pControl->GetPadding();
rc.left += rcPadding.left;
rc.top += rcPadding.top;
rc.right -= rcPadding.right;
rc.bottom -= rcPadding.bottom; SIZE szAvailable = { rc.right - rc.left, rc.bottom - rc.top }; SIZE sz = pControl->EstimateSize(szAvailable);
if (sz.cx == ) {
sz.cx = MAX(, szAvailable.cx);
}
if (sz.cx < pControl->GetMinWidth()) sz.cx = pControl->GetMinWidth();
if (sz.cx > pControl->GetMaxWidth()) sz.cx = pControl->GetMaxWidth(); if (sz.cy == ) {
sz.cy = MAX(, szAvailable.cy);
}
if (sz.cy < pControl->GetMinHeight()) sz.cy = pControl->GetMinHeight();
if (sz.cy > pControl->GetMaxHeight()) sz.cy = pControl->GetMaxHeight(); RECT rcCtrl = {rc.left, rc.top, rc.left + sz.cx, rc.top + sz.cy};
pControl->SetPos(rcCtrl);
}
}
} void CSliderTabLayoutUI3::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
if( _tcscmp(pstrName, _T("direction")) == && _tcscmp( pstrValue, _T("vertical")) == ) m_bIsVertical = true; // pstrValue = "vertical" or "horizontal"
return CTabLayoutUI::SetAttribute(pstrName, pstrValue);
}
} // namespace DuiLib

xml部分

           <SliderTabLayout3 name="TAY_1" direction="vertical">
<!--基本资料-->
<VerticalLayout>
<HorizontalLayout width="458" height="29">
<Label text="基本资料" float="true" pos="13,0,0,0" width="105" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="0"/>
</HorizontalLayout>
<VerticalLayout width="458" height="339" bkimage="file='bk_bxg_right.png' corner='5,5,5,5'">
<Label text="昵称:" float="true" pos="38,14,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label name="LBL_VIP" text="" float="true" pos="96,64,0,0" width="25" height="12" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA"/>
<Edit name="TXT_NC" float="true" pos="94,17,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="18" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Button name="BTN_JBZL_SAVE" float="true" pos="172,291,0,0" width="115" height="36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='bt_45.png' source='0,0,115,36'" hotimage="file='bt_45.png' source='115,0,230,36'" pushedimage="file='bt_45.png' source='230,0,345,36'"/>
<Label text="VIP:" float="true" pos="38,54,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label text="等级:" float="true" pos="233,93,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right" />
<Label name="LBL_DJ" float="true" pos="291,93,0,0" width="131" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" />
<Label text="金币:" float="true" pos="38,92,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label name="LBL_JB" text="" float="true" pos="96,92,0,0" width="131" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA"/>
<Label text="幸运豆:" float="true" pos="234,131,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right" />
<Label name="LBL_XYD" float="true" pos="292,131,0,0" width="131" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" />
<Label text="奖券:" float="true" pos="38,131,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label name="LBL_JQ" text="" float="true" pos="96,131,0,0" width="131" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA"/>
<Label text="性别:" float="true" pos="39,169,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label text="生日:" float="true" pos="39,207,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label text="Email:" float="true" pos="39,246,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label text="年龄:" float="true" pos="239,207,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Label text="QQ:" float="true" pos="239,246,0,0" width="50" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_EMAIL" text="" float="true" pos="98,248,0,0" width="136" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" maxchar="50" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Combo name="CMB_SR_1" float="true" pos="97,210,0,0" droptype="droplist" width="50" height="22" textpadding="4,1,1,1" normalimage="file='cmb.png' source='0,0,100,22' corner='2,2,20,2'" hotimage="file='cmb.png' source='0,22,100,44' corner='2,2,22,2'" pushedimage="file='cmb.png' source='0,44,100,66' corner='2,2,22,2'" vscrollbar="true" vscrollbarstyle="width=&quot;6&quot; showbutton1=&quot;false&quot; showbutton2=&quot;false&quot;"/>
<Label text="月" float="true" pos="145,213,0,0" width="15" height="15" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Combo name="CMB_SR_2" float="true" pos="160,210,0,0" droptype="droplist" width="45" height="22" textpadding="4,1,1,1" normalimage="file='cmb.png' source='0,0,100,22' corner='2,2,20,2'" hotimage="file='cmb.png' source='0,22,100,44' corner='2,2,22,2'" pushedimage="file='cmb.png' source='0,44,100,66' corner='2,2,22,2'"/>
<Label text="日" float="true" pos="204,213,0,0" width="15" height="15" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_QQ" text="" float="true" pos="291,248,0,0" width="127" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" maxchar="32" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Combo name="CMB_NL" float="true" pos="295,210,0,0" droptype="droplist" width="50" height="22" textpadding="4,1,1,1" normalimage="file='cmb.png' source='0,0,100,22' corner='2,2,20,2'" hotimage="file='cmb.png' source='0,22,100,44' corner='2,2,22,2'" pushedimage="file='cmb.png' source='0,44,100,66' corner='2,2,22,2'"/>
<Option name="OPN_BOY" text="男" float="true" pos="99,170,0,0" width="60" height="30" textpadding="5,0,0,0" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='chk_1.png' dest='5,5,20,20'" hotimage="file='chk_2.png' dest='5,5,20,20'" group="sex" selected="true" selectedimage="file='chk_3.png' dest='5,5,20,20'"/>
<Option name="OPN_GIRL" text="女" float="true" pos="161,170,0,0" width="60" height="30" textpadding="5,0,0,0" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='chk_1.png' dest='5,5,20,20'" hotimage="file='chk_2.png' dest='5,5,20,20'" group="sex" selectedimage="file='chk_3.png' dest='5,5,20,20'"/>
<Label name="LBL_JBZL_ERROR" text="" float="true" pos="100,278,0,0" width="260" height="18" textcolor="#00FF0000" disabledtextcolor="#FFA7A6AA"/>
<Button name="BTN_FACE" float="true" pos="337,16,0,0" width="62" height="60" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" bkimage="file=&apos;face\default.png&apos; dest=&apos;2,2,60,58&apos;" />
<Button name="BTN_CHANGEFACE" text="{a}更新头像{/a}" float="true" pos="338,76,0,0" width="60" height="24" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" showhtml="true" align="center" />
</VerticalLayout>
</VerticalLayout>
<!--详细资料-->
<VerticalLayout>
<HorizontalLayout width="458" height="29">
<Label text="详细资料" float="true" pos="13,0,0,0" width="105" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="0"/>
</HorizontalLayout>
<VerticalLayout width="458" height="339" bkimage="file='bk_bxg_right.png' corner='5,5,5,5'">
<Label text="真实姓名:" float="true" pos="62,40,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_ZSXM" float="true" pos="146,42,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Button name="BTN_XXZL_SAVE" float="true" pos="174,235,0,0" width="115" height="36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='bt_45.png' source='0,0,115,36'" hotimage="file='bt_45.png' source='115,0,230,36'" pushedimage="file='bt_45.png' source='230,0,345,36'"/>
<Label text="身份证号:" float="true" pos="62,73,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_SFZH" float="true" pos="146,75,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="18" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="手机号码:" float="true" pos="62,106,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_SJHM" float="true" pos="146,108,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="12" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="固定电话:" float="true" pos="62,140,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_GDDH" float="true" pos="146,142,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="地 址:" float="true" pos="62,173,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_DZ" float="true" pos="146,175,0,0" width="272" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="50" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Text text="注:请您填写真实信息,因资料填写错误造成奖品无法投递的情况,6513游戏中心将不承担责任。" float="true" pos="64,279,0,0" width="333" height="36" textpadding="2,0,2,0" textcolor="#00FF0000" disabledtextcolor="#FFA7A6AA" align="wrap"/>
<Label name="LBL_XXZL_ERROR" float="true" pos="147,202,0,0" width="198" height="30" textcolor="#00FF0000" disabledtextcolor="#FFA7A6AA"/>
</VerticalLayout>
</VerticalLayout>
<!--密码修改-->
<VerticalLayout>
<HorizontalLayout width="458" height="29">
<Label text="登录密码修改" float="true" pos="13,0,0,0" width="159" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="0"/>
</HorizontalLayout>
<VerticalLayout width="458" height="154" bkimage="file='bk_bxg_right.png' corner='5,5,5,5'">
<Label text="旧密码:" float="true" pos="63,4,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_MM_JMM" password="true" float="true" pos="147,4,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="新密码:" float="true" pos="63,33,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_MM_XMM" password="true" float="true" pos="147,33,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="确认密码:" float="true" pos="63,65,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_MM_QRMM" password="true" float="true" pos="147,65,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Button name="BTN_MMXG_MM_SAVE" float="true" pos="172,107,0,0" width="115" height="36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='bt_45.png' source='0,0,115,36'" hotimage="file='bt_45.png' source='115,0,230,36'" pushedimage="file='bt_45.png' source='230,0,345,36'"/>
<Label name="LBL_MM_ERROR" float="true" pos="148,94,0,0" width="203" height="17" textcolor="#00FF0000" disabledtextcolor="#FFA7A6AA"/>
</VerticalLayout>
<HorizontalLayout width="458" height="29">
<Label text="保险箱密码修改" float="true" pos="13,0,0,0" width="159" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="0"/>
</HorizontalLayout>
<VerticalLayout width="458" height="154" bkimage="file='bk_bxg_right.png' corner='5,5,5,5'">
<Label text="旧密码:" float="true" pos="63,5,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_BXG_JMM" password="true" float="true" pos="147,5,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="新密码:" float="true" pos="63,33,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_BXG_XMM" password="true" float="true" pos="147,33,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Label text="确认密码:" float="true" pos="63,64,0,0" width="82" height="30" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="right"/>
<Edit name="TXT_BXG_QRMM" password="true" float="true" pos="147,64,0,0" width="181" height="25" bkcolor="#00000000" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" font="1" maxchar="16" normalimage="file='txt_1.png' source='0,0,33,34' corner='5,5,5,5'" hotimage="file='txt_1.png' source='33,0,66,34' corner='5,5,5,5'" focusedimage="file='txt_1.png' source='66,0,99,34' corner='5,5,5,5'"/>
<Button name="BTN_MMXG_BXX_SAVE" float="true" pos="172,107,0,0" width="115" height="36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='bt_45.png' source='0,0,115,36'" hotimage="file='bt_45.png' source='115,0,230,36'" pushedimage="file='bt_45.png' source='230,0,345,36'"/>
<Label name="LBL_BXG_ERROR" float="true" pos="148,94,0,0" width="203" height="17" textcolor="#00FF0000" disabledtextcolor="#FFA7A6AA"/>
</VerticalLayout>
</VerticalLayout>
</SliderTabLayout3>

代码实现部分当初用了三种方式实现滑动效果,但最理想的还是CSliderTabLayoutUI3实现。不知大家有没有更好的实现思路,可一起交流交流。

基于duilib实现的可滑动tab标签控件的更多相关文章

  1. VS2010&sol;MFC编程入门之三十三(常用控件:标签控件Tab Control 下)

    上一节中鸡啄米讲了标签控件知识的上半部分,本节继续讲下半部分. 标签控件的创建 MFC为标签控件的操作提供了CTabCtrl类. 与之前的控件类似,创建标签控件可以在对话框模板中直接拖入Tab Con ...

  2. (八)树控件&lpar;Tree Control&rpar;,标签控件&lpar;tab control&rpar;

    树控件 基于对话框创建工程 // 01_TreeCtrlDlg.cpp : 实现文件 // #include "stdafx.h" #include "01_TreeCt ...

  3. VS2010-MFC(常用控件:标签控件Tab Control 下)

    转自:http://www.jizhuomi.com/software/207.html 上一节讲了标签控件知识的上半部分,本节继续讲下半部分. 标签控件的创建 MFC为标签控件的操作提供了CTabC ...

  4. VS2010&sol;MFC编程入门之三十二(常用控件:标签控件Tab Control 上)

    前面两节鸡啄米讲了树形控件Tree Control,本节开始讲解标签控件Tab Control,也可以称为选项卡控件. 标签控件简介 标签控件也比较常见.它可以把多个页面集成到一个窗口中,每个页面对应 ...

  5. VS2010-MFC(常用控件:标签控件Tab Control 上)

    转自:http://www.jizhuomi.com/software/205.html 前面两节讲了树形控件Tree Control,本节开始讲解标签控件Tab Control,也可以称为选项卡控件 ...

  6. 在VC&plus;&plus;中使用Tab Control控件

    系统环境:Windows 7软件环境:Visual Studio 2008 SP1本次目的:在模态或非模态对话框中使用Tab Control控件,及引申在单/多文档中使用 查阅MSDN文档,对于创建T ...

  7. C&plus;&plus; MFC Tab Control控件的详细使用

    1. 新建一个MFC工程, 取名MyTab, 选择Dialog based, 然后Finish. 2. 删除对话框上默认添加的三个控件. 添加Tab Control控件并在Property属性中设置I ...

  8. 通过编写串口助手工具学习MFC过程——(七)添加Tab Control控件

    通过编写串口助手工具学习MFC过程 因为以前也做过几次MFC的编程,每次都是项目完成时,MFC基本操作清楚了,但是过好长时间不再接触MFC的项目,再次做MFC的项目时,又要从头开始熟悉.这次通过做一个 ...

  9. 基于Jquery WeUI的微信开发H5页面控件的经验总结&lpar;2&rpar;

    在微信开发H5页面的时候,往往借助于WeUI或者Jquery WeUI等基础上进行界面效果的开发,由于本人喜欢在Asp.net的Web界面上使用JQuery,因此比较倾向于使用 jQuery WeUI ...

随机推荐

  1. 20145318 GDB调试汇编堆栈分析

    20145318 GDB调试汇编堆栈分析 代码 #include<stdio.h> short addend1 = 1; static int addend2 = 2; const sta ...

  2. Android BaseAdapter的使用

    数据适配器有很多种,今天在这里记录一下最通用是适配器BaseAdapter. 首先说一下什么是适配器,这里我从网上找到一幅图片 由上图我们不难看出,所谓的适配器,就是数据与视图之间的桥梁.由它把数据绑 ...

  3. excel导入数据库iis设置

    导入成功以后,基本这个小项目的所有功能都开发完成了,请IT部门帮我设定了一个固定IP,我以本机作为服务器,在本机IIS上发布了一个测试版,结果上传Excel数据报错, 错误信息“未在本地计算机上注册“ ...

  4. Monthly Expense&lpar;二分&rpar;

    Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 11196   Accepted: 4587 Description Farm ...

  5. 11gR2 Database Services for &amp&semi;quot&semi;Policy&amp&semi;quot&semi; and &amp&semi;quot&semi;Administrator&amp&semi;quot&semi; Managed Databases &lpar;文件 ID 1481647&period;1&rpar;

    In this Document   _afrLoop=1459311711568804&id=1481647.1&displayIndex=6&_afrWindowMode= ...

  6. 把xml数据直接插入到sqlserver数据库

    存储过程: ALTER proc [ali].[ins_冻结金额表] @xmldoc varchar(max), ) as declare @idoc int exec sp_xml_prepared ...

  7. google 身份验证器

    谷歌身份验证器原理 就是服务器与客户端算法相同

  8. C&num;操作数据表中XML格式的数据

    以前还真没有见过数据表中存储XML格式的数据,刚开始听说的时候,还以为是数据表中有XML的字段类型, 再了解,其实也就是字符串类型的,只不过字符串的格式是XML格式的.确实孤陋寡闻!汗... (可添加 ...

  9. LINUX修改、增加IP的方法&comma;一张网卡绑定多个IP&sol;漂移IP【转】

    临时增加IP命令:ifconfig eth0:1 ip地址 netmask 子网码 broadcast 广播地址 gateway 网关  ifconfig eth0:1 10.1.104.65 net ...

  10. 图解Java常用数据结构&lpar;一&rpar;

    最近在整理数据结构方面的知识, 系统化看了下Java中常用数据结构, 突发奇想用动画来绘制数据流转过程. 主要基于jdk8, 可能会有些特性与jdk7之前不相同, 例如LinkedList Linke ...