本文整理汇总了C++中CBCGPGridRow类的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPGridRow类的具体用法?C++ CBCGPGridRow怎么用?C++ CBCGPGridRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBCGPGridRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDocument
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);
}
}
示例2: RebuildDestTree
//**********************************************************************
void CBCGPRibbonCustomizeRibbonPage::RebuildDestTree(DWORD_PTR dwNewSel, BOOL bExpandSel)
{
#ifndef BCGP_EXCLUDE_GRID_CTRL
if (dwNewSel == 0)
{
CBCGPGridRow* pRow = m_wndRibbonTreeDest.GetCurSel();
if (pRow != NULL)
{
dwNewSel = pRow->GetData();
}
}
m_wndRibbonTreeDest.SetRedraw(FALSE);
m_wndRibbonTreeDest.RebuildItems(m_bNoContextCategories ? 1 : m_nRibbonTabsDest, m_strMainTabs);
if (dwNewSel != 0)
{
CBCGPGridRow* pRow = m_wndRibbonTreeDest.FindRowByData(dwNewSel);
if (pRow != NULL)
{
if (bExpandSel && pRow->IsGroup())
{
pRow->Expand();
}
m_wndRibbonTreeDest.SetCurSel(pRow, FALSE);
m_wndRibbonTreeDest.EnsureVisible(pRow, TRUE);
}
}
m_wndRibbonTreeDest.SetRedraw();
m_wndRibbonTreeDest.RedrawWindow();
#endif
}
示例3: FindRowByData
void CComputerGrid::UpdateComputerInfoToRow(DWORD_PTR dwData, CComputerInfo& computer)
{
computer.SetUpdateState(CComputerInfo::EUS_NORMAL);
CBCGPGridRow* pRow = FindRowByData(dwData);
if (pRow != NULL) //已经存在的行
{
if (CheckShowCondition(computer))
{
UpdateRowData(pRow, computer);
}
else
{
RemoveRow(pRow->GetRowId()); //移除该行
}
}
else //添加新行
{
if (CheckShowCondition(computer))
{
pRow = CreateRow(GetColumnCount());
pRow->SetData(dwData);
UpdateRowData(pRow, computer);
AddRow(pRow, FALSE);
}
}
}
示例4: OnBnClickedButtongo
/************************************************************************************
函 数:
输 入:
输 出:
返 回 值:
功 能: 用户按下“GO”按钮,开始放炮。
服务器响应“GO按钮”,执行三个动作:
1、服务器程序通知服务器采集线程开始接收数据采集;
2、通知测网开始数据采集;
3、发送命令通知爆炸机点火。
修改历史:
*************************************************************************************/
void CActiveSourceView::OnBnClickedButtongo()
{
CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
CBCGPGridRow* pRow = m_wndGrid.GetCurSel();
if(!pRow)
{
// pFrm->MessageBox(_T("Select shot source!"),_T("Alarm"),MB_OK);
// cxm 2012.3.7
// theApp.WriteLog(_T("CActiveSourceView::OnBnClickedButtongo"),_T("Please first select shot source !"),LOGTYPE_WARNING,TRUE);
return;
}
// 得到网格当前选择的行号
int nRow=pRow->GetRowId();
if(nRow>=pFrm->m_AllShotSources.GetCount())
{
return;
}
// 找到震源
CShotSource* pSource = pFrm->m_AllShotSources.GetShotSource(nRow);
// 查找激活的炮点和震源对象CActiveShot,调用放炮函数
nRow = pFrm->m_AllActiveShots.FindFirstActiveShotBySource(pSource);
CActiveShot* pActiveShot = pFrm->m_AllActiveShots.GetActiveShot(nRow);
if(pActiveShot!=NULL)
{
m_btnGo.EnableWindow(FALSE);
pActiveShot->SendGeneralCMD(OPERATION_CMD_SHOTGO);
}
}
示例5: GetCurSel
//******************************************************************************************
void CArrayGrid::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CWnd::OnChar(nChar, nRepCnt, nFlags);
if (m_nDraggedColumn >= 0 || m_bTracking || m_bSelecting || nChar == 3)
{
return;
}
if (!CanBeginInplaceEditOnChar (nChar, nRepCnt, nFlags))
{
return;
}
CBCGPGridRow* pSel = GetCurSel ();
if (pSel == NULL || !pSel->IsEnabled())
{
return;
}
ASSERT_VALID (pSel);
EnsureVisible (pSel, TRUE);
SetBeginEditReason (BeginEdit_Char);
if (!EditItem (pSel))
{
return;
}
DoInplaceEditSetSel (OnInplaceEditSetSel (GetCurSelItem (pSel), BeginEdit_Char));
pSel->PushChar (nChar);
}
示例6: 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();
}
示例7: 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);
}
}
示例8: OnSiteDataInit
// 重新加载现场测道数据
void CSensorListCtrl::OnReloadSiteDataCMD()
{
// 现场数据对象初始化
OnSiteDataInit();
matrix_data::data_base_helper::device_info_map& map = data_base_helper_->get_devices_info();
matrix_data::data_base_helper::device_info_map::const_iterator itr;
matrix_data::data_base_helper::device_info di;
CBCGPGridRow* pRow = NULL;
data_base_helper_->devices_info_lock();
for(itr = map.begin(); itr != map.end(); ++itr) {
pRow = FindRowByData(itr->second.ip_, FALSE);
// 填充本次数据
if(pRow != NULL) {
SetRowData(pRow, itr->second); // 设置一行的数据
}
else {
pRow = CreateRow(GetColumnCount());
SetRowData(pRow, itr->second);
AddRow(pRow, FALSE);
}
}
// 删除没有用到的行
for(int i = (GetRowCount() - 1); i >= 0; i--) {
pRow = GetRow(i);
if(pRow != NULL) { // 找到行
di.ip_ = pRow->GetData();
if(data_base_helper_->find_device(di.ip_, di)) RemoveRow(i, FALSE);
}
}
data_base_helper_->devices_info_unlock();
AdjustLayout ();
}
示例9: GetGridCtrl
void CComputerListView::OnUnlockScreen()
{
CUnlockScreenDlg dlg;
if (dlg.DoModal() != IDOK)
{
return;
}
for (INT i = 0; i < GetGridCtrl()->GetRowCount(); i++)
{
if (!GetGridCtrl()->IsRowSelected(i))
{
continue;
}
CBCGPGridRow* pRow = GetGridCtrl()->GetRow(i);
if (!CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(pRow->GetData()))
{
CComputerInfo& ComputerInfo = CLocalServer::GetInstance()->ComputerList.GetComputer(pRow->GetData());
if (ComputerInfo.GetComputerStatus() == CComputerInfo::ECS_LOCKED)
{
CLocalServer::GetInstance()->LocalUnlockScreen(pRow->GetData(), dlg.GetPwd());
}
}
}
}
示例10: GetGridCtrl
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);
}
}
示例11: 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();
}
示例12: ScreenToClient
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;
}
示例13: OnBnClickedButtonGO
/**
* 响应鼠标单击按钮;GO
* @param void
* @return bool true:成功;false:失败
*/
bool CTabFormLine::OnBnClickedButtonGO()
{
CBCGPGridRow* pRow = m_oGridCtrlEdit.GetRow(0);
CString strData;
strData = pRow->GetItem(2)->GetValue();
m_oFormLineData.m_uiSN = CXMLDOMTool::ConvertStringToUnsignedInt(strData);
return true;
}
示例14: OnGridCtrlListLButtonDownA
/**
* 响应鼠标单击列表
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @return void
*/
void CTabPage::OnGridCtrlListLButtonDownA(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);
}
}
示例15: CreateNewRow
CBCGPGridRow* CDlgAllCheckOut::CreateNewRow()
{
CBCGPGridRow* pRow = m_GridCtrl.CreateRow(m_GridCtrl.GetColumnCount());
for (int i = 0; i < m_GridCtrl.GetColumnCount();i++)
{
pRow->GetItem(i)->AllowEdit(FALSE);
}
return pRow;
}