本文整理汇总了C++中CPaintManagerUI::AttachDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ CPaintManagerUI::AttachDialog方法的具体用法?C++ CPaintManagerUI::AttachDialog怎么用?C++ CPaintManagerUI::AttachDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPaintManagerUI
的用法示例。
在下文中一共展示了CPaintManagerUI::AttachDialog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMessage
LRESULT CDropDownWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if( uMsg == WM_CREATE ) {
m_pm.Init(m_hWnd);
// The trick is to add the items to the new container. Their owner gets
// reassigned by this operation - which is why it is important to reassign
// the items back to the righfull owner/manager when the window closes.
CControlCanvasUI* pWindow = new CControlCanvasUI;
CVerticalLayoutUI* pLayout = new CVerticalLayoutUI;
for( int i = 0; i < m_pOwner->GetCount(); i++ ) pLayout->Add(static_cast<CControlUI*>(m_pOwner->GetItem(i)));
pLayout->SetAutoDestroy(false);
pLayout->EnableScrollBar();
pWindow->Add(pLayout);
m_pm.AttachDialog(pWindow);
return 0;
}
else if( uMsg == WM_CLOSE ) {
m_pOwner->SetManager(m_pOwner->GetManager(), m_pOwner->GetParent());
m_pOwner->SetPos(m_pOwner->GetPos());
m_pOwner->SetFocus();
}
else if( uMsg == WM_LBUTTONUP ) {
PostMessage(WM_KILLFOCUS);
}
else if( uMsg == WM_KEYDOWN ) {
switch( wParam ) {
case VK_ESCAPE:
m_pOwner->SelectItem(m_iOldSel);
// FALL THROUGH...
case VK_RETURN:
PostMessage(WM_KILLFOCUS);
break;
default:
TEventUI event;
event.Type = UIEVENT_KEYDOWN;
event.chKey = wParam;
m_pOwner->Event(event);
return 0;
}
}
else if( uMsg == WM_KILLFOCUS ) {
if( m_hWnd != (HWND) wParam ) PostMessage(WM_CLOSE);
}
LRESULT lRes = 0;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}