本文整理汇总了C++中GetHeadPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHeadPosition函数的具体用法?C++ GetHeadPosition怎么用?C++ GetHeadPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHeadPosition函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetHeadPosition
BOOL CNetworkAdapterList::SetIpAddrEntry(LONG lIfIndex, LPCTSTR lpstrIPAddr, LPCTSTR lpstrIPNetMask, LPCTSTR lpstrNetNumber)
{
CNetworkAdapter cAdapter;
POSITION pPosCur,
pPosNext;
pPosNext = GetHeadPosition();
pPosCur = GetHeadPosition();
while (pPosNext != NULL)
{
cAdapter = GetNext( pPosNext);
if (cAdapter.GetIfIndex() == lIfIndex)
{
// That's the adapter to update
cAdapter.SetIPAddress( lpstrIPAddr);
cAdapter.SetIPNetMask( lpstrIPNetMask);
cAdapter.SetNetNumber( lpstrNetNumber );
SetAt( pPosCur, cAdapter);
return TRUE;
}
// Browse the next adapter and save the adapter position in the list
pPosCur = pPosNext;
}
return FALSE;
}
示例2: assert
NEPointerList* NEPointerList::getElementsWithShortestDurationNotNull()
{
assert(!empty());
NEPointerList* list=new NEPointerList;
GRNotationElement * e = NULL;
GuidoPos pos=GetHeadPosition();
TYPE_DURATION dur(INT_MAX,1);
while (pos)
{
e = GetNext(pos);
if (e->getDuration() < dur
&& e->getDuration() > DURATION_0)
dur = e->getDuration();
}
pos = GetHeadPosition();
while (pos)
{
e = GetNext(pos);
if (e->getDuration() == dur)
{
list->push_back(e);
}
}
return list;
}
示例3: DeleteAllItems
void CXTPDockingPaneTabbedContainer::OnTabsChanged()
{
if (!m_hWnd)
return;
m_nLockReposition += 1;
DeleteAllItems();
m_bCloseItemButton = GetDockingPaneManager()->m_bShowCloseTabButton;
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPane* pPane = (CXTPDockingPane*)GetNext(pos);
CXTPTabManagerItem* pItem = AddItem(GetItemCount());
if (m_pSelectedPane == pPane) SetSelectedItem(pItem);
pItem->SetCaption(pPane->GetTabCaption());
pItem->SetColor(pPane->GetItemColor());
pItem->SetTooltip(pPane->GetTitle());
pItem->SetEnabled(pPane->GetEnabled() & xtpPaneEnableClient);
pItem->SetClosable((pPane->GetOptions() & xtpPaneNoCloseable) == 0);
pItem->SetData((DWORD_PTR)pPane);
}
//////////////////////////////////////////////////////////////////////////
m_pCaptionButtons->CheckForMouseOver(CPoint(-1, -1));
m_nLockReposition -= 1;
}
示例4: OnTabsChanged
void CXTPDockingPaneTabbedContainer::InvalidatePane(BOOL bSelectionChanged)
{
if (!GetSafeHwnd())
return;
if (m_pParentContainer == 0)
return;
if (m_nLockReposition)
return;
m_nLockReposition += 1;
OnTabsChanged();
m_nLockReposition -= 1;
CRect rect = m_rcWindow;
CXTPDockingPaneBase::GetPaintManager()->AdjustClientRect(this, rect, TRUE);
if (bSelectionChanged)
{
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPane* pPane = (CXTPDockingPane*)GetNext(pos);
CRect rcPane = m_pSelectedPane == pPane ? rect : CRect(0, 0, 0, 0);
pPane->OnSizeParent(m_pDockingSite, rcPane, 0);
}
}
Invalidate(FALSE);
m_pParentContainer->InvalidatePane(bSelectionChanged);
}
示例5: AdjustMinMaxInfoClientRect
void CXTPDockingPaneTabbedContainer::GetMinMaxInfo(LPMINMAXINFO pMinMaxInfo) const
{
CXTPDockingPaneBase::GetMinMaxInfo(pMinMaxInfo);
if (IsEmpty())
return;
if (IsPaneMinimized())
{
if (((CXTPDockingPaneSplitterContainer*)m_pParentContainer)->IsHoriz())
pMinMaxInfo->ptMaxTrackSize.x = 0;
else
pMinMaxInfo->ptMaxTrackSize.y = 0;
AdjustMinMaxInfoClientRect(pMinMaxInfo, FALSE);
}
else
{
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPaneBase* pPane = GetNext(pos);
MINMAXINFO info;
pPane->GetMinMaxInfo(&info);
pMinMaxInfo->ptMinTrackSize.x = max(pMinMaxInfo->ptMinTrackSize.x, info.ptMinTrackSize.x);
pMinMaxInfo->ptMinTrackSize.y = max(pMinMaxInfo->ptMinTrackSize.y, info.ptMinTrackSize.y);
pMinMaxInfo->ptMaxTrackSize.x = min(pMinMaxInfo->ptMaxTrackSize.x, info.ptMaxTrackSize.x);
pMinMaxInfo->ptMaxTrackSize.y = min(pMinMaxInfo->ptMaxTrackSize.y, info.ptMaxTrackSize.y);
}
AdjustMinMaxInfoClientRect(pMinMaxInfo);
}
}
示例6: ASSERT_VALID
//
// remove the single unit indicated by the dwID (with optional flag
// to delete the actual object too)
//
void CAIUnitList::RemoveUnit( DWORD dwID, BOOL bObjectToo /*=TRUE*/ )
{
ASSERT_VALID( this );
// no need to remove that which is not there
CAIUnit *pUnit = GetUnit( dwID );
if( pUnit == NULL )
return;
POSITION pos1, pos2;
for( pos1 = GetHeadPosition();
( pos2 = pos1 ) != NULL; )
{
pUnit = (CAIUnit *)GetNext( pos1 );
if( pUnit != NULL )
{
ASSERT_VALID( pUnit );
if( pUnit->GetID() != dwID )
continue;
}
pUnit = (CAIUnit *)GetAt( pos2 );
if( pUnit != NULL )
{
ASSERT_VALID( pUnit );
RemoveAt( pos2 );
if( bObjectToo )
delete pUnit;
break;
}
}
}
示例7: GetHeadPosition
//
// count number of vehicle units which have the passed dwID in
// their dwData, indicating this is unit assigned for repair
// at that repair center
//
int CAIUnitList::GetRepairCount( int iPlayer, DWORD dwRepBldg )
{
int iCount = 0;
POSITION pos = GetHeadPosition();
while( pos != NULL )
{
CAIUnit *pUnit = (CAIUnit *)GetNext( pos );
if( pUnit != NULL )
{
#if 0 //THREADS_ENABLED
// BUGBUG this function must yield
myYieldThread();
//if( myYieldThread() == TM_QUIT )
// throw(ERR_CAI_TM_QUIT); // THROW( pException );
#endif
ASSERT_VALID( pUnit );
if( pUnit->GetOwner() != iPlayer )
continue;
if( pUnit->GetType() != CUnit::vehicle )
continue;
// this vehicle is assigned to be repaired at the
// repair center passed in
if( pUnit->GetDataDW() == dwRepBldg )
iCount++;
}
}
return( iCount );
}
示例8: SetFirstRecord
// 1. Satz über seine Buchmarke akt.
BOOL CPtrListExt :: SetFirstRecord (COleVariant varBookmark, const char *pAbfallArt/* = NULL*/)
{
if ((VT_EMPTY == varBookmark.vt) || IsEmpty ())
return FALSE;
BOOL bFound = FALSE;
POSITION pos = GetHeadPosition();
CRecordInfo *pInfo = NULL;
while (pos != NULL)
{
pInfo = (CRecordInfo *) GetNext(pos);
ASSERT (NULL != pInfo);
if (!bFound && (varBookmark == pInfo -> m_varBookMark))
{
bFound = TRUE;
pInfo -> m_bFirst = TRUE;
// ggf. Art ändern
if (pAbfallArt && *pAbfallArt)
pInfo -> m_strAbfArt = pAbfallArt;
}
else
pInfo -> m_bFirst = FALSE;
}
return bFound;
}
示例9: __rdtsc
void GSRasterizerList::Draw(const GSRasterizerData* data)
{
*m_sync = 0;
m_stats.Reset();
__int64 start = __rdtsc();
POSITION pos = GetTailPosition();
while(pos)
{
GetPrev(pos)->Draw(data);
}
while(*m_sync)
{
_mm_pause();
}
m_stats.ticks = __rdtsc() - start;
pos = GetHeadPosition();
while(pos)
{
GSRasterizerStats s;
GetNext(pos)->GetStats(s);
m_stats.pixels += s.pixels;
m_stats.prims = max(m_stats.prims, s.prims);
}
}
示例10: GetDockingPaneManager
CRect CXTPDockingPaneSplitterContainer::_CalculateResultDockingRectSelf(CXTPDockingPaneBase* pPaneI, XTPDockingPaneDirection direction, CXTPDockingPaneBase* pNeighbour)
{
direction = GetDockingPaneManager()->GetRTLDirection(direction);
ASSERT(pNeighbour);
BOOL bAfter = (direction == xtpPaneDockRight || direction == xtpPaneDockBottom);
// getting list of nonempty panes
CXTPDockingPaneBaseList lst;
POSITION posPanes = GetHeadPosition();
while (posPanes)
{
CXTPDockingPaneBase* pPane = GetNext(posPanes);
if (pPane->IsEmpty() || (pPane == pPaneI))
continue;
POSITION pos = lst.AddTail(pPane);
if (pPane == pNeighbour)
{
if (bAfter)
lst.InsertAfter(pos, pPaneI);
else
lst.InsertBefore(pos, pPaneI);
}
}
CRect rcResult = _CalculateResultDockingRect(m_bHoriz, lst, m_rcWindow, pPaneI);
m_pDockingSite->ClientToScreen(rcResult);
return rcResult;
}
示例11: _InsertPane
void CXTPDockingPaneSplitterContainer::_InsertPane(CXTPDockingPaneBase* pPane, CXTPDockingPaneBase* pNeighbour, BOOL bAfter)
{
POSITION pos = pNeighbour ? m_lstPanes.Find(pNeighbour) : NULL;
if (bAfter)
{
if (pos == NULL) pos = m_lstPanes.GetTailPosition();
m_lstPanes.InsertAfter(pos, pPane);
}
else
{
if (pos == NULL) pos = GetHeadPosition();
m_lstPanes.InsertBefore(pos, pPane);
}
pPane->m_pParentContainer = this;
pPane->SetDockingSite(GetDockingSite());
GetDockingPaneManager()->RecalcFrameLayout(this, TRUE);
_UpdateSplitters();
if (m_pParentContainer)
{
m_pParentContainer->OnChildContainerChanged(this);
}
pPane->OnParentContainerChanged(this);
}
示例12: GetHeadPosition
LPCTSTR CInputDeviceList::GetHash()
{
COcsCrypto myHash;
CInputDevice myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (GetCount() == 0)
return NULL;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s%s%s"), myObject.GetType(), myObject.GetManufacturer(),
myObject.GetCaption(), myObject.GetDescription(), myObject.GetPointingInterface(),
myObject.GetPointingType());
myHash.HashUpdate( csToHash);
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
示例13: GetHeadPosition
void CSUIBtnList::OnSize(CRect WndRect){
POSITION pos = GetHeadPosition();
while(pos){
CSUIButton* cBtn = GetNext(pos);
cBtn->OnSize(WndRect);
}
}
示例14: GetHeadPosition
LPCTSTR CVideoAdapterList::GetHash()
{
COcsCrypto myHash;
CVideoAdapter myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s"), myObject.GetName(), myObject.GetChipset(),
myObject.GetMemory(), myObject.GetScreenResolution());
myHash.HashUpdate( LPCTSTR( csToHash), csToHash.GetLength());
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
示例15: return
BOOL CValueList::Save(const char *pszFilename)
{
CString strFile;
if (!pszFilename)
strFile = m_strFile;
else
strFile = pszFilename;
CFile file;
if (!file.Open(strFile,CFile::modeWrite|CFile::modeCreate))
return(FALSE);
CArchive ar(&file,CArchive::store);
ar << GetCount();
CValueItem vi;
POSITION pos = GetHeadPosition();
while(pos)
{
vi = GetNext(pos);
ar << vi.m_strText;
ar << vi.m_nValue;
}
ar.Close();
file.Close();
return(TRUE);
}