The mouse-wheel input is available in Prof-UIS 2.50. The CExtGridCellUpDown
class uses it by default. The CExtGridCellComboBox
also supports the mouse-wheel input, when the enumeration mode is turned on by invoking the SetEnumMode()
method.
You can alter the text/background color by overriding the CExtPropertyGridCtrl::OnPgcCreateGrids()
virtual method in a CExtPropertyGridCtrl
-derived class. This method should be the same as the original one except for creating your version of the categorized tree grid window. In your CExtPropertyGridWndCategorized()
-derived class, please implement the CExtGridWnd::OnGridCellQueryFont()
, CExtGridWnd::OnGridCellQueryTextColor()
and/or CExtGridWnd::OnGridCellQueryBackColor()
to customize appearance of the grid cells. If the nColType
and nRowType
parameters of these methods are equal to zero, the nColNo
parameter specifies the column index of the property (0 - name column and 1 - value column) and the nRowNo
parameter specifies the row index in the tree grid. You can get a CExtPropertyItem
pointer for the nRowNo
row using the following code:
HTREEITEM hTreeItem =
ItemGetByVisibleRowIndex( nRowNo );
if( hTreeItem != NULL )
{
const CExtPropertyItem * pPropertyItem =
PropertyItemFromTreeItem( hTreeItem );
if( pPropertyItem != NULL )
{
. . .
pPropertyItem
can be either a
CExtPropertyValue
or
CExtPropertyCategory
object. So, you can detect whether you need to return font and color parameters for property values or for categories. You can even use different appearance for name and value columns.
To change the mouse click behavior, just override the
CExtTreeGridWnd::OnGbwAnalyzeCellMouseClickEvent()
method like as follows:
bool CYourCatgorizedGridWnd::OnGbwAnalyzeCellMouseClickEvent(
UINT nChar, // VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
UINT nRepCnt, // 0 - button up, 1 - single click, 2 - double click, 3 - post single click & begin editing
UINT nFlags, // mouse event flags
CPoint point // mouse pointer in client coordinates
)
{
if( nChar == VK_LBUTTON && nRepCnt == 1 )
{
CExtGridHitTestInfo htInfo( point );
HitTest( htInfo, false, true );
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
if( (! htInfo.IsHoverEmpty() ) && htInfo.IsValidRect()
&& nColType == 0 && nRowType == 0
)
{
HTREEITEM hTreeItem =
ItemGetByVisibleRowIndex( nRowNo );
if( hTreeItem == NULL )
{
const CExtPropertyItem * pPropertyItem =
PropertyItemFromTreeItem( hTreeItem );
if( pPropertyItem != NULL
&& pPropertyItem->IsKindOf( RUNTIME_CLASS(CExtPropertyCategory) )
)
{
OnTreeGridToggleItemExpandedState(
htInfo.m_nRowNo, &htInfo );
return true;
}
}
}
}
return
CExtPropertyGridWndCategorized::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point );
}