本文整理汇总了C++中CBCGPGridRow::GetItemCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPGridRow::GetItemCount方法的具体用法?C++ CBCGPGridRow::GetItemCount怎么用?C++ CBCGPGridRow::GetItemCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPGridRow
的用法示例。
在下文中一共展示了CBCGPGridRow::GetItemCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteRowsToArchive
//****************************************************************************************
BOOL CBCGPGridSerializeManager::WriteRowsToArchive (CArchive& archive, const CBCGPGridRange& range)
{
ASSERT (m_pOwnerGrid != NULL);
ASSERT (m_ClipboardFormatType == CF_Rows);
const int nRowCount = range.m_nBottom - range.m_nTop + 1;
if (nRowCount <= 0)
{
return FALSE;
}
const int nColCount = m_pOwnerGrid->GetColumnCount ();
if (nColCount <= 0)
{
return FALSE;
}
const int nRowOffset = max (0, range.m_nTop);
try
{
// array of rows:
// persistent CBCGPGridRow \
// int - items count | row
// array of items in the row: |
// persistent CBCGPGridItem /
//--------------------------------
// Serialize rows inside the range
//--------------------------------
for (int nRow = 0; nRow < nRowCount; nRow++)
{
//----------------
// Store row data:
//----------------
CBCGPGridRow* pRow = m_pOwnerGrid->GetRow (nRow + nRowOffset);
if (pRow == NULL)
{
return FALSE;
}
ASSERT_VALID (pRow);
archive << pRow;
const int nItemCount = min (nColCount, pRow->GetItemCount ());
archive << nItemCount;
for (int nCol = 0; nCol < nItemCount; nCol++)
{
//-----------------
// Store item data:
//-----------------
CBCGPGridItem* pItem = pRow->GetItem (nCol);
if (pItem == NULL)
{
return FALSE;
}
ASSERT_VALID (pItem);
archive << pItem;
}
}
}
catch (CArchiveException* pEx)
{
TRACE(_T("CBCGPGridSerializeManager::WriteRowsToArchive. Archive exception\r\n"));
pEx->Delete ();
return FALSE;
}
return TRUE;
}
示例2: WriteItemsToArchive
//****************************************************************************************
BOOL CBCGPGridSerializeManager::WriteItemsToArchive (CArchive& archive, const CBCGPGridRange& range)
{
// range is order
ASSERT (m_pOwnerGrid != NULL);
ASSERT (m_ClipboardFormatType == CF_Items);
const int nRowCount = range.m_nBottom - range.m_nTop + 1;
if (nRowCount <= 0)
{
return FALSE;
}
const int nColCount = range.m_nRight - range.m_nLeft + 1;
if (nColCount <= 0)
{
return FALSE;
}
const int nRowOffset = max (0, range.m_nTop);
const int nColOffset = max (0, range.m_nLeft);
const int nLastColumn = m_pOwnerGrid->GetColumnsInfo ().GetColumnCount (TRUE) - 1;
try
{
// array of items by rows:
// int - rowitems count | row
// persistent CBCGPGridItem |
//---------------------------------
// Serialize items inside the range
//---------------------------------
for (int nRow = 0; nRow < nRowCount; nRow++)
{
CBCGPGridRow* pRow = m_pOwnerGrid->GetRow (nRow + nRowOffset);
if (pRow == NULL)
{
return FALSE;
}
ASSERT_VALID (pRow);
const int nItemCount = min (range.m_nRight - range.m_nLeft + 1, pRow->GetItemCount ());
archive << nItemCount;
for (int nCol = 0; nCol < nItemCount; nCol++)
{
//-----------------
// Store item data:
//-----------------
if (nCol + nColOffset > nLastColumn)
{
return FALSE;
}
int nColIndex = m_pOwnerGrid->GetColumnsInfo ().OrderToIndex (nCol + nColOffset);
if (nColIndex == -1)
{
return FALSE;
}
CBCGPGridItem* pItem = pRow->GetItem (nColIndex);
if (pItem == NULL)
{
return FALSE;
}
ASSERT_VALID (pItem);
archive << pItem;
}
}
}
catch (CArchiveException* pEx)
{
TRACE(_T("CBCGPGridSerializeManager::WriteItemsToArchive. Archive exception\r\n"));
pEx->Delete ();
return FALSE;
}
return TRUE;
}