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 General Discussion » How to Highlighted CDemoColoredCell Collapse All
Subject Author Date
ven rag Oct 16, 2006 - 8:51 AM

I am using a Colored Grid using CDemoColoredCell...
The problem is when I select the particular row in the grid ,the "selected row as to be hightlighted".Since it is Colored grid I think the back color is
White and the selected row is not highlighted..


I have used

m_wndGrid.SiwModifyStyle(
        __ESIS_STH_PIXEL|__ESIS_STV_ITEM
            //|__EGBS_SFB_CELLS
            |__EGBS_SFM_FULL_ROWS
            |__EGBS_GRIDLINES
            |__EGBS_NO_HIDE_SELECTION
            |__EGBS_RESIZING_CELLS_OUTER_H
            |__EGBS_RESIZING_CELLS_INNER_H
            |__EGBS_DYNAMIC_RESIZING_H
            ,
        0,
        false
        );
    m_wndGrid.SiwModifyStyleEx(
        __EGWS_EX_PM_COLORS,
        1,
        false
        );
    BOOL bFullRowMode=TRUE,bFullHighlighting=TRUE;
    
    m_wndGrid.BseModifyStyle(
        __EGWS_BSE_SORT_COLUMNS
        |    (    ( bFullRowMode && bFullHighlighting )
                ? (        __EGWS_BSE_BUTTONS_IN_FOCUSED_CELL
                    |    __EGWS_BSE_BUTTONS_IN_FOCUSED_ROW
                    |    __EGWS_BSE_BUTTONS_IN_HOVERED_CELL
                    |    __EGWS_BSE_BUTTONS_IN_HOVERED_ROW
                    |    __EGWS_BSE_BUTTONS_IN_SELECTED_CELLS
                    |    __EGWS_BSE_BUTTONS_IN_SELECTED_ROW
                    )
                : 0 )
            ,
        __EGWS_BSE_DEFAULT,
        false
        );

But the Row is not Highlighted .....

How to Highlight the Row.???????

Thank you..

Technical Support Oct 16, 2006 - 11:55 AM

Please check that you invoked the HoverEventsSet() method to set the __EGBS_EX_HVI_EVENT_CELLS and __EGBS_EX_HVO_EVENT_CELLS styles:

HoverEventsSet( true, false );


ven rag Oct 16, 2006 - 10:59 PM

Hi

I tried out HoverEventsSet( true, false )
But it didn’t work.I want to hightlight the row which as been selected.


thank u

Technical Support Oct 18, 2006 - 8:45 AM

It is not completely clear what you are trying to do. Would you send us some screenshots that clarify the behavior you want to implement?

ven rag Oct 30, 2006 - 12:03 AM


I will explain it again...

I have a Grid Control which has alternate Colors.

for eg:-->

S.no Name Address----------------->Column name
1 abc testaddress1 ----------row1 with gray color
2 as testaddress2 ----------row2 with rose color
3 ad testaddress3 -----------row3 with gray color
4 fsf testaddress4 ----------row2 with rose color

This How I have Displayed in the Grid.
Suppose I select(ie) click or Double Click the row the Color of the Text or the Values inside row changes to "White".Due to this the Values in the row are not Visible.I want to Show that this row was Clicked or Double Clicked.I want to Highlight the row Which was Clicked or Double Clicked last .
If the Grid is not Colored one.(ie) the Grid is White in color(the Default Grid).When u Click or Double Click a particular row, then row will be highlighted blue in color.In the Same way I want to Show Which row was Click or Double Clicked in the Colored Grid.



Thank u.

Sup

Technical Support Oct 30, 2006 - 1:00 PM

To set the background and text color for the entire row in different states (selected/unselected), you should set the color for each cell in this row. The CExtGridCell class contains BackColorSet() and BackColorGet() methods that allow you to specify background colors for any grid cell when it is in the normal, hovered and selected states.
Here is the declaration of the CExtGridCell::TextColorSet() method:

virtual COLORREF TextColorSet(
 CExtGridCell::e_cell_state_t eCellState,
 COLORREF clr = COLORREF( -1L )
 );


The eCellState can be one of the following values:<pre>

__ECS_ALL - Associated color used for all cell states.
__ECS_NORMAL - Normal (unselected) state
__ECS_SELECTED - Selected state
__ECS_HOVERED - Hovered state

The CExtGridCell::BackColorSet() method has the same declaration and behavior.

ven rag Oct 31, 2006 - 8:20 AM

I have used the class CDemoColoredCell : public CExtGridCellStringDM

When I used
virtual COLORREF TextColorSet(
CExtGridCell::e_cell_state_t eCellState,
COLORREF clr = COLORREF( -1L )
);
error:
=====
CExtGridCell * pDataCell =m_wndGrid.GridCellGet(j,i,0,    0,RUNTIME_CLASS( CDemoColoredCell ));
ASSERT_VALID( pDataCell );
pDataCell->TextColorSet(__ECS_SELECTED,COLORREF( -1L ));//Error in this line as _ECS_SELECTED is undeclared identifier

How to give value to CExtGridCell::e_cell_state_t eCellState as __ECS_SELECTED in TextColorSet

Thank u.





Technical Support Oct 31, 2006 - 11:16 AM

First please derive the CDemoColoredCell from CExtGridCellString and not from CExtGridCellStringDM, because the latter does not support the TextColorSet method. Then you should use the __ECS_SELECTED constant in the following way:

CExtGridCell::__ECS_SELECTED

ven rag Oct 31, 2006 - 10:31 PM


When u told about TextColorSet u have given that the TextColorSet is a function of CExtGridCell::TextColorSet() .
note:
class __PROF_UIS_API CExtGridCellStringDM : public CExtGridCell

"CExtGridCellStringDM is derived from CExtGridCell, it has to support TextColorSet."
For that reason I have used.



thank u.

Technical Support Nov 1, 2006 - 7:41 AM

The TextColorSet() and BackColorSet() virtual methods are empty in the CExtGridCell class and there are no variables which are storing colors. So the CExtGridCell class does not hold any text/background colors. It’s a kind of lightweight class used by other derived classes. We added the CExtGCC template that allows a CExtGridCell-derived class to hold these values. The CExtGCC template is designed to decorate any CExtGridCell-derived class. It overrides these virtual methods and allows you to specify text and background colors.
There is a CExtGridCellEx class which implements a cell which is usually used as a base class for other cell objects with custom text and background colors and a custom hover cursor. But the CExtGridCellStringDM class is not derived from CExtGridCellEx and not used the CExtGCC template, that is why the TextColorSet() and BackColorSet() do not work.