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


C++ CUIntArray::GetAt方法代码示例

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


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

示例1: ChangeCurColGroup

BOOL CQuoteColumnSetting::ChangeCurColGroup(CString strGroupName)
{
	int nCurSel = m_wndCurGroup.GetCurSel();
	if (nCurSel == m_nPreCurGroup)
	{
		return FALSE;
	}
	if (m_bCurChanged)
	{
		CString strGroup;
		m_wndCurGroup.GetLBText(m_nPreCurGroup,strGroup);
		SaveCurGroup(strGroup);
	}
	m_wndCurGroupCol.DeleteAllItems();
	if (strGroupName.IsEmpty())
	{
		m_wndCurGroup.GetWindowText(strGroupName);
	}

	CUIntArray* pAyDispCol = NULL;
	m_iCol->GetDispColGroup(strGroupName, pAyDispCol);
	if (pAyDispCol)
	{
		for (int i = 0; i < pAyDispCol->GetCount(); i++)
		{
			int nID = pAyDispCol->GetAt(i++);
			int nWidth = pAyDispCol->GetAt(i);
			CString strColName = m_iCol->GetColumnName(nID);
			int nIndex = m_wndCurGroupCol.InsertItem(m_wndCurGroupCol.GetItemCount(),strColName,nWidth);
			m_wndCurGroupCol.SetItemData(nIndex,nID);

		}
	}
// 	CArray<CStringArray*,CStringArray*>* payDispCol = m_iCol->GetColHeadTemplate(strGroupName);
// 	if (payDispCol)
// 	{
// 		for (int i=0; i<payDispCol->GetCount(); i++)
// 		{
// 			CStringArray* pDispCol = payDispCol->GetAt(i);
// 			if (pDispCol)
// 			{
// 				int nID = atoi(pDispCol->GetAt(0));
// 				int nWidth = atoi(pDispCol->GetAt(1));
// 				CString strColName = m_iCol->GetColumnName(nID);
// 				int nIndex = m_wndCurGroupCol.InsertItem(m_wndCurGroupCol.GetItemCount(),strColName,nWidth);
// 				m_wndCurGroupCol.SetItemData(nIndex,nID);
// 			}
// 		}
// 	}
	m_nPreCurGroup = nCurSel;
	return TRUE;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:52,代码来源:QuoteColumnSetting.cpp

示例2: GetFormatTypeIndex

UINT GetFormatTypeIndex(UINT nFormat)
{
	int i; for (i=0;i<arFormatType.GetSize();i++) {
		if (arFormatType.GetAt(i) == nFormat) {
			return i;
		}
	}
	return -1;
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:9,代码来源:STEP_api.cpp

示例3: OnSetActive

BOOL COptionsDlg::OnSetActive() {
	CSnmp *pSnmp = &theApp.m_wnd.snmp;
	if (pSnmp != NULL) {
		CStringArray s;
		CUIntArray nAdapterArray;
		pSnmp->GetInterfaceDescriptions(&s, &nAdapterArray);
		m_Interfaces.ResetContent();
		
		int active = 0;
		for (int i = 0; i <= s.GetUpperBound(); i++) {
			int index = m_Interfaces.AddString(s.GetAt(i));
			if (index != CB_ERR) {
				m_Interfaces.SetItemData(index, nAdapterArray.GetAt(i));
				if (nAdapterArray.GetAt(i) == g_dwAdapter)
					active = i;
			}
		}
		m_Interfaces.SetCurSel(active);
	}
	return CPropertyPage::OnSetActive();
}
开发者ID:nayuki,项目名称:NetPerSec,代码行数:21,代码来源:OptionsDlg.cpp

示例4: WriteSimpleArray

void EditSerializer::WriteSimpleArray(DataField field, const CUIntArray& a)
{
	CString result;
	char buf[16];

	for (int i=0; i<a.GetSize(); i++)
	{
		unsigned int val = a.GetAt(i);
		if (i > 0)
			result += ";";

		sprintf(buf, "%d", val);
		result += buf;
	}

	WriteString(field, (LPCTSTR)result);
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:17,代码来源:EditSerializer.cpp

示例5: SaveCurGroup

BOOL CQuoteColumnSetting::SaveCurGroup(CString strGroupName /* = _T */)
{
	if (!m_bCurChanged)
	{
		return FALSE;
	}
	if (strGroupName.IsEmpty())
	{
		m_wndCurGroup.GetWindowText(strGroupName);
	}

	//CArray<CStringArray*,CStringArray*> ayNewColGroup;
	CUIntArray ayNewColGroup;
	CMapWordToPtr mapFixedCol;
	//CString strTemp;
	// 生成所有显示列项
	for (int i=0; i<m_wndCurGroupCol.GetItemCount(); i++)
	{
		//CStringArray* pCol = new CStringArray;
		CUIntArray* pAyCol = new CUIntArray;
		
		LVITEM item;
		ZeroMemory(&item,sizeof(LVITEM));
		item.mask = LVIF_PARAM | LVIF_IMAGE;
		item.iItem = i;

		m_wndCurGroupCol.GetItem(&item);
		int nID = (int)item.lParam;
		pAyCol->Add(nID);
		//strTemp.Format("%d",nID);
		//pCol->Add(strTemp);
		
		long nWidth = (long)item.iImage;
		nWidth = nWidth>0 ? nWidth : m_iCol->GetColumnWidth(nID);
		pAyCol->Add(nWidth);
		//strTemp.Format("%d",nWidth);
		//pCol->Add(strTemp);

		if (CQuoteReportTable::IsFixedColumn(nID))		// 判断是否固定列
		{
			mapFixedCol.SetAt(nID,(void*)pAyCol);		// 固定列暂时放入哈希表,后面处理
		} 
		else
		{
			ayNewColGroup.Add(nID);
			ayNewColGroup.Add(nWidth);
			//ayNewColGroup.Add(pCol);			// 正常列直接放入数组
		}
	}

	if (mapFixedCol.GetCount() > 0)		// 处理固定列
	{
		int nID = 0;
		//CStringArray* payTempCol = NULL;
		CUIntArray* pAyCol = NULL;
		if (mapFixedCol.Lookup(COLUMN_HQ_BASE_ARROW,(void*&)pAyCol) && pAyCol)
		{
			ayNewColGroup.InsertAt(0, pAyCol->GetAt(0));
			ayNewColGroup.InsertAt(1, pAyCol->GetAt(1));
			delete pAyCol;
			mapFixedCol.RemoveKey(COLUMN_HQ_BASE_ARROW);
			//ayNewColGroup.InsertAt(0,payTempCol);
		}
		if (mapFixedCol.Lookup(COLUMN_HQ_BASE_INFO_MARK,(void*&)pAyCol) && pAyCol)
		{
			ayNewColGroup.InsertAt(0, pAyCol->GetAt(0));
			ayNewColGroup.InsertAt(1, pAyCol->GetAt(1));
			delete pAyCol;
			mapFixedCol.RemoveKey(COLUMN_HQ_BASE_INFO_MARK);
		}
		if (mapFixedCol.Lookup(COLUMN_HQ_BASE_NAME,(void*&)pAyCol) && pAyCol)
		{
			ayNewColGroup.InsertAt(0, pAyCol->GetAt(0));
			ayNewColGroup.InsertAt(1, pAyCol->GetAt(1));
			delete pAyCol;
			mapFixedCol.RemoveKey(COLUMN_HQ_BASE_NAME);
		}
		if (mapFixedCol.Lookup(COLUMN_HQ_BASE_CODE,(void*&)pAyCol) && pAyCol)
		{
			ayNewColGroup.InsertAt(0, pAyCol->GetAt(0));
			ayNewColGroup.InsertAt(1, pAyCol->GetAt(1));
			delete pAyCol;
			mapFixedCol.RemoveKey(COLUMN_HQ_BASE_CODE);
		}
		if (mapFixedCol.Lookup(COLUMN_HQ_BASE_NUMBER,(void*&)pAyCol) && pAyCol)
		{
			ayNewColGroup.InsertAt(0, pAyCol->GetAt(0));
			ayNewColGroup.InsertAt(1, pAyCol->GetAt(1));
			delete pAyCol;
			mapFixedCol.RemoveKey(COLUMN_HQ_BASE_NUMBER);
		}
	}
	m_iCol->SetDispColGroup(strGroupName, &ayNewColGroup);

// 	for (int i=0; i<ayNewColGroup.GetCount(); i++)
// 	{
// 		CStringArray* pTemp = ayNewColGroup.GetAt(i);
// 		if (pTemp)
// 		{
// 			delete pTemp;
//.........这里部分代码省略.........
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:QuoteColumnSetting.cpp

示例6: SelectBlock

void CXTPReportSelectedRows::SelectBlock(int nBlockBegin, int nEnd, BOOL bControlKey)
{
	CXTPReportRows* pRows;
	switch(m_nRowType)
	{
		case xtpRowTypeHeader : pRows = m_pControl->GetHeaderRows(); break;
		case xtpRowTypeFooter : pRows = m_pControl->GetFooterRows(); break;
		default : pRows = m_pControl->GetRows(); break;
	}
	int nRowsCount(0);
	if (pRows)
		nRowsCount = pRows->GetCount();
	BOOL bGo = (nBlockBegin >= 0 && nBlockBegin < nRowsCount && nEnd < nRowsCount);
	if (!bGo)
	{
		Clear(GetNotifyOnSelectedRowsClear());
		return;
	}

	if (bControlKey == FALSE)
	{
		nBlockBegin = m_nRowBlockBegin != -1 ? m_nRowBlockBegin : nBlockBegin;

		int nBegin = nBlockBegin;

		if (nBegin == -1 || nEnd == -1)
			return;

		if (nBegin > nEnd)
		{
			nBegin = nEnd;
			nEnd = nBlockBegin;
		}

		if (m_arrSelectedBlocks.GetSize() == 1 && m_arrSelectedBlocks[0].nIndexBegin == nBegin &&
			m_arrSelectedBlocks[0].nIndexEnd == nEnd + 1)
		{
			return;
		}

		XTPReportRowType nRowType = m_nRowType;
		Clear(GetNotifyOnSelectedRowsClear());
		m_nRowType = nRowType;
		if (m_nRowBlockBegin == -1) m_nRowBlockBegin = nBlockBegin;


		BOOL bSkipGroupFocus = m_pControl->IsSkipGroupsFocusEnabled();
		BOOL bHasGroups = m_pControl->GetColumns()->GetGroupsOrder()->GetCount() != 0;

		if (!bHasGroups || !bSkipGroupFocus)
		{
			_InsertBlock(0, nBegin, nEnd + 1);
		}
		else
		{
			for (int i = nBegin; i <= nEnd; i++)
			{
				CXTPReportRow* pRow = pRows->GetAt(i);
				if (!pRow)
					continue;

				if (!bSkipGroupFocus || !pRow->IsGroupRow() || !pRow->IsExpanded() || (i == nBegin) || (i == nEnd))
				{
					Add(pRow);
				}
			}
		}

		// notify owner the selection state has changed.
		_NotifyStateChanged(nBegin, nEnd);
	}
	else
	{
		int kSB = (int) m_arrSelectedBlocks.GetSize();
		if (kSB > 0)
		{
			int iMin = m_arrSelectedBlocks[0].nIndexBegin;
			int iMax = m_arrSelectedBlocks[kSB - 1].nIndexEnd;
			if (nEnd >= iMin && nEnd < iMax)
			{
				return;
			}
		}
		BOOL bSkipGroupFocus = FALSE;//m_pControl->IsSkipGroupsFocusEnabled();
		BOOL bHasGroups = m_pControl->GetColumns()->GetGroupsOrder()->GetCount() != 0;
		BOOL bWasShiftKey = m_pControl->m_bWasShiftKey;

		if (m_nRowBlockBegin != -1)
			nBlockBegin = m_nRowBlockBegin;
		int nBegin(nBlockBegin), iB, iE;
		if (nBegin == -1 || nEnd == -1)
		{
			return;
		}
		BOOL bSwap = SwapIfNeed(nBegin, nEnd);
		int nArSz = (int) m_arrSelectedBlocks.GetSize();

		CUIntArray ar;
		if (nArSz > 0)
		{
//.........这里部分代码省略.........
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:101,代码来源:XTPReportSelectedRows.cpp

示例7: GetFormatType

UINT GetFormatType(UINT nIndex)
{
	return arFormatType.GetAt(nIndex);
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:4,代码来源:STEP_api.cpp


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