Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Add preview row to Grid? Collapse All
Subject Author Date
Chris Douglass May 16, 2005 - 6:51 AM

Hi guys, is it possible (or at least reasonably easy) to a preview line to the grid class myself?  I need to build an Outlook style email client and need this type of grid feature.  I know you guys mentioned building similar features yourselves but I need to get started on this feature ASAP.  Thanks for any input,


Chris

Technical Support May 16, 2005 - 10:35 AM

Thank you for the interesting question. The rectangular area of any cell in the grid control is really based on two rectangles: inner data rectangle and outer extra rectangle. You may have noticed that many virtual methods of the CExtGridCell class include these two arguments: rcCell and rcCellExtra. All Prof-UIS samples that demonstrate the grid control have these rectangles equal to each other. You should reserve a space at the bottom of the row and paint it as row’s preview area. The extra space sizes of the grid rows and columns are stored in the header cells. These cells are queried for the space values (in pixels) with the CExtGridCell::OnQueryExtraSpace() virtual method. Typically, the CExtGridCellHeader class is used as a header cell type. Unlike CExtGridCell, this class is able to keep extra space values. You should define a header column at the left side of your grid control. You can make it of zero width if your users don’t need to see the vertical header column at the left. You should also insert the CExtGridCellHeader cells into this header column within each inserted row. During instantiation of these header cells, invoke pHeaderCell->ExtraSpaceSet( nItemExtraSpace, true ) of each header cell ( nItemExtraSpace is the vertical space in pixels at the bottom of the row). Finally, to paint the row preview area, override the CExtScrollItemWnd::OnSiwWalkItemsH() virtual method in your CExtGridWnd-derived class. This method performs painting of all cells in one row. So, you should invoke parent’s method first, get the row preview area space from the header cell by calling pHeaderCell->ExtraSpaceGet( nItemExtraSpace, true ) and get this bottom space of the rcRowExtra rectangle (which is a parameter of the OnSiwWalkItemsH() virtual method) to draw your preview data.