本文整理汇总了C++中CContainerUI::GetChildPadding方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::GetChildPadding方法的具体用法?C++ CContainerUI::GetChildPadding怎么用?C++ CContainerUI::GetChildPadding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::GetChildPadding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}