本文整理汇总了C++中CModule::SetUIModule方法的典型用法代码示例。如果您正苦于以下问题:C++ CModule::SetUIModule方法的具体用法?C++ CModule::SetUIModule怎么用?C++ CModule::SetUIModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModule
的用法示例。
在下文中一共展示了CModule::SetUIModule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWorkspace
void CAppSignal::OnWorkspace(class CUIWorkspace* pUIWorkspace, const POINT& pt)
{
EnterCriticalSection(&m_csControls);
{
if ( pUIWorkspace == m_pUIWorkspace )
{
POINT ptScreen = { pt.x, pt.y };
ClientToScreen(pUIWorkspace->GetHwnd(), &ptScreen);
HMENU hMenu = CreatePopupMenu();
map<string, CFactory<CModule>::FACTORYSTRUCT*>& mapFactory = CFactory<CModule>::GetFactoryMap();
for ( map<string, CFactory<CModule>::FACTORYSTRUCT*>::iterator iter = mapFactory.begin() ; iter != mapFactory.end() ; ++iter )
{
MODULEFACTORYDATA* pmfd = ((MODULEFACTORYDATA*)iter->second->pvData);
if ( !pmfd ) continue;
AppendMenu(hMenu, MF_STRING, (uint32)iter->second, pmfd->m_sCategory.c_str());
}
uint32 nResult = TrackPopupMenu(hMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_LEFTBUTTON, ptScreen.x, ptScreen.y, 0, GetHwnd(), NULL);
if ( nResult != 0 )
{
CFactory<CModule>::FACTORYSTRUCT* pfs = (CFactory<CModule>::FACTORYSTRUCT*)nResult;
MODULEFACTORYDATA* pmfd = ((MODULEFACTORYDATA*)pfs->pvData);
CUIModule* pUIModule = (CUIModule*)CFactory<CUIWindow>::Create("CUIModule");
CModule* pModule = (CModule*)pfs->fnCreate();
pUIModule->SetModule(pModule);
pModule->SetUIModule(pUIModule);
pUIModule->SetParent(m_pUIWorkspace);
m_pUIWorkspace->AddChild(pUIModule);
MODULEINITSTRUCT mis;
mis.pApp = this;
pModule->Init(mis);
pModule->PostInit();
CUIWindow::CREATESTRUCT cs;
cs.x = pt.x;
cs.y = pt.y;
cs.hWndParent = m_pUIWorkspace->GetHwnd();
cs.pUIHost = pModule;
cs.dict.SetString("title", pmfd->m_sCategory);
pUIModule->Create(cs);
m_listModules.push_back(pModule);
m_listUIModules.push_back(pUIModule);
}
DestroyMenu(hMenu);
}
}
LeaveCriticalSection(&m_csControls);
}