本文整理汇总了C++中CGridCtrl::GetFixedRowCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CGridCtrl::GetFixedRowCount方法的具体用法?C++ CGridCtrl::GetFixedRowCount怎么用?C++ CGridCtrl::GetFixedRowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGridCtrl
的用法示例。
在下文中一共展示了CGridCtrl::GetFixedRowCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawTreeCell
/*****************************************************************************
Allows Tree + Btn object to call drawing member
*****************************************************************************/
BOOL CGridTreeCellBase::DrawTreeCell(CDC* pDC, int nRow, int nCol, CRect* prect,
BOOL /* bEraseBkgnd */)
{
ASSERT( m_pTreeColumn != NULL);
if( !m_pTreeColumn->GetAllowDraw())
return FALSE;
CGridCtrl* pGrid = GetGrid();
if (!pGrid || !pDC)
return FALSE;
if( m_pTreeColumn->GetFixedRowCount() != pGrid->GetFixedRowCount()
|| m_pTreeColumn->GetRowCount() > pGrid->GetRowCount() )
{
ASSERT( FALSE); // if ASSERT here, this means that you a tree in a column
// but you called CGridCtrl::SetFixedRowCount() or
// or CGridCtrl::SetRowCount() directly. You can't do this.
// To change the layout of rows when you are using the tree,
// you must call CTreeColumn::Setup().
return FALSE;
}
if( prect->Width() <= 0
|| prect->Height() <= 0) // prevents imagelist item from drawing even
return FALSE; // though cell is hidden
// tree drawing graphic logic begins here
int nSavedDC = pDC->SaveDC();
if( nCol == m_pTreeColumn->GetColumnWithTree())
{
// this column has a tree
// move text over to allow for level indentation
if( IsViewable() )
{
// if row is showing, draw the tree graphic
if( m_pTreeColumn->GetTreeLines())
{
TreeDrawGraphic( pDC, // current CDC
*prect); // coordinates of bounding cell rectangle
}
else if( m_pTreeColumn->GetTreeUsesImages())
{
TREE_IMAGE TreeImage = TREE_IMAGE_DOCUMENT;
// is it not the very last row?
if( nRow + m_pTreeColumn->GetFixedRowCount() < m_pTreeColumn->GetRowCount())
{
// is it a plus or minus?
BOOL bIsPlus;
BOOL bIsMinus;
BOOL bIsLastLeaf;
if( m_pTreeColumn->TreeCellHasPlusMinus( nRow, // row of Cell to check
&bIsPlus, // returns: T=Is a plus
&bIsMinus, // returns: T=Is a minus
&bIsLastLeaf) )// returns: T=Is Last Leaf
{
// returns: T=cell has a plus or minus; F=not
if( bIsPlus)
TreeImage = TREE_IMAGE_FOLDER_CLOSED;
else
TreeImage = TREE_IMAGE_FOLDER_OPEN;
}
}
SetImage( TreeImage);
}
}
prect->left += GetTreeIndent();
}
pDC->RestoreDC(nSavedDC);
return TRUE;
}