本文整理汇总了C++中Row::GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Row::GetProperty方法的具体用法?C++ Row::GetProperty怎么用?C++ Row::GetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row::GetProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLButtonDblClk
void EGridCtrl::OnLButtonDblClk( UINT nFlags, CPoint point )
{
Column* pCol = GetColumn( point.x , true );
if( pCol != NULL )
{
pCol->m_nWidth = 0;
std::list<Row*>::iterator iter = m_vRows.begin();
std::list<Row*>::iterator iend = m_vRows.end();
CDC* pDC = GetDC();
pDC->SelectObject(&m_Font);
while( iter != iend )
{
Row* pRow = *iter;
EProperty* pProperty = pRow->GetProperty( pCol->m_sName );
if( pProperty != NULL )
{
pCol->EnsureWidth( pProperty->GetPreferedWidth(pDC) );
}
iter++;
}
ReleaseDC(pDC);
RefreshColumnLefts( m_ViewportOrg.x );
Invalidate();
m_bWasDoubleClick = true;
}
}
示例2: BuildPropertyMap
void EGridCtrl::BuildPropertyMap()
{
//
// rebuild propertymap
//
if( m_ppPropertyMap != NULL )
{
delete m_ppPropertyMap;
}
int nNumCells = m_vCols.size() * m_vRows.size();
m_ppPropertyMap = new EProperty*[nNumCells];
EProperty** ppMap = m_ppPropertyMap;
//
//
//
std::list<Row*>::iterator rowiter = m_vRows.begin();
std::list<Row*>::iterator rowiend = m_vRows.end();
while( rowiter != rowiend )
{
Row* pRow = *rowiter;
std::list<Column*>::iterator coliter = m_vCols.begin();
std::list<Column*>::iterator coliend = m_vCols.end();
while( coliter != coliend )
{
Column* pColumn = *coliter;
*ppMap++ = pRow->GetProperty( pColumn->m_sName );
coliter++;
}
rowiter++;
}
}
示例3: OnLButtonUp
void EGridCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
if( m_bWasDoubleClick )
{
m_bWasDoubleClick = false;
return;
}
bool bOnHeaderRow = ( 0<=point.y && point.y<GetHeaderRowHeight() );
if( bOnHeaderRow ) //is on header row?
{
if( point == m_MouseDownCP ) //mouse up same place as it was down?
{
if( m_pDragColumn==NULL ) //not dragging (not on column edge)
{
Column* pColumnToSort = GetColumn( point.x ); //get column where mouse was up!
if( pColumnToSort != NULL ) //column exist here?
{
//
// clear sortstate flag for all columns
//
std::list<Column*>::iterator coliter = m_vCols.begin();
std::list<Column*>::iterator coliend = m_vCols.end();
while( coliter != coliend )
{
Column* pC = *coliter;
if( pC!=pColumnToSort ) //dont clear flag of column to sort
{
pC->m_nSortState = 0;
}
coliter++;
}
//
//
//
if( m_vRows.size() > 1 ) //more than one column, so that we can actually sort something?
{
Row* pF = m_vRows.front(); //first
Row* pL = m_vRows.back(); //last
g_sSortProperty = pColumnToSort->m_sName;
EProperty* pP1 = pF->GetProperty(g_sSortProperty);
EProperty* pP2 = pL->GetProperty(g_sSortProperty);
g_bSortGreatestAtTop = true;
if( pP1 != NULL )
{
g_bSortGreatestAtTop = !pP1->GreaterThan(pP2);
}
pColumnToSort->m_nSortState = g_bSortGreatestAtTop ? 1 : 2;
m_vRows.sort( std::greater<Row*>() );
}
else
{
pColumnToSort->m_nSortState = (pColumnToSort->m_nSortState==1) ? 2 : 1; //just flip around (only one row, so it doesn't matter, but fells nice if sort indicator flips...)
}
BuildPropertyMap();
Invalidate();
}
}
}
}
m_pDragColumn = NULL;
ReleaseCapture();
}