本文整理汇总了C++中CBCGPGridRow::AllowSubItems方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPGridRow::AllowSubItems方法的具体用法?C++ CBCGPGridRow::AllowSubItems怎么用?C++ CBCGPGridRow::AllowSubItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPGridRow
的用法示例。
在下文中一共展示了CBCGPGridRow::AllowSubItems方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadTooList
void CToolGridListDlg::LoadTooList()
{
if ( !IsWindow( m_wndGridTools.GetSafeHwnd() ) ) return ;
if ( m_wndGridTools.GetColumnCount() <= 0 ) return;
const int nColumns = m_wndGridTools.GetColumnCount ();
CBCGPGridRow * pRow = NULL;
map<CString,ToolObject>::iterator iter = m_ToolMap.begin();
for (; iter!=m_ToolMap.end(); iter++ )
{
pRow = m_wndGridTools.CreateRow (nColumns);
pRow->AllowSubItems ();
pRow->GetItem (0)->SetValue ((LPCTSTR)iter->second.m_strID);
pRow->GetItem (1)->SetValue ((LPCTSTR)iter->second.m_strName);
pRow->GetItem (2)->SetValue ((LPCTSTR)iter->second.m_strDescription);
pRow->GetItem (3)->SetValue ((LPCTSTR)iter->second.m_strLocalPath);
pRow->GetItem (4)->SetValue ((LPCTSTR)iter->second.m_strRunParam);
m_wndGridTools.AddRow (pRow, FALSE);
}
}
示例2: LoadHistoryList
BOOL CDlgJianmoLogin::LoadHistoryList( void )
{
if ( !IsWindow( m_wndGridHistory.GetSafeHwnd() ) ) return FALSE;
if ( m_wndGridHistory.GetColumnCount() <= 0 ) return FALSE;
m_xhm;
m_xhm.Load();
const int nColumns = m_wndGridHistory.GetColumnCount ();
CBCGPGridRow * pRow = NULL;
CCxGridButtonItem * pBtn = NULL;
for ( int i=0; i<(int)m_xhm.m_vDatas.size(); i++ )
{
pRow = m_wndGridHistory.CreateRow (nColumns);
pRow->AllowSubItems ();
pRow->GetItem (COL_NAME)->SetValue ( (LPCTSTR)m_xhm.m_vDatas[i]->m_strName );
pRow->GetItem (COL_PATH)->SetValue ( (LPCTSTR)m_xhm.m_vDatas[i]->m_strPath );
pBtn = new CCxGridButtonItem (_T("打开"), ID_GRID_BUTTON_FIRST);
pRow->ReplaceItem (COL_OP, pBtn);
m_wndGridHistory.AddRow (pRow, FALSE);
}
return TRUE;
}
示例3: FillPriceGird
//更新商品数据
//strHeader = L"商品类别|商品名称|商品编码|价格|库存|现金购物|金额|账户购物|赠送|兑换积分";
void CStoreDlg::FillPriceGird()
{
m_lpCommodityGrid->RemoveAll();
CCommodityArray CommodityArray;//待售商品队列
CCommodityQueryCondition CommodityQueryCondition;//商品查询条件
//从数据库取得库存数据
if (!CIBADAL::GetInstance()->GetPriceCommodity(CommodityArray, CommodityQueryCondition)) return;
CCommoditySoldInfoArray CommoditySoldInfoArray;
if (!CIBADAL::GetInstance()->GetCommoditySoldInfo(CommoditySoldInfoArray)) return;
//取得列数
const INT nColumns = m_lpCommodityGrid->GetColumnCount();
UINT nStoreNum = 0; //库存数量
UINT nPrePrice = 0;//先前的价格
CString strTmp;//临时变量
CBCGPGridRow* pLastGroup = NULL;
//商品记录
for (INT i = 0; i < CommodityArray.GetCount(); i++)
{ //商品信息
CCommodity & Commodity = CommodityArray.GetAt(i);
//分类头设置
UINT nPrice = Commodity.GetAdvicePrice();
if (nPrice != nPrePrice)
{
if (nStoreNum > 0)//数量大于0
{
pLastGroup->GetItem(4)->SetValue(nStoreNum);
nStoreNum = 0;
}
nPrePrice = nPrice;
//创建记录
pLastGroup = m_lpCommodityGrid->CreateRow(nColumns);
pLastGroup->AllowSubItems();// 关联式子菜单
strTmp.Format(_T("%.2f"), Commodity.GetAdvicePrice() / 100.0);
pLastGroup->GetItem(0)->SetValue(strTmp.GetString());
//添加记录
m_lpCommodityGrid->AddRow(pLastGroup, FALSE);
}
//此商品出现过
CBCGPGridRow* pCommodity = m_lpCommodityGrid->CreateRow(nColumns);
ASSERT_VALID(pCommodity);
//设置子项
pCommodity->GetItem(1)->SetValue(Commodity.GetCommodityName().GetString());
pCommodity->GetItem(2)->SetValue(Commodity.GetBarCode().GetString());
strTmp.Format(_T("%.2f"), Commodity.GetAdvicePrice() / 100.0);
pCommodity->GetItem(3)->SetValue(Commodity.GetGroupName().GetString());
pCommodity->GetItem(4)->SetValue(Commodity.GetRemainQuantity());
if (theApp.GetCurCashier()->IsOnDuty())
{
for (INT j = 0; j < CommoditySoldInfoArray.GetCount(); j++)
{
CCommoditySoldInfo CommoditySoldInfo = CommoditySoldInfoArray.GetAt(j);
if (CommoditySoldInfo.GetCommoditycode().CompareNoCase(Commodity.GetBarCode()) == 0)
{
//现金合计数量
INT nCount = CommoditySoldInfo.GetSoldCount1() + CommoditySoldInfo.GetReturnCount1();
if (nCount > 0)
{
pCommodity->GetItem(5)->SetValue(nCount);
strTmp.Format(_T("%.2f"), (CommoditySoldInfo.GetSoldAmout1() + CommoditySoldInfo.GetReturnAmout1()) / 100.0);
pCommodity->GetItem(6)->SetValue(strTmp.GetString());
}
//账户合计数量
nCount = CommoditySoldInfo.GetSoldCount2() + CommoditySoldInfo.GetReturnCount2();
if (nCount > 0)
{
pCommodity->GetItem(7)->SetValue(nCount);
}
//赠送合计数量
if (CommoditySoldInfo.GetPresentCount() > 0)
{
pCommodity->GetItem(8)->SetValue(CommoditySoldInfo.GetPresentCount());
}
if (CommoditySoldInfo.GetExchangePoint())
{
pCommodity->GetItem(9)->SetValue(CommoditySoldInfo.GetExchangePoint());
}
}
}
}
nStoreNum += Commodity.GetRemainQuantity();
pLastGroup->AddSubItem(pCommodity, FALSE);//添加子列表
}
//.........这里部分代码省略.........
示例4: FillSortGird
//更新商品数据
//strHeader = L"商品类别|商品名称|商品编码|价格|库存|现金购物|金额|账户购物|赠送|兑换积分";
void CStoreDlg::FillSortGird()
{
m_lpCommodityGrid->RemoveAll();
CCommodityArray CommodityArray;//商品队列
CCommodityQueryCondition CommodityQueryCondition;//查询条件
//取得商品库存数据和商品查询条件
if (!CIBADAL::GetInstance()->GetStoreCommodity(CommodityArray, CommodityQueryCondition)) return;
CCommoditySoldInfoArray CommoditySoldInfoArray;
if (!CIBADAL::GetInstance()->GetCommoditySoldInfo(CommoditySoldInfoArray)) return;
const INT nColumns = m_lpCommodityGrid->GetColumnCount();
INT nTmp = 0;
CString strLastGroupId;
CBCGPGridRow* pLastGroup = NULL;
for (INT i = 0; i < CommodityArray.GetCount(); i++)
{
CCommodity & CommodityInfo = CommodityArray.GetAt(i);
CString strTmp = CommodityInfo.GetGroupId();
if (strLastGroupId != strTmp)
{
if (nTmp > 0)
{
pLastGroup->GetItem(4)->SetValue(nTmp);
nTmp = 0;
}
strLastGroupId = strTmp;
pLastGroup = m_lpCommodityGrid->CreateRow(nColumns);
pLastGroup->AllowSubItems();
pLastGroup->GetItem(0)->SetValue(CommodityInfo.GetGroupName().GetString());
m_lpCommodityGrid->AddRow(pLastGroup, FALSE);
}
CBCGPGridRow* pCommodity = m_lpCommodityGrid->CreateRow(nColumns);
ASSERT_VALID(pCommodity);
pCommodity->GetItem(1)->SetValue(CommodityInfo.GetCommodityName().GetString());
pCommodity->GetItem(2)->SetValue(CommodityInfo.GetBarCode().GetString());
strTmp.Format(_T("%.2f"), CommodityInfo.GetAdvicePrice() / 100.0);
pCommodity->GetItem(3)->SetValue(strTmp.GetString());
pCommodity->GetItem(4)->SetValue(CommodityInfo.GetRemainQuantity());
if (theApp.GetCurCashier()->IsOnDuty())
{
for (INT j = 0; j < CommoditySoldInfoArray.GetCount(); j++)
{
CCommoditySoldInfo CommoditySoldInfo = CommoditySoldInfoArray.GetAt(j);
if (CommoditySoldInfo.GetCommoditycode().CompareNoCase(CommodityInfo.GetBarCode()) == 0)
{
//现金合计数量
INT nCount = CommoditySoldInfo.GetSoldCount1() + CommoditySoldInfo.GetReturnCount1();
if (nCount > 0)
{
pCommodity->GetItem(5)->SetValue(nCount);
strTmp.Format(_T("%.2f"), (CommoditySoldInfo.GetSoldAmout1() + CommoditySoldInfo.GetReturnAmout1()) / 100.0);
pCommodity->GetItem(6)->SetValue(strTmp.GetString());
}
//账户合计数量
nCount = CommoditySoldInfo.GetSoldCount2() + CommoditySoldInfo.GetReturnCount2();
if (nCount > 0)
{
pCommodity->GetItem(7)->SetValue(nCount);
}
//赠送合计数量
if (CommoditySoldInfo.GetPresentCount() > 0)
{
pCommodity->GetItem(8)->SetValue(CommoditySoldInfo.GetPresentCount());
}
if (CommoditySoldInfo.GetExchangePoint())
{
pCommodity->GetItem(9)->SetValue(CommoditySoldInfo.GetExchangePoint());
}
}
}
}
nTmp += CommodityInfo.GetRemainQuantity();
pLastGroup->AddSubItem(pCommodity, FALSE);
}
if (pLastGroup != NULL) //有商品数据
{
pLastGroup->GetItem(4)->SetValue(nTmp);
}
//.........这里部分代码省略.........
示例5: FillGird
//更新商品数据
void CDlgIBADuty::FillGird()
{
m_wndGridTree.RemoveAll();
CCommodityArray CommodityArray;//待售商品队列
CCommodityQueryCondition CommodityQueryCondition;//商品查询条件
//从数据库取得库存数据
if (!CIBADAL::GetInstance()->GetStoreCommodity(CommodityArray, CommodityQueryCondition)) return;
CCommoditySoldInfoArray CommoditySoldInfoArray;
if (!CIBADAL::GetInstance()->GetCommoditySoldInfo(CommoditySoldInfoArray))
{
//
}
//取得列数
const INT nColumns = m_wndGridTree.GetColumnCount();
INT nTmp = 0; //库存数量
CString strLastGroupId;//上一次的商品
CBCGPGridRow* pLastGroup = NULL;
//商品记录
for (INT i = 0; i < CommodityArray.GetCount(); i++)
{ //商品信息
CCommodity & Commodity = CommodityArray.GetAt(i);
//商品ID
CString strTmp = Commodity.GetGroupId();
//此商品没有出现过
if (strLastGroupId != strTmp)
{
if (nTmp > 0)//数量大于0
{
pLastGroup->GetItem(4)->SetValue(nTmp);
nTmp = 0;
}
strLastGroupId = strTmp;
//创建记录
pLastGroup = m_wndGridTree.CreateRow(nColumns);
pLastGroup->AllowSubItems();// 关联式子菜单
pLastGroup->GetItem(0)->SetValue(Commodity.GetGroupName().GetString());
//添加记录
m_wndGridTree.AddRow(pLastGroup, FALSE);
}
//此商品出现过
CBCGPGridRow* pCommodity = m_wndGridTree.CreateRow(nColumns);
ASSERT_VALID(pCommodity);
//设置子项
pCommodity->GetItem(1)->SetValue(Commodity.GetCommodityName().GetString());
pCommodity->GetItem(2)->SetValue(Commodity.GetBarCode().GetString());
strTmp.Format(_T("%.2f"), Commodity.GetAdvicePrice() / 100.0);
pCommodity->GetItem(3)->SetValue(strTmp.GetString());
pCommodity->GetItem(4)->SetValue(Commodity.GetRemainQuantity());
if (theApp.GetCurCashier()->IsOnDuty())
{
for (INT j = 0; j < CommoditySoldInfoArray.GetCount(); j++)
{
CCommoditySoldInfo CommoditySoldInfo = CommoditySoldInfoArray.GetAt(j);
if (CommoditySoldInfo.GetCommoditycode().CompareNoCase(Commodity.GetBarCode()) == 0)
{
//现金合计数量
INT nCount = CommoditySoldInfo.GetSoldCount1() + CommoditySoldInfo.GetReturnCount1();
if (nCount > 0)
{
pCommodity->GetItem(5)->SetValue(nCount);
strTmp.Format(_T("%.2f"), (CommoditySoldInfo.GetSoldAmout1() + CommoditySoldInfo.GetReturnAmout1()) / 100.0);
pCommodity->GetItem(6)->SetValue(strTmp.GetString());
}
//账户合计数量
nCount = CommoditySoldInfo.GetSoldCount2() + CommoditySoldInfo.GetReturnCount2();
if (nCount > 0)
{
pCommodity->GetItem(7)->SetValue(nCount);
}
//赠送合计数量
if (CommoditySoldInfo.GetPresentCount() > 0)
{
pCommodity->GetItem(8)->SetValue(CommoditySoldInfo.GetPresentCount());
}
if (CommoditySoldInfo.GetExchangePoint())
{
pCommodity->GetItem(9)->SetValue(CommoditySoldInfo.GetExchangePoint());
}
}
}
if (Commodity.GetStoreInQuantity() > 0)
{
pCommodity->GetItem(10)->SetValue(Commodity.GetStoreInQuantity());
pCommodity->GetItem(11)->SetValue(Commodity.GetStoreInAmount());
}
}
//.........这里部分代码省略.........