当前位置: 首页>>代码示例>>C++>>正文


C++ CList::GetHead方法代码示例

本文整理汇总了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;
}
开发者ID:dblock,项目名称:rxcervicales,代码行数:20,代码来源:ToolCervicales.cpp

示例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;
    }
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:40,代码来源:PlayerPlaylistBar.cpp

示例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()));      
开发者ID:terryjintry,项目名称:OLSource1,代码行数:13,代码来源:clist-class_19.cpp


注:本文中的CList::GetHead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。