本文整理汇总了C++中CContainerUI::GetInset方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::GetInset方法的具体用法?C++ CContainerUI::GetInset怎么用?C++ CContainerUI::GetInset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::GetInset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Invalidate
//************************************
// 函数名称: Invalidate
// 返回类型: void
// 函数说明:
//************************************
void CTreeNodeUI::Invalidate()
{
if( !IsVisible() )
return;
if( GetParent() ) {
CContainerUI* pParentContainer = static_cast<CContainerUI*>(GetParent()->GetInterface(_T("Container")));
if( pParentContainer ) {
RECT rc = pParentContainer->GetPos();
RECT rcInset = pParentContainer->GetInset();
rc.left += rcInset.left;
rc.top += rcInset.top;
rc.right -= rcInset.right;
rc.bottom -= rcInset.bottom;
CScrollBarUI* pVerticalScrollBar = pParentContainer->GetVerticalScrollBar();
if( pVerticalScrollBar && pVerticalScrollBar->IsVisible() ) rc.right -= pVerticalScrollBar->GetFixedWidth();
CScrollBarUI* pHorizontalScrollBar = pParentContainer->GetHorizontalScrollBar();
if( pHorizontalScrollBar && pHorizontalScrollBar->IsVisible() ) rc.bottom -= pHorizontalScrollBar->GetFixedHeight();
RECT invalidateRc = m_rcItem;
if( !::IntersectRect(&invalidateRc, &m_rcItem, &rc) )
return;
CControlUI* pParent = GetParent();
RECT rcTemp;
RECT rcParent;
while( pParent = pParent->GetParent() )
{
rcTemp = invalidateRc;
rcParent = pParent->GetPos();
if( !::IntersectRect(&invalidateRc, &rcTemp, &rcParent) )
return;
}
if( m_pManager != NULL ) m_pManager->Invalidate(invalidateRc);
}
else {
CContainerUI::Invalidate();
}
}
else {
CContainerUI::Invalidate();
}
}
示例2: DuiMessageBox
UINT CMessageDialog::DuiMessageBox(CFrameWnd *pMainWnd, LPCTSTR lpText, LPCTSTR lpCaption ,UINT uType, UINT uIcon)
{
m_pMainWnd = pMainWnd;
m_strXMLPath = _T("xmls\\MessageBoxDialog.xml");
Create(m_pMainWnd->GetHWND(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
if ( uType == MB_OK)
{
if ( m_pButtonCancel != NULL )
{
m_pButtonCancel->SetVisible(false);
}
}
else if( uType == MB_OKCANCEL )
{
//保持默认xml配置
}
else
return 0;
CContainerUI* pTextLayout = static_cast<CContainerUI*>(m_pm.FindControl(_T("TextLayout")));
if (pTextLayout != NULL)
{
switch(uIcon)
{
case MB_ICONASTERISK:
{
pTextLayout->SetBkImage(_T("file='UI\\MessageDialog\\BK.png' source='222,0,333,120' corner='111,0,0,0'"));
break;
}
case MB_ICONQUESTION:
{
pTextLayout->SetBkImage(_T("file='UI\\MessageDialog\\BK.png' source='111,0,222,120' corner='111,0,0,0'"));
break;
}
case MB_ICONWARNING:
{
pTextLayout->SetBkImage(_T("file='UI\\MessageDialog\\BK.png' source='0,0,111,120' corner='111,0,0,0'"));
break;
}
case MB_ICONERROR:
{
pTextLayout->SetBkImage(_T("file='UI\\MessageDialog\\BK.png' source='222,0,333,120' corner='111,0,0,0'"));
break;
}
default:
break;
}
}
CTextUI* pCaption_control = static_cast<CTextUI*>(m_pm.FindControl( _T("caption")));
if (pCaption_control != NULL)
{
pCaption_control->SetText(lpCaption);
}
CTextUI* pText_control = static_cast<CTextUI*>(m_pm.FindControl( _T("text")));
if (pText_control != NULL)
{
SIZE m_szClient = m_pm.GetClientSize();
int nCTextUIWidth = m_szClient.cx - pTextLayout->GetChildPadding() - pTextLayout->GetInset().left - 15;
pText_control->SetText(lpText);
RECT rect;
GetClientRect(m_hWnd, &rect);
SIZE szSpace = { 0 };
HFONT hOldFont =(HFONT)::SelectObject(m_pm.GetPaintDC(),m_pm.GetFont(0));
::GetTextExtentPoint32(m_pm.GetPaintDC(), lpText, _tcslen(lpText), &szSpace);
::SelectObject(m_pm.GetPaintDC(),(HGDIOBJ)hOldFont);
rect.right = rect.right + szSpace.cx - nCTextUIWidth;
if((rect.right - rect.left) < m_szClient.cx )
rect.right = rect.left + m_szClient.cx;
SetWindowPos (m_hWnd, NULL, rect.left, rect.top, rect.right , rect.bottom, SWP_SHOWWINDOW );
}
CenterWindow();
UINT uRet = ShowModal();
return uRet;
}
示例3: FixPropUI
//道具栏UI位置匹配
void CRightFrame::FixPropUI(int cx,int cy)
{
if (cy <= 0)
{
return;
}
//匹配用户信息栏位置////////////////////////////////////////////////////////////////////////////////
CContainerUI* pInfoLeft = static_cast<CContainerUI*>(m_pm.FindControl("Info_Ctn_Left"));
if (pInfoLeft)
{
pInfoLeft->SetFixedWidth(cx <= 300 ? 5 : 100);
}
//匹配道具栏的位置///////////////////////////////////////////////////////////////////////////////////
CContainerUI* pPropMainCtn = static_cast<CContainerUI*>(m_pm.FindControl("Prop_Ctn_Main"));
if (pPropMainCtn)
{
RECT rcWnd;
::GetWindowRect(m_hWnd,&rcWnd);
int iWidth = rcWnd.right - rcWnd.left - 50 - 34;
const int iSpace = 4;
const int iHorMums = iWidth / (34 + iSpace) + 1;
m_uPropPageSize = iHorMums * 2;
int iCount = 0;
//计算页数
m_uPropPageNums = (MAX_PROP_NUMS % m_uPropPageSize) == 0 ?
MAX_PROP_NUMS / m_uPropPageSize : MAX_PROP_NUMS / m_uPropPageSize + 1;
for (int iPage = 0; iPage < m_uPropPageNums; ++iPage)
{
for (int iCol = 0; iCol < 2; ++iCol)
{
for (int iRow = 0; iRow < iHorMums; ++iRow)
{
if (iCount < MAX_PROP_NUMS)
{
SIZE sz = {(34 + 4) * iRow,15 + (34 + 4) * iCol};
m_pPropBtn[iCount++]->SetFixedXY(sz);
}
}
}
}
//每次重定位后,都显示第一页
ShowPropPage(0);
}
//匹配聊天框的位置///////////////////////////////////////////////////////////////////////////////////
int x = 0,y = 0,width = 0,height = 0;
CContainerUI* pCtrl = NULL;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Talk"));
x += pCtrl ? pCtrl->GetInset().left : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Ctn_Talk_Main"));
x += pCtrl ? pCtrl->GetInset().left : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Info"));
y += pCtrl ? pCtrl->GetFixedHeight() : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_UserList"));
y += pCtrl ? pCtrl->GetFixedHeight() : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Prop"));
y += pCtrl ? pCtrl->GetFixedHeight() : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Talk"));
y += pCtrl ? pCtrl->GetInset().top : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Ctn_Talk_Main"));
y += pCtrl ? pCtrl->GetInset().top : 0;
width = cx - x;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Talk"));
width -= pCtrl ? pCtrl->GetInset().right : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Ctn_Talk_Main"));
width -= pCtrl ? pCtrl->GetInset().right : 0;
height = cy - y;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Talk"));
height -= pCtrl ? pCtrl->GetInset().bottom : 0;
pCtrl = static_cast<CContainerUI*>(m_pm.FindControl("Hor_Talk_Control"));
height -= pCtrl ? pCtrl->GetFixedHeight() : 0;
//.........这里部分代码省略.........