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 » CExtGridCellInplaceSlider slider image Collapse All
Subject Author Date
David Skok Aug 22, 2007 - 6:42 AM

Is it possible to turn the slider icon off? I want to display the slider only in the focused cell. Cells that are not focused would only display a text value.

Right now I am implementing this by populating the grid with CExtGridCellString cells then switching the cell type of the focused cell in OnGbwFocusChanged in the grid. This works however I can no longer select multiple cells as is required in my app. Switching the cell type causes problems when any type of multiple select is attempted.

Suhai Gyorgy Aug 22, 2007 - 7:11 AM

There’s a cell class CExtGridCellSlider. It seems to me it implements just what you need. Check out how it is used in ProfUIS_Controls sample.

David Skok Aug 22, 2007 - 8:49 AM

Thank you for the suggestion however CExtGridCellInplaceSlider cell type also allows direct entry by the user which my app requires. The
CExtGridCellSlider type does not.

Technical Support Aug 22, 2007 - 12:32 PM

You should use a CExtGridCellInplaceSlider-derived class which would paint slider like appearance in one case and text like appearance in other cases by implementing the following virtual method:

      virtual void OnPaintRestArea(
            const RECT & rcCellRest,
            const CExtGridWnd & wndGrid,
            CDC & dc,
            LONG nVisibleColNo,
            LONG nVisibleRowNo,
            LONG nColNo,
            LONG nRowNo,
            INT nColType,
            INT nRowType,
            const RECT & rcCellExtra,
            const RECT & rcCell,
            const RECT & rcVisibleRange,
            DWORD dwAreaFlags,
            DWORD dwHelperPaintFlags
            ) const;
Your method should invoke the CExtGridCellInplaceSlider::OnPaintRestArea() parent class method for painting the slider. It should invoke the CExtGridCellVariant::OnPaintRestArea() parent class method for painting text. The dwHelperPaintFlags parameter contains a set of __EGCPF_*** flags which provide you with all information about the selected/focused cell state.