本文整理汇总了C++中CDesignType::FireGetGlobalDockScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesignType::FireGetGlobalDockScreen方法的具体用法?C++ CDesignType::FireGetGlobalDockScreen怎么用?C++ CDesignType::FireGetGlobalDockScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesignType
的用法示例。
在下文中一共展示了CDesignType::FireGetGlobalDockScreen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FireGetGlobalDockScreen
bool CDesignCollection::FireGetGlobalDockScreen (CSpaceObject *pObj, CString *retsScreen, int *retiPriority)
// FireGetGlobalDockScreen
//
// Allows types to override the dock screen for an object
{
int i;
int iBestPriority = -1;
CString sBestScreen;
// Loop over all types and get the highest priority screen
for (i = 0; i < m_EventsCache[evtGetGlobalDockScreen]->GetCount(); i++)
{
SEventHandlerDesc Event;
CDesignType *pType = m_EventsCache[evtGetGlobalDockScreen]->GetEntry(i, &Event);
int iPriority;
CString sScreen;
if (pType->FireGetGlobalDockScreen(Event, pObj, &sScreen, &iPriority)
&& iPriority > iBestPriority)
{
iBestPriority = iPriority;
sBestScreen = sScreen;
}
}
// If none found, then we're done
if (iBestPriority == -1)
return false;
// Otherwise, return screen
if (retsScreen)
*retsScreen = sBestScreen;
if (retiPriority)
*retiPriority = iBestPriority;
return true;
}
示例2: FireGetGlobalDockScreen
bool CDesignCollection::FireGetGlobalDockScreen (CSpaceObject *pObj, CString *retsScreen, ICCItem **retpData, int *retiPriority)
// FireGetGlobalDockScreen
//
// Allows types to override the dock screen for an object.
// NOTE: If we return TRUE, callers must discard *retpData.
{
int i;
CCodeChain &CC = g_pUniverse->GetCC();
int iBestPriority = -1;
CString sBestScreen;
ICCItem *pBestData = NULL;
// Loop over all types and get the highest priority screen
for (i = 0; i < m_EventsCache[evtGetGlobalDockScreen]->GetCount(); i++)
{
SEventHandlerDesc Event;
CDesignType *pType = m_EventsCache[evtGetGlobalDockScreen]->GetEntry(i, &Event);
int iPriority;
CString sScreen;
ICCItem *pData;
if (pType->FireGetGlobalDockScreen(Event, pObj, &sScreen, &pData, &iPriority))
{
if (iPriority > iBestPriority)
{
iBestPriority = iPriority;
sBestScreen = sScreen;
if (pBestData)
pBestData->Discard(&CC);
pBestData = pData;
}
else
{
if (pData)
pData->Discard(&CC);
}
}
}
// If none found, then we're done
if (iBestPriority == -1)
return false;
// Otherwise, return screen
if (retsScreen)
*retsScreen = sBestScreen;
if (retiPriority)
*retiPriority = iBestPriority;
if (retpData)
*retpData = pBestData;
else
{
if (pBestData)
pBestData->Discard(&CC);
}
return true;
}