本文整理汇总了C++中CList::GetHead方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::GetHead方法的具体用法?C++ CList::GetHead怎么用?C++ CList::GetHead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::GetHead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SegmentationGlob
CAVector CToolCervicales::SegmentationGlob(CDib * m_Dib, CRxDoc * i_Document, CList<CPoint, CPoint&>& i_List) {
CList<CPoint, CPoint&> Result;
Result.AddTail(i_List.GetHead());
Segmentation(m_Dib, i_Document, i_List.GetHeadPosition(), i_List.GetTailPosition(), i_List, 0, Result);
Result.AddTail(i_List.GetTail());
CAVector Vector; CPoint l_Point;
POSITION c_Pos = Result.GetHeadPosition();
while (c_Pos != NULL) {
l_Point = Result.GetNext(c_Pos);
Vector.Add(CPoint(l_Point.x, m_Dib->GetHeight()-l_Point.y));
}
/* replace very close points by an intermediate value */
for (int i=2;i<(int)((double)(m_Dib->GetWidth() + m_Dib->GetHeight())/2 * 0.03);i++) RemoveClosePoints(Vector, i);
/* remove pattern points */
RemovePatternPoints(Vector);
//i_Document->Add(Vector);
return Vector;
}
示例2: OnLvnKeyDown
void CPlayerPlaylistBar::OnLvnKeyDown(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMLVKEYDOWN pLVKeyDown = reinterpret_cast<LPNMLVKEYDOWN>(pNMHDR);
*pResult = FALSE;
CList<int> items;
POSITION pos = m_list.GetFirstSelectedItemPosition();
while (pos) {
items.AddHead(m_list.GetNextSelectedItem(pos));
}
if (pLVKeyDown->wVKey == VK_DELETE && items.GetCount() > 0) {
pos = items.GetHeadPosition();
while (pos) {
int i = items.GetNext(pos);
if (m_pl.RemoveAt(FindPos(i))) {
((CMainFrame*)AfxGetMainWnd())->CloseMedia();
}
m_list.DeleteItem(i);
}
m_list.SetItemState(-1, 0, LVIS_SELECTED);
m_list.SetItemState(
max(min(items.GetTail(), m_list.GetItemCount() - 1), 0),
LVIS_SELECTED, LVIS_SELECTED);
ResizeListColumn();
*pResult = TRUE;
} else if (pLVKeyDown->wVKey == VK_SPACE && items.GetCount() == 1) {
m_pl.SetPos(FindPos(items.GetHead()));
((CMainFrame*)AfxGetMainWnd())->OpenCurPlaylistItem();
AfxGetMainWnd()->SetFocus();
*pResult = TRUE;
}
}
示例3: ASSERT
// Define myList.
CList<CString,CString&> myList;
// Add two elements to the list.
myList.AddHead(CString(_T("ABC")));
myList.AddHead(CString(_T("123")));
// Remove the head element and verify the list.
// NOTE: once the head is removed, the number of
// elements in the list will be one.
CString strHead = myList.RemoveHead();
ASSERT((CString(_T("123")) == strHead) && (myList.GetCount() == 1) &&
(CString(_T("ABC")) == myList.GetHead()));