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


C++ CBCGPGridRow::GetItem方法代码示例

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


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

示例1: OnBnClickedButtonReset

/**
* 响应鼠标单击按钮;Reset
* @param void
* @return void
*/
void CTabMute::OnBnClickedButtonReset()
{
	CBCGPGridRow* pRow = NULL;
	POSITION pos= NULL;
	CMuteData oMuteData;
	COleVariant oVariant;

	pRow = m_oGridCtrlEdit.GetRow(0);
	pRow->GetItem(0)->SetValue("");
	pRow->GetItem(1)->SetValue("");

	m_oGridCtrlList.RemoveAll();	// 列表
	int iCount = m_pSiteData->m_oMuteList.m_olsMute.GetCount();
	for(int i = 0; i < iCount; i++)
	{
		pos = m_pSiteData->m_oMuteList.m_olsMute.FindIndex(i);
		oMuteData = m_pSiteData->m_oMuteList.m_olsMute.GetAt(pos);
		pRow = m_oGridCtrlList.CreateRow(m_oGridCtrlList.GetColumnCount());

		oVariant = (long)oMuteData.m_uiLineName;
		oVariant.ChangeType(VT_BSTR);
		pRow->GetItem(0)->SetValue(oVariant);

		oVariant = (long)oMuteData.m_uiPointNb;
		oVariant.ChangeType(VT_BSTR);
		pRow->GetItem(1)->SetValue(oVariant);

		m_oGridCtrlList.AddRow(pRow, FALSE);
	}
	m_oGridCtrlEdit.AdjustLayout();
	m_oGridCtrlList.AdjustLayout();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:37,代码来源:TabMute.cpp

示例2: UpdateCaptionText

void CMailView::UpdateCaptionText ()
{
	CBCGPOrganizerDoc* pDoc = GetDocument ();
	if (pDoc == NULL || pDoc->GetMode () != CBCGPOrganizerDoc::e_ModeMail)
	{
		return;
	}

	CMainFrame* pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd ());

	if (pFrame != NULL)
	{
		CString str;
		CBCGPGridCtrl* pGridCtrl = GetGridCtrl ();
		if (pGridCtrl != NULL)
		{
			CBCGPGridRow* pRow = pGridCtrl->GetCurSel ();
			if (pRow != NULL && !pRow->IsGroup ())
			{
				str = _T("From: ") + pRow->GetItem (3)->FormatItem ();
				str += _T("; Subject: ") + pRow->GetItem (4)->FormatItem ();
			}
		}

		if (str.IsEmpty ())
		{
			str = _T(" ");
		}

		pFrame->SetCaptionText (str);
	}
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:32,代码来源:MailView.cpp

示例3: OnBnClickedButtonAddB

/**
* 响应鼠标单击按钮;Add
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @return void
*/
void CTabPage::OnBnClickedButtonAddB(CBCGPGridCtrl* pGridCtrlEdit, CBCGPGridCtrl* pGridCtrlList)
{
	CBCGPGridRow* pRowEdit = NULL;	// 输入行
	CBCGPGridRow* pRowNew = NULL;	// 新行
	int iRowID = 0;

	// 得到列表当前选中行索引
	int iSelectRowIndex = GetGridListSelectRowID(pGridCtrlList);
	// 得到输入行
	pRowEdit = pGridCtrlEdit->GetRow(0);

	pRowNew = pGridCtrlList->CreateRow(pGridCtrlList->GetColumnCount());
	for(int i = 0; i < pGridCtrlList->GetColumnCount(); i++)
	{
		COleVariant oVariant = pRowEdit->GetItem(i)->GetValue();
		pRowNew->GetItem(i)->SetValue(oVariant);
	}
	if(iSelectRowIndex == -1)	// 无选中行
	{
		pGridCtrlList->AddRow(pRowNew, FALSE);
	}
	else
	{
		pGridCtrlList->InsertRowAfter(iSelectRowIndex + iRowID, pRowNew, FALSE);
	}
	pGridCtrlList->AdjustLayout();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:33,代码来源:TabPage.cpp

示例4: OnBnClickedButtonAddA

/**
* @brief 响应鼠标单击按钮;Add
* @note  该函数总是向列表框的后面追加记录。
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @param CList<int, int>* ListNb Nb号队列指针
* @return void
*/
void CGridCtrlOperation::OnBnClickedButtonAddA(CBCGPGridCtrl* pGridCtrlEdit, CBCGPGridCtrl* pGridCtrlList)
{	
	int				i;
	int				iNb;
	COleVariant		oEditVariant;
	CBCGPGridRow*	pRowEdit = NULL;	// 输入行
	CBCGPGridRow*	pRowNew = NULL;	// 新行
	int				iRowID = 0;
	CList<int, int>  ListNb;
	// 得到索引队列,增加操作
	if(false == GetIndexListForAdd(pGridCtrlEdit, &ListNb))
	{
		return;
	}

	pRowEdit = pGridCtrlEdit->GetRow(0);
	
	while(FALSE == ListNb.IsEmpty())
	{
		// 得到索引号
		iNb = ListNb.RemoveHead();
		// 索引号在列表中已经存在
		if(NULL != pGridCtrlList->FindRowByData(iNb))
		{
			continue;
		}
		pRowNew = pGridCtrlList->CreateRow(pGridCtrlList->GetColumnCount());
		pRowNew->SetData(iNb);
		oEditVariant.vt = VT_UI4;
		oEditVariant.ulVal = iNb;
		oEditVariant.ChangeType(VT_BSTR);
		pRowNew->GetItem(0)->SetValue(oEditVariant);
		for(i = 1; i < pGridCtrlList->GetColumnCount(); i++)
		{						
			oEditVariant= pRowEdit->GetItem(i)->GetValue();			
			pRowNew->GetItem(i)->SetValue(oEditVariant);
		}
		pGridCtrlList->AddRow(pRowNew, FALSE);

		/*
		if(iSelectRowIndex == -1)	// 无选中行
		{
			pGridCtrlList->AddRow(pRowNew, FALSE);
		}
		else
		{
			pGridCtrlList->InsertRowAfter(iSelectRowIndex + iRowID, pRowNew, FALSE);
			iRowID++;
		}*/
	}
	pGridCtrlList->AdjustLayout();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:60,代码来源:SetupGridCtrl.cpp

示例5: OnCreateCtrl

/**
* 生成编辑界面
* @param LPCREATESTRUCT lpCreateStruct
* @return void
*/
void CTabSpreadAbsolute::OnCreateCtrl(LPCREATESTRUCT lpCreateStruct)
{
	CRect oRect;
	CString strColumn;
	CBCGPGridRow* pRow = NULL;

	oRect.left = lpCreateStruct->x;
	oRect.top = 160;
	oRect.right = lpCreateStruct->x + lpCreateStruct->cx - 20;
	oRect.bottom = oRect.top + 46;
	m_oGridCtrlEdit.Create(WS_CHILD | WS_VISIBLE, oRect, this, IDC_GRID_EDIT);	// 编辑框
	m_oGridCtrlEdit.m_iRowHeightAdd = 5;
	m_oGridCtrlEdit.EnableColumnAutoSize(TRUE);
	m_oGridCtrlEdit.EnableDragHeaderItems(FALSE);
	m_oGridCtrlEdit.EnableHeader(TRUE, 0);
	strColumn = "Nb";
	m_oGridCtrlEdit.InsertColumn (0, strColumn, 50);
	strColumn = "Label";
	m_oGridCtrlEdit.InsertColumn (1, strColumn, 80);
	strColumn = "Absolute Spread";
	m_oGridCtrlEdit.InsertColumn (2, strColumn, 100);
	pRow = m_oGridCtrlEdit.CreateRow(m_oGridCtrlEdit.GetColumnCount());
	pRow->GetItem(0)->SetValue("");
	pRow->GetItem(1)->SetValue("");
	pRow->GetItem(2)->SetBackgroundColor(RGB(192, 192, 192));
	m_oGridCtrlEdit.AddRow(pRow, FALSE);

	oRect.top = oRect.bottom + 14;
	oRect.bottom = lpCreateStruct->y + lpCreateStruct->cy - 45;	
	m_oGridCtrlList.Create(WS_CHILD | WS_VISIBLE, oRect, this, IDC_GRID_LIST);	// 列表
	m_oGridCtrlList.m_iRowHeightAdd = 5;
	m_oGridCtrlList.ShowVertScrollBar();
	m_oGridCtrlList.EnableColumnAutoSize(TRUE);
	m_oGridCtrlList.EnableDragHeaderItems(FALSE);
	m_oGridCtrlList.EnableHeader(FALSE, 0);
	m_oGridCtrlList.SetReadOnly(TRUE);
	m_oGridCtrlList.SetWholeRowSel(TRUE);
	m_oGridCtrlList.SetSingleSel(TRUE);
	strColumn = "Nb";
	m_oGridCtrlList.InsertColumn (0, strColumn, 50);
	strColumn = "Label";
	m_oGridCtrlList.InsertColumn (1, strColumn, 80);
	strColumn = "Absolute Spread";
	m_oGridCtrlList.InsertColumn (2, strColumn, 100);

	oRect.top = lpCreateStruct->y;
	oRect.bottom = 150;
	m_oEditAbsoluteSpread.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
		oRect, this, 1);	// 绝对排列编辑框
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:55,代码来源:TabSpreadAbsolute.cpp

示例6: OnGraphViewSensorSetMute

/**
* 响应检波器图形视图弹出菜单Mute设置
* @param unsigned int uiNbLine 测线号
* @param unsigned int uiNbPoint	测点号
* @return void
*/
void CTabMute::OnGraphViewSensorSetMute(unsigned int uiNbLine, unsigned int uiNbPoint)
{
	CBCGPGridRow* pRow = NULL;
	COleVariant oVariant;
	pRow = m_oGridCtrlEdit.GetRow(0);

	oVariant = (long)uiNbLine;
	oVariant.ChangeType(VT_BSTR);
	pRow->GetItem(0)->SetValue(oVariant);

	oVariant = (long)uiNbPoint;
	oVariant.ChangeType(VT_BSTR);
	pRow->GetItem(1)->SetValue(oVariant);
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:20,代码来源:TabMute.cpp

示例7: OnCreateCtrl

/**
* 生成编辑界面
* @param LPCREATESTRUCT lpCreateStruct
* @return void
*/
void CTabFormLine::OnCreateCtrl(LPCREATESTRUCT lpCreateStruct)
{
	CRect oRect;
	CString strColumn;
	CBCGPGridRow* pRow = NULL;

	oRect.left = lpCreateStruct->x;
	oRect.top = lpCreateStruct->y;
	oRect.right = lpCreateStruct->x + lpCreateStruct->cx - 20;
	oRect.bottom = lpCreateStruct->y + 46;
	m_oGridCtrlEdit.Create(WS_CHILD | WS_VISIBLE, oRect, this, IDC_GRID_EDIT);	// 编辑行
	m_oGridCtrlEdit.m_iRowHeightAdd = 5;
	m_oGridCtrlEdit.EnableColumnAutoSize(TRUE);
	m_oGridCtrlEdit.EnableDragHeaderItems(FALSE);
	m_oGridCtrlEdit.EnableHeader(TRUE, 0);
	strColumn = "Nb";
	m_oGridCtrlEdit.InsertColumn (0, strColumn, 50);
	strColumn = "BoxType";
	m_oGridCtrlEdit.InsertColumn (1, strColumn, 50);
	strColumn = "Serial Nb";
	m_oGridCtrlEdit.InsertColumn (2, strColumn, 50);
	pRow = m_oGridCtrlEdit.CreateRow(m_oGridCtrlEdit.GetColumnCount());
	pRow->GetItem(0)->SetValue("");
	pRow->GetItem(1)->SetValue("");
	// 初始化BoxType单元格
	InitBoxTypeGridItem(pRow->GetItem(1));
	pRow->GetItem(2)->SetValue("");
	m_oGridCtrlEdit.AddRow(pRow, FALSE);

	oRect.left = lpCreateStruct->x;
	oRect.top = lpCreateStruct->y + 60;
	oRect.right = lpCreateStruct->x + lpCreateStruct->cx - 20;
	oRect.bottom = lpCreateStruct->y + lpCreateStruct->cy - 25;
	m_oGridCtrlList.Create(WS_CHILD | WS_VISIBLE, oRect, this, IDC_GRID_LIST);	// 列表
	m_oGridCtrlList.m_iRowHeightAdd = 5;
	m_oGridCtrlList.ShowVertScrollBar();
	m_oGridCtrlList.EnableColumnAutoSize(TRUE);
	m_oGridCtrlList.EnableDragHeaderItems(FALSE);
	m_oGridCtrlList.EnableHeader(FALSE, 0);
	m_oGridCtrlList.SetReadOnly(TRUE);
	m_oGridCtrlList.SetWholeRowSel(TRUE);
	m_oGridCtrlList.SetSingleSel(TRUE);
	strColumn = "Nb";
	m_oGridCtrlList.InsertColumn (0, strColumn, 50);
	strColumn = "BoxType";
	m_oGridCtrlList.InsertColumn (1, strColumn, 50);
	strColumn = "Serial Nb";
	m_oGridCtrlList.InsertColumn (2, strColumn, 50);
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:54,代码来源:TabFormLine.cpp

示例8: OnGridCtrlListDblClkA

/**
* 响应鼠标单击双击列表
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @return void
*/
void CTabPage::OnGridCtrlListDblClkA(CBCGPGridCtrl* pGridCtrlEdit, CBCGPGridCtrl* pGridCtrlList)
{
	CBCGPGridRow* pRow = pGridCtrlList->GetCurSel();
	if(NULL != pRow)
	{
		COleVariant oVariant = pRow->GetItem(0)->GetValue();
		oVariant.ChangeType(VT_BSTR);
		pGridCtrlEdit->GetRow(0)->GetItem(0)->SetValue(oVariant);
		for(int i = 1; i < pGridCtrlList->GetColumnCount(); i++)
		{
			oVariant = pRow->GetItem(i)->GetValue();
			pGridCtrlEdit->GetRow(0)->GetItem(i)->SetValue(oVariant);
		}
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:21,代码来源:TabPage.cpp

示例9: OnGridItemClick

/**
 * @brief 单击列表框中某一条目
 * @note  
 * @param  CGridCtrlEdit* pGridEdit
 * @param  CGridCtrlList* pGridList
 * @return 
 */
void  CGridCtrlOperation::OnGridItemClick(CGridCtrlEdit* pGridEdit,CGridCtrlList* pGridList)
{
	if(!pGridList || !pGridEdit)
		return;
	CBCGPGridRow* pRowList = pGridList->GetCurSel();
	if(!pRowList)
		return ;
	CBCGPGridRow* pRowEdit = pGridEdit->GetRow(0);
	if(!pRowEdit)
		return ;
	COleVariant oVariant = pRowList->GetItem(0)->GetValue();
	oVariant.ChangeType(VT_BSTR);
	pRowEdit->GetItem(0)->SetValue(oVariant);	
	
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:22,代码来源:SetupGridCtrl.cpp

示例10: OnGraphViewInstrumentSetMarker

/**
* 响应仪器图形视图弹出菜单设置标记点
* @param unsigned int uiInstrumentType 仪器类型 1-交叉站;2-电源站;3-采集站
* @param unsigned int uiSN 仪器设备号
* @return void
*/
void CTabMarker::OnGraphViewInstrumentSetMarker(unsigned int uiInstrumentType, unsigned int uiSN)
{
	CBCGPGridRow* pRow = NULL;
	pRow = m_oGridCtrlEdit.GetRow(0);
	

	// 得到BoxType字符串
	CString strBoxType = m_pSiteData->GetBoxTypeStringByID(uiInstrumentType);
	COleVariant oVariant = strBoxType;
	pRow->GetItem(0)->SetValue(oVariant);
	CString strSN;
	strSN.Format("%d", uiSN);
	oVariant = strSN;
	pRow->GetItem(1)->SetValue(oVariant);
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:21,代码来源:TabMarker.cpp

示例11: OnBnClickedButtonApply

/**
* 响应鼠标单击按钮;Apply
* @param void
* @return void
*/
void CTabTestLimit::OnBnClickedButtonApply()
{
	CBCGPGridRow* pRow = NULL;
	CTestLimitList* pTestLimitList = NULL;
	CString strData;
	COleVariant oVariant;
	POSITION pos = NULL;

	if(1 == m_uiAim)	// 测试对象 1-仪器;2-检波器
	{
		pTestLimitList = &m_pSiteData->m_oTestLimitListInstrument;
	}
	else if(2 == m_uiAim)	// 测试对象 1-仪器;2-检波器
	{
		pTestLimitList = &m_pSiteData->m_oTestLimitListSensor;
	}

	for(int i = 0; i < m_oGridCtrlList.GetRowCount(); i++)
	{	
		pRow = m_oGridCtrlList.GetRow(i);

		pos = pTestLimitList->m_olsTestLimit.FindIndex(i);
		CTestLimitData& oTestLimitData = pTestLimitList->m_olsTestLimit.GetAt(pos);		

		strData = pRow->GetItem(4)->GetValue();
		oTestLimitData.m_fLimit = CXMLDOMTool::ConvertStringToFloat(strData);
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:33,代码来源:TabTestLimit.cpp

示例12: OnModifyRemark

void CActiveMemberView::OnModifyRemark()
{

	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();
	if (!pRow)
	{
		return;
	}

	UINT nMemberID = pRow->GetData();

	CActiveMember ActiveMember;
	if (!CLocalServer::GetInstance()->ActiveMemberList.GetActiveMember(nMemberID, ActiveMember))
	{
		return;
	}
	
	CDlgInputParam dlgInput(this);
	dlgInput.InitParam(LOAD_STRING(IDS_MODIFY_REMARK),LOAD_STRING(IDS_REMARK),ActiveMember.GetRemark());
	if (dlgInput.DoModal() == IDOK)
	{
		ActiveMember.SetRemark( dlgInput.m_strParam );
		CLocalServer::GetInstance()->ActiveMemberList.UpdateActiveMember(ActiveMember,TRUE);
		pRow->GetItem(14)->SetValue(ActiveMember.GetRemark().GetString(), TRUE);
	}
}
开发者ID:layerfsd,项目名称:PersonalIBA,代码行数:26,代码来源:ActiveMemberView.cpp

示例13: OnInitDialog

BOOL CDlgStudentsSetting::OnInitDialog(void)
{
	CBCGPDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	CRect rectGrid;	
	m_ctrlGridLocation.GetWindowRect (&rectGrid);
	ScreenToClient (&rectGrid);
	m_wndListGrid.CreateGrid(rectGrid,this);

	m_wndListGrid.InsertColumn (0, _T(" 姓名 "), 100);			//此处的nWidth为比例,并不是真实尺寸,会随着控件宽度的变化而变化
	m_wndListGrid.InsertColumn (1, _T(" 年龄 "), 100);			//设定的列表宽度为控件宽度width*(100/(100+100+100+150+100+150+100))
	m_wndListGrid.InsertColumn (2, _T(" 籍贯 "), 100);
	m_wndListGrid.InsertColumn (3, _T(" 出生地 "), 150);
	m_wndListGrid.InsertColumn (4, _T(" 政治面貌 "), 100);
	m_wndListGrid.InsertColumn (5, _T(" 婚姻状况 "), 150);
	m_wndListGrid.InsertColumn (6, _T(" 联系电话 "), 100);

	m_ctrlEditGridLocation.GetWindowRect (&rectGrid);
	ScreenToClient (&rectGrid);
	m_wndEditGrid.CreateGrid(rectGrid,this);

	m_wndEditGrid.InsertColumn (0, _T(" 姓名 "), 100);
	m_wndEditGrid.InsertColumn (1, _T(" 年龄 "), 100);
	m_wndEditGrid.InsertColumn (2, _T(" 籍贯 "), 100);
	m_wndEditGrid.InsertColumn (3, _T(" 出生地 "), 150);
	m_wndEditGrid.InsertColumn (4, _T(" 政治面貌 "), 100);
	m_wndEditGrid.InsertColumn (4, _T(" 婚姻状况 "), 150);
	m_wndEditGrid.InsertColumn (4, _T(" 联系电话 "), 100);


	CBCGPGridRow* pRow = m_wndEditGrid.CreateRow (m_wndEditGrid.GetColumnCount ());
	CBCGPGridItem* pItem = new CBCGPGridItem (_T("中共党员"));
	pItem->AddOption (_T("中共党员"), TRUE);
	pItem->AddOption (_T("群众"), TRUE);
	// pItem->AllowEdit(FALSE);

	CImageList Cil1,Cil2; //定义大小图标像列表
	Cil1.Create(32, 32, ILC_COLOR4, 0, 4); //建立32位图像控制
	Cil1.Add(AfxGetApp()->LoadIcon(IDI_ICON1));//增加选中状态图像

	//	Cil2.Create(16,16,TRUE,0,0); //建立16位图像控制

	//	Cil2.Add(AfxGetApp()->LoadIcon(IDI_ICON1));//增加选中状态图像
	m_wndListGrid.SetImageList(&Cil1);
	pRow->GetItem(0)->SetImage(0);


	pRow->ReplaceItem (4, pItem);
	pRow->ReplaceItem (5, new CBCGPGridCheckItem (FALSE));


	m_wndEditGrid.AddRow(pRow);
	m_wndEditGrid.AdjustLayout();

	Load(members);
	return TRUE; 
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:58,代码来源:DlgStudentsSetting.cpp

示例14: LoadStudent

// 载入一个学生个人信息
void CDlgStudentsSetting::LoadStudent(CString csstudent)
{
	CString name, age, homeplace, birthplace, political, homeaddr, telephonenum;
	int n = 0;
	int m = 0;
	int p = 0;
	n = csstudent.Find(_T(" "), 0);
	name = csstudent.Mid(0, n);
	m = csstudent.Find(_T(" "), n+1);
	age = csstudent.Mid(n+1, m-n-1);
	p = csstudent.Find(_T(" "), m+1);
	homeplace = csstudent.Mid(m+1, p-m-1);
	n = csstudent.Find(_T(" "), p+1);
	birthplace = csstudent.Mid(p+1, n-p-1);
	m = csstudent.Find(_T(" "), n+1);
	political = csstudent.Mid(n+1, m-n-1);
	p = csstudent.Find(_T(" "), m+1);
	homeaddr = csstudent.Mid(m+1, p-m-1);
	n = csstudent.Find(_T(" "), p+1);
	telephonenum = csstudent.Mid(p+1, n-p-1);

	CBCGPGridRow* pRow = m_wndListGrid.CreateRow(m_wndListGrid.GetColumnCount());

	pRow->GetItem (0)->SetValue (CstringToWcharT(name));
	pRow->GetItem (1)->SetValue (CstringToWcharT(age));
	pRow->GetItem (2)->SetValue (CstringToWcharT(homeplace));
	pRow->GetItem (3)->SetValue (CstringToWcharT(birthplace));
	pRow->GetItem (4)->SetValue (CstringToWcharT(political));
	pRow->GetItem (5)->SetValue (CstringToWcharT(homeaddr));
	pRow->GetItem (6)->SetValue (CstringToWcharT(telephonenum));
	// 增加一行记录
	m_wndListGrid.AddRow(pRow);	
	m_wndListGrid.AdjustLayout();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:35,代码来源:DlgStudentsSetting.cpp

示例15: OnBnClickedButtonAddA

/**
* 响应鼠标单击按钮;Add
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @param CList<int, int>* plsNb Nb号队列指针
* @return void
*/
void CTabPage::OnBnClickedButtonAddA(CBCGPGridCtrl* pGridCtrlEdit, CBCGPGridCtrl* pGridCtrlList, CList<int, int>* plsNb)
{
	CBCGPGridRow* pRowEdit = NULL;	// 输入行
	CBCGPGridRow* pRowNew = NULL;	// 新行
	int iRowID = 0;

	// 得到索引队列,增加操作
	if(false == GetIndexListForAdd(pGridCtrlEdit, plsNb))
	{
		return;
	}
	// 得到列表当前选中行索引
	int iSelectRowIndex = GetGridListSelectRowID(pGridCtrlList);
	// 得到输入行
	pRowEdit = pGridCtrlEdit->GetRow(0);

	while(FALSE == plsNb->IsEmpty())
	{
		// 得到索引号
		int iNb = plsNb->RemoveHead();
		// 索引号在列表中已经存在
		if(NULL != pGridCtrlList->FindRowByData(iNb))
		{
			continue;
		}
		pRowNew = pGridCtrlList->CreateRow(pGridCtrlList->GetColumnCount());
		pRowNew->SetData(iNb);
		pRowNew->GetItem(0)->SetValue(iNb);
		for(int i = 1; i < pGridCtrlList->GetColumnCount(); i++)
		{
			COleVariant oVariant = pRowEdit->GetItem(i)->GetValue();
			pRowNew->GetItem(i)->SetValue(oVariant);
		}
		if(iSelectRowIndex == -1)	// 无选中行
		{
			pGridCtrlList->AddRow(pRowNew, FALSE);
		}
		else
		{
			pGridCtrlList->InsertRowAfter(iSelectRowIndex + iRowID, pRowNew, FALSE);
			iRowID++;
		}
	}
	pGridCtrlList->AdjustLayout();
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:52,代码来源:TabPage.cpp


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