本文整理汇总了C++中CObList::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ CObList::GetNext方法的具体用法?C++ CObList::GetNext怎么用?C++ CObList::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObList
的用法示例。
在下文中一共展示了CObList::GetNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RebuildFonts
//****************************************************************************************
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;
}
}
}
示例2: FillModuleExtUserPrm
//----------------------------- 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);
}
}
}
示例3: OnInformation
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();
}
示例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;
}
示例5: Serialize
//*****************************************************************************************
void CBCGPDropDownToolbarButton::Serialize (CArchive& ar)
{
CBCGPToolbarButton::Serialize (ar);
UINT uiToolbarResID = 0;
if (ar.IsLoading ())
{
m_pToolBar = NULL;
ar >> uiToolbarResID;
ar >> m_strName;
ar >> m_iSelectedImage;
// Find toolbar with required resource ID:
for (POSITION pos = gAllToolbars.GetHeadPosition (); pos != NULL;)
{
CBCGPDropDownToolBar* pToolBar = DYNAMIC_DOWNCAST (CBCGPDropDownToolBar,
gAllToolbars.GetNext (pos));
if (pToolBar != NULL &&
CWnd::FromHandlePermanent (pToolBar->m_hWnd) != NULL)
{
ASSERT_VALID (pToolBar);
if (pToolBar->m_uiOriginalResID == uiToolbarResID)
{
m_pToolBar = pToolBar;
break;
}
}
}
SetDefaultCommand (m_nID);
}
示例6: while
// Find a server from a service name
static CDDEServer *DDEFindServer(const CString& s)
{
CDDEObject *obj = NULL;
POSITION pos = DDEObjects.GetHeadPosition();
while (pos && (obj = (CDDEObject *)DDEObjects.GetNext(pos)))
{
if (obj->service_name == s)
return (CDDEServer *)obj;
}
return NULL;
/*
wxNode *node = DDEObjects.First();
CDDEServer *found = NULL;
while (node && !found)
{
CDDEObject *object = (CDDEObject *)node->Data();
if (object->service_name == s)
found = (CDDEServer *)object;
else node = node->Next();
}
return found;
*/
}
示例7: 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...."));
}
}
示例8: 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);
}
}
示例9: 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);
}
}
}
示例10: 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;
}
}
}
}
示例11: CreateExtUserParams
//----------------------------- 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());
}
示例12: Serialize
//************************************************************************************
void CBCGPColorMenuButton::Serialize (CArchive& ar)
{
CBCGPToolbarMenuButton::Serialize (ar);
if (ar.IsLoading ())
{
int nColorsCount;
ar >> nColorsCount;
m_Colors.SetSize (nColorsCount);
for (int i = 0; i < nColorsCount; i++)
{
COLORREF color;
ar >> color;
m_Colors [i] = color;
}
ar >> m_nColumns;
ar >> m_nVertDockColumns;
ar >> m_nHorzDockRows;
ar >> m_bIsAutomaticButton;
ar >> m_bIsOtherButton;
ar >> m_bIsDocumentColors;
ar >> m_strAutomaticButtonLabel;
ar >> m_strOtherButtonLabel;
ar >> m_strDocumentColorsLabel;
ar >> m_colorAutomatic;
ar >> m_bStdColorDlg;
// Synchromize color with another buttons with the same ID:
CObList listButtons;
if (CBCGPToolBar::GetCommandButtons (m_nID, listButtons) > 0)
{
for (POSITION pos = listButtons.GetHeadPosition (); pos != NULL;)
{
CBCGPColorMenuButton* pOther =
DYNAMIC_DOWNCAST (CBCGPColorMenuButton, listButtons.GetNext (pos));
if (pOther != NULL && pOther != this &&
pOther->m_Color != (COLORREF) -1)
{
m_Color = pOther->m_Color;
}
}
}
}
示例13: CalcMinMaxBounds
//************************************************************************************
static void CalcMinMaxBounds (const CObList& lst, int& nMin, int& nMax)
{
for (POSITION pos = lst.GetHeadPosition (); pos != NULL; )
{
CBCGPOutlineBaseNode* pNode = (CBCGPOutlineBaseNode*) lst.GetNext (pos);
ASSERT_VALID (pNode);
if (pNode->m_nStart < nMin)
{
nMin = pNode->m_nStart;
}
if (pNode->m_nEnd > nMax)
{
nMax = pNode->m_nEnd;
}
}
}
示例14: SetProfs
void CTabProfsDlg::SetProfs(CObList &list)
{
ClearCounts();
CProfData *pData;
POSITION pos = list.GetHeadPosition();
while(pos)
{
pData = (CProfData*)list.GetNext(pos);
UpdateCount(pData->m_chProf,pData->m_nFirstClass,pData->m_nSecondClass);
// Clear the list, it isn't needed anymore and will save the view from
// having to do it.
delete pData;
}
list.RemoveAll();
}
示例15: RemoveTool
//*****************************************************************************************
BOOL CBCGPUserToolsManager::RemoveTool (CBCGPUserTool* pTool)
{
ASSERT_VALID (pTool);
POSITION pos = m_lstUserTools.Find (pTool);
if (pos == NULL)
{
ASSERT (FALSE);
return FALSE;
}
m_lstUserTools.RemoveAt (pos);
UINT uiCmdId = pTool->GetCommandId ();
delete pTool;
if (!m_bIsCopy)
{
//------------------------------------
// Remove user tool from all toolbars:
//------------------------------------
for (POSITION posTlb = gAllToolbars.GetHeadPosition (); posTlb != NULL;)
{
CBCGPToolBar* pToolBar = (CBCGPToolBar*) gAllToolbars.GetNext (posTlb);
ASSERT (pToolBar != NULL);
BOOL bToolIsFound = FALSE;
int iIndex = -1;
while ((iIndex = pToolBar->CommandToIndex (uiCmdId)) >= 0)
{
pToolBar->RemoveButton (iIndex);
bToolIsFound = TRUE;
}
if (bToolIsFound)
{
pToolBar->AdjustLayout ();
}
}
}
return TRUE;
}