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


C++ CObList类代码示例

本文整理汇总了C++中CObList的典型用法代码示例。如果您正苦于以下问题:C++ CObList类的具体用法?C++ CObList怎么用?C++ CObList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CObList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnBegindrag

void CExplorerTestView::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	// TODO: Add your control notification handler code here
	int				nItem = -1;
	CObList			fileList;
	LIST_VIEW*		pListView;
	CListCtrl&		listCtrl = GetListCtrl();
	CSharedFile		sharedFile;
	COleDataSource*	dataSource = new COleDataSource;

	while((nItem = listCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
	{
		pListView = (LIST_VIEW*)listCtrl.GetItemData(nItem);
		fileList.AddTail((CObject*)pListView);
	}

	CArchive	ar(&sharedFile, CArchive::store);
	
	CExplorerTestDoc*	pDoc = (CExplorerTestDoc*)GetDocument();
	pDoc->SetCopyFileList(&fileList);
	pDoc->SerializeCopyFiles(ar);

	ar.Close();

	dataSource->CacheGlobalData(m_cbFormat, sharedFile.Detach());
	dataSource->DoDragDrop();

	delete dataSource;

	*pResult = 0;
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:32,代码来源:EXPLORERTESTVIEW.CPP

示例2: GetProfs

void CInfCreature::GetProfs(CObList &list)
{
	if (m_plAffects.GetCount() < 1)
		return;

	INF_AFF *pAff;
	POSITION pos = m_plAffects.GetHeadPosition();
	while(pos)
	{
		pAff = (INF_AFF*)m_plAffects.GetNext(pos);

		if (pAff->dwAffectType == AFF_TYPE_PROF)
		{
			CProfData *pProf = new CProfData;

			pProf->m_chProf = (BYTE)pAff->nNP2;

			if (m_infCre.chDualClass)
			{
				pProf->m_nFirstClass = HITRIBBLE(pAff->nNP1);
				pProf->m_nSecondClass = LOTRIBBLE(pAff->nNP1);
			}
			else
				pProf->m_nFirstClass = pAff->nNP1;

			list.AddTail(pProf);
		}
	}
	TRACE("CInfCreautre::GetProfs() - %d profs found.\n",list.GetCount());
}
开发者ID:devurandom,项目名称:shadowkeeper,代码行数:30,代码来源:InfCreature.cpp

示例3: ASSERT

//----------------------------- FUNCTION -------------------------------------*
void PropGSDModule::FillModuleExtUserPrm(CDP_Module * pModule)
{
	CListCtrl* pExt = (CListCtrl*)GetDlgItem(IDC_LIST_AVAIL_MOD_EXTPRM);
	CListCtrl* pUsedExt = (CListCtrl*)GetDlgItem(IDC_LIST_USED_MOD_EXTPRM);
	if (pExt == NULL || pUsedExt == NULL)	{
		ASSERT(FALSE);
		return;
	}

	pExt->DeleteAllItems( );
	pUsedExt->DeleteAllItems();
    if (pModule == NULL) {
        return;
    }

	CObList* pExtParams = pModule->GetExtParams();
	POSITION pos = pExtParams->GetHeadPosition();
	LV_ITEM lv;
	int index = 0;
	while (pos)	{
		ExtParam* pParam = (ExtParam*)pExtParams->GetNext(pos);
		if (!pParam->IsConstantParam())	{
			::memset(&lv, 0, sizeof(LV_ITEM));
			lv.mask = LVIF_TEXT | LVIF_PARAM;
			lv.iItem = index++;
			lv.pszText = (LPTSTR)(LPCTSTR)pParam->GetDescription();
			lv.lParam = (DWORD)pParam;

			if (pParam->IsUsed())
				pUsedExt->InsertItem(&lv);
			else
				pExt->InsertItem(&lv);
		}
	}
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:36,代码来源:PropGSDModule.cpp

示例4: OnUpdateCaptionButtons

void CVisualManager::OnUpdateCaptionButtons (CRect rectCaption, const CObList& lstSysButtons, CWnd* /*pWnd*/)
{
	if (!CanDrawImage ())
	{
		return;
	}

	CSize szSysBorder (GetSystemBorders ());

	int nIndex = 3;

	int x = rectCaption.right + szSysBorder.cx - (szSysBorder.cx - 1);

	rectCaption.top -= szSysBorder.cy;

	for (POSITION pos = lstSysButtons.GetHeadPosition (); pos != NULL;)
	{
		CSize sizeButton (m_SysBtnBack[nIndex--].GetImageSize ());
		x -= sizeButton.cx;
		
		CBCGPFrameCaptionButton* pButton = (CBCGPFrameCaptionButton*)
			lstSysButtons.GetNext (pos);
		ASSERT_VALID (pButton);

		pButton->SetRect (CRect (CPoint (x, rectCaption.top), sizeButton));
	}

	return;
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:29,代码来源:VisualManager.cpp

示例5: OnDummySelectActiveConfiguration

void CVisualStudioDemoDoc::OnDummySelectActiveConfiguration()
{
	CMFCToolBarComboBoxButton* pSrcCombo = NULL;

	CObList listButtons;
	if (CMFCToolBar::GetCommandButtons(ID_DUMMY_SELECT_ACTIVE_CONFIGURATION, listButtons) > 0)
	{
		for (POSITION posCombo = listButtons.GetHeadPosition();
			pSrcCombo == NULL && posCombo != NULL;)
		{
			CMFCToolBarComboBoxButton* pCombo = DYNAMIC_DOWNCAST(CMFCToolBarComboBoxButton, listButtons.GetNext(posCombo));

			if (pCombo != NULL && CMFCToolBar::IsLastCommandFromButton(pCombo))
			{
				pSrcCombo = pCombo;
			}
		}
	}

	if (pSrcCombo != NULL)
	{
		ASSERT_VALID(pSrcCombo);

		LPCTSTR lpszSelItem = pSrcCombo->GetItem();
		CString strSelItem = (lpszSelItem == NULL) ? _T("") : lpszSelItem;

		AfxMessageBox(strSelItem);
	}
	else
	{
		AfxMessageBox(_T("Show \"Set Active Configuration\" dialog...."));
	}
}
开发者ID:jetlive,项目名称:skiaming,代码行数:33,代码来源:VisualStudioDemoDoc.cpp

示例6: SetActiveInGroup

//---------------------------------------------------------------------------------------
void CBCGPAutoHideToolBar::SetActiveInGroup (BOOL bActive)
{
	CBCGPControlBar::SetActiveInGroup (bActive);
	if (bActive)
	{
		
		CObList lst;
		m_pDockBarRow->GetGroupFromBar (this, lst);

		for (POSITION pos = lst.GetHeadPosition (); pos != NULL;)
		{
			CBCGPControlBar* pBar = 
				DYNAMIC_DOWNCAST (CBCGPControlBar, lst.GetNext (pos));
			ASSERT_VALID (pBar);

			if (pBar != this)
			{
				pBar->SetActiveInGroup (FALSE);
			}
		}

		CRect rect; rect.SetRectEmpty ();
		m_pParentDockBar->RepositionBars (rect);
		
	}
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:27,代码来源:BCGPAutoHideToolBar.cpp

示例7: RemoveAllItems

//****************************************************************************************
void CBCGPRibbonFontComboBox::RebuildFonts ()
{
	RemoveAllItems ();

	CObList lstFonts;

	CBCGPToolbarFontCombo tlbFontCombo (
		&lstFonts, m_nFontType, m_nCharSet, m_nPitchAndFamily);

	POSITION pos = NULL;

	for (pos = lstFonts.GetHeadPosition (); pos != NULL;)
	{
		CBCGPFontDesc* pDesc = (CBCGPFontDesc*) lstFonts.GetNext (pos);
		ASSERT_VALID (pDesc);

		if ((m_nFontType & pDesc->m_nType) != 0)
		{
			BOOL bIsUnique = GetFontsCount (pDesc->m_strName, lstFonts) <= 1;
			AddItem (bIsUnique ? pDesc->m_strName : pDesc->GetFullName (), (DWORD_PTR) pDesc);
		}
	}

	// Delete unused items:
	for (pos = lstFonts.GetHeadPosition (); pos != NULL;)
	{
		CBCGPFontDesc* pDesc = (CBCGPFontDesc*) lstFonts.GetNext (pos);
		ASSERT_VALID (pDesc);

		if ((m_nFontType & pDesc->m_nType) == 0)
		{
			delete pDesc;
		}
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:36,代码来源:BCGPRibbonComboBox.cpp

示例8: getThread

void *
getThread(void *arg)
{
	CObList <CMsgObj>	*pQueue =  (CObList <CMsgObj>	*)arg;
	int64 _s, _e;
	int cc = 0;
	CMsgObj p(1);
	
	_s = GetAbsTime();
	for( int i=0; i<loopnum; ++i)
	{
//		pQueue->release(&p);
		CMsgObj *a = pQueue->get();
		if ( NULL == a )
			break;

		++cc;
/*		if ( NULL != p )
			printf("thread[%lu], seq=%d, num=%d, idle_num=%d\n", 
				pthread_self(), p->seq, myPool->get_num(), myPool->get_idle_num()
				);
		else
			printf("thread[%lu], no more obj\n", pthread_self() );
*/
//		usleep(1);		
	}
	_e = GetAbsTime();

//	printf("thread[%lu], num=%d, idle_num=%d\n", pthread_self(), myPool->get_num(), myPool->get_idle_num());

	printf("get thread[%lu], cc=%d, speed=%.3f\n", pthread_self(), cc, (int64)loopnum*1000.0*1000.0/(_e-_s));

    return 0;
}
开发者ID:tangwsh,项目名称:Common,代码行数:34,代码来源:test_oblist.cpp

示例9: Serialize

//************************************************************************************
void CBCGPCalendarMenuButton::Serialize (CArchive& ar)
{
	CBCGPToolbarMenuButton::Serialize (ar);

	if (ar.IsLoading ())
	{
		ar >> m_nColumns;
		ar >> m_nVertDockColumns;
		ar >> m_nHorzDockRows;

		ar >> m_bStdCalendarDlg;

		CObList listButtons;
		if (CBCGPToolBar::GetCommandButtons (m_nID, listButtons) > 0)
		{
			for (POSITION pos = listButtons.GetHeadPosition (); pos != NULL;)
			{
				CBCGPCalendarMenuButton* pOther = 
					DYNAMIC_DOWNCAST (CBCGPCalendarMenuButton, listButtons.GetNext (pos));
				if (pOther != NULL && pOther != this)
				{
					m_Calendar = pOther->m_Calendar;
				}
			}
		}
	}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:27,代码来源:BCGPCalendarMenuButton.cpp

示例10: SetNewParent

//------------------------------------------------------------------------//
void CBCGPGlobalUtils::SetNewParent (CObList& lstControlBars, CWnd* pNewParent,
									 BOOL bCheckVisibility)
{
	ASSERT_VALID (pNewParent);
	for (POSITION pos = lstControlBars.GetHeadPosition (); pos != NULL;)
	{
		CBCGPBaseControlBar* pBar = (CBCGPBaseControlBar*) lstControlBars.GetNext (pos);

		if (bCheckVisibility && !pBar->IsBarVisible ())
		{
			continue;
		}
		if (!pBar->IsKindOf (RUNTIME_CLASS (CBCGPSlider)))
		{
			pBar->ShowWindow (SW_HIDE);
			pBar->SetParent (pNewParent);
			CRect rectWnd;
			pBar->GetWindowRect (rectWnd);
			pNewParent->ScreenToClient (rectWnd);

			pBar->SetWindowPos (NULL, -rectWnd.Width (), -rectWnd.Height (), 
									  100, 100, SWP_NOZORDER | SWP_NOSIZE  | SWP_NOACTIVATE);
			pBar->ShowWindow (SW_SHOW);
		}
		else
		{
			pBar->SetParent (pNewParent);
		}
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:31,代码来源:BCGPGlobalUtils.cpp

示例11: GetListCtrl

void CExplorerTestView::OnInformation() 
{
	// TODO: Add your command handler code here
	CInfoDlg	dlg;	// 파일 정보 다이알로그 박스 클래스
	LIST_VIEW*	pListView;
	int			nItem = -1;
	CObList		obList;	// 선택된 파일 리스트들
	CListCtrl&	listCtrl = GetListCtrl();

	// 리스트 뷰에서 선택된 항목들만 CObList에 추가시킨다.
	while( (nItem = listCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
	{
		pListView = new LIST_VIEW;
		*pListView = *(LIST_VIEW*)listCtrl.GetItemData(nItem);
		obList.AddTail((CObject*)pListView);
	}
	dlg.SetInfo(&obList);	// 다이알로그가 화면에 보여지기 전에
							// 먼저 파일정보를 다이알로그에 셋팅한다.
	dlg.DoModal();	// OnInitDialog를 호출하여 화면에 보이게 한다.

	// 모든 선택된 파일 리스트들을 메모리에서 삭제한다.
	for(POSITION pos = obList.GetHeadPosition() ; pos != NULL ; )
	{
		pListView = (LIST_VIEW*)obList.GetNext(pos);
		delete	pListView;
	}
	obList.RemoveAll();
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:28,代码来源:EXPLORERTESTVIEW.CPP

示例12: GetList

void CObBinTree::GetList( CObList& list )
{
	ASSERT(list.IsEmpty());
	if( !list.IsEmpty() )list.RemoveAll();

	WalkTree( StoreInList, (LPVOID)&list, TV_INORDER );

	ASSERT( list.GetCount()==GetCount() );
}
开发者ID:EISALab,项目名称:AMGAgroundwater,代码行数:9,代码来源:tree_ob.cpp

示例13: Read

BOOL CBCGPRegistry::Read (LPCTSTR pszKey, CObList& list)
{
	while (!list.IsEmpty ())
	{
		delete list.RemoveHead ();
	}

	return Read (pszKey, (CObject&) list);
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:9,代码来源:BCGPRegistry.cpp

示例14: ArrangeWindowsInWindow

//--------------------------------------------------------------------------------
void ArrangeWindowsInWindow (CWnd * pParentWnd, CObArray & arrWnd, DWORD dwOrient)
// Arranges the windows within the rectangle of another window.
//--------------------------------------------------------------------------------
{
	if (arrWnd.GetSize() == 0)			// no windows to size.. do nothing
		return;

	CRect ClientRect;
	pParentWnd->GetClientRect(&ClientRect);
	
	CSize ParentSize = ClientRect.Size();
	if (ParentSize.cy == 0)
		return;							// no height => not much we can do	
	
	CObList SpcList;					// list used to keep track of window spacing
	
	// add initial Arrange rectangle to the list;	
	CWndSpaceElt * pSpcElt = new CWndSpaceElt;
	pSpcElt->wd = 0;
	pSpcElt->ht = ClientRect.Height();
	SpcList.AddTail(pSpcElt); 


	// sort array of window positions by size so that we position the largest windows first.
	// this improves the results quite a bit
	CObject ** pArrData = arrWnd.GetData();
	ASSERT(pArrData != NULL);		// shouldn't be NULL as array is non-empty, but check anyway	
	qsort(pArrData, arrWnd.GetSize(), sizeof(CObject *), CompareWndRect); 	
	
	
	HDWP hDWP = BeginDeferWindowPos(arrWnd.GetSize());	   // defer window moves to save on refresh

	// iterate thru all the windows in the list looking for a position to put it
	for (int nWndNo = 0; nWndNo < arrWnd.GetSize(); nWndNo++)
	{
		CWnd * pWnd = (CWnd *)arrWnd[nWndNo];
		ASSERT(pWnd != NULL);
		ASSERT_VALID(pWnd);
		PositionInSpcList(pWnd, SpcList, dwOrient, pParentWnd, ParentSize, hDWP);
	} 

	if (hDWP != NULL)
		::EndDeferWindowPos(hDWP);		// move the windows

	// Remove elements from the SpcList;
	while (!SpcList.IsEmpty())
	{
		CWndSpaceElt * pElt = (CWndSpaceElt *) SpcList.GetTail();
		delete pElt;
		SpcList.RemoveTail();
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:53,代码来源:FRAMEWND.CPP

示例15: while

//----------------------------- FUNCTION -------------------------------------*
void PropGSDModule::CreateExtUserParams()
{
	DWORD dwCurrentPos;
	CByteArray	UserParam;
	UserParam.RemoveAll();
	ExtParam* pParam = NULL;
	int offset = 0;

    UserParam.InsertAt(0, &m_DefaultUserPrmData);
    dwCurrentPos = UserParam.GetSize();

    if (m_bExtUserPrms) {
		// This sets all default parameter and of unused ExtUserPrms
		POSITION pos = ExtUserParams.GetHeadPosition();
		while (pos)	{
			pParam = (ExtParam*)ExtUserParams.GetNext(pos);
            ModifyParamArray(UserParam,pParam);
		}// end while of unused UserPrms
	}

    //actualize current position for appending the modules
    dwCurrentPos = UserParam.GetSize();
	// create UserParams and add them to the UserParam Array 
	m_pModule->GetUsedModules(&arModules);
	int index = arModules.GetSize();
	for (int i = 0; i < index; i++)	{
		CDP_Module* pModule = (CDP_Module*)arModules.GetAt(i);
		if (pModule->GetUserPrmLen() == 0)
			continue;

		CByteArray	ModuleParam;
		ModuleParam.RemoveAll();
		ModuleParam.InsertAt(0, 0x00, pModule->GetUserPrmLen());

		CObList* pParamList = pModule->GetExtParams();
		POSITION pos = pParamList->GetHeadPosition();
		while (pos)	{
			pParam = (ExtParam*)pParamList->GetNext(pos);
            ModifyParamArray(ModuleParam,pParam);
		}
		UserParam.InsertAt(dwCurrentPos, &ModuleParam);
		dwCurrentPos += pModule->GetUserPrmLen();
	}

	// set new userprms and show in EditCtrl
	m_ExtUserPrmData.RemoveAll();
    m_ExtUserPrmData.Copy(UserParam);

	if (::IsWindow(m_ctrlUserPrm.m_hWnd))
		m_ctrlUserPrm.SetHexContent(m_ExtUserPrmData.GetData(), m_ExtUserPrmData.GetSize());
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:52,代码来源:PropGSDModule.cpp


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