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 » CExtGridWnd hover/highlight Collapse All
Subject Author Date
Leon Miller Sep 7, 2006 - 12:11 PM

Greetings,

I am using the CExtGridWnd class populated with CExtGridCellString type cells.

I would like to have the entire grid row (inner cells) highlight (with my custom color) when the mouse hovers
over any inner cell in that row. (My rows are comprised of only inner cells).

My grid is set up using:


    m_Grid.SiwModifyStyle(__ESIS_STH_NONE
        | __ESIS_STV_PIXEL
        | __EGBS_NO_HIDE_SELECTION
        | __EGBS_SFB_FULL_ROWS
    };

    m_Grid.HoverEventsSet( true, false );
    m_Grid.HoverHighlightSet( true, false, false, false, true, false );


I am setting up my custom hover color using the BackColorSet method:

    pCell->BackColorSet(CExtGridCell::__ECS_HOVERED, RGB(0, 0, 160));


What I observe happening is that only the cell that is under the mouse pointer is hightlighted
using my color, while all the other cells in that row are highlighted using the ?default? color.

Thanks for your help!

Suhai Gyorgy Sep 7, 2006 - 12:44 PM

I believe __EGBS_NO_HIDE_SELECTION and __EGBS_SFB_FULL_ROWS styles has to be set using BseModifyStyle instead of SiwModifyStyle.

Leon Miller Sep 7, 2006 - 4:38 PM

OK, even if I set these flags using BseModifyStyle I still cannot get the whole row to highlight using my custom color. Keep in mind the entire row does highlight but the hover cell is the only one highlighted in the custom color, I would like all cells in the row to highlight with the same color.

Suhai Gyorgy Sep 8, 2006 - 1:55 AM

I’d check the followings:

- Try setting on __EGBS_EX_HVI_HIGHLIGHT_ROWS, but that needs __EGBS_EX_HVI_EVENT_CELLS and __EGBS_EX_HVI_HIGHLIGHT_CELL flags to be set on, too. For all three you have to use SiwModifyStyleEx() method.

or:

- Try removing all default values somehow, maybe one of them confronts with the flags you are trying to set.

Suhai Gyorgy Sep 8, 2006 - 4:10 AM

One more thing you can check: By setting a breakpoint in CExtGridCell::BackColorSet() method (which does nothing at all really) and another one in CExtGCC’s inline BackColorSet, make sure that you are calling the right one. Its a little strange for me that while CExtGridCellString is derived from CExtGridCellEx (which uses CExtGCC’s BackColorSet), CExtGridCellStringDM and lots of other cell types are derived from CExtGridCell, which has a BackColorSet method doing nothing. That really confuses the user: they see that BackColorSet can be called for a CExtGridCellStringDM object, and won’t realize that method really does nothing for them.

Suhai Gyorgy Sep 8, 2006 - 2:01 AM

Sorry, I see now that
m_Grid.HoverEventsSet( true, false );
m_Grid.HoverHighlightSet( true, false, false, false, true, false );
code sets the same flags that I recommended you to set, so that idea won’t help you. :(

Leon Miller Sep 14, 2006 - 7:01 PM

Can you take a look at a sample project that I have put together to demonstrate my problem. I’m sure you could determine what I am missing fairly quickly- I am not having any luck getting full row highlighting (using a custom color), the cells do highlight, but only the cell under the mouse pointer uses the desired color for hightlighting. Thanks again.

Technical Support Sep 15, 2006 - 11:08 AM

The row highlighting color is computed inside the CExtScrollItemWnd::OnSiwGetLighterOrDarkerBrush virtual method. The method returns a reference to the brush object that is lighter/darker than the solid brush with the fill color of the system dialog (COLOR_3DFACE). The Prof-UIS grid control uses such brushes for painting the mouse hover, cell selection, and focus-based highlighting effects for the cells. So you can override this method in your grid class and return the brush you want.

Leon Miller Sep 15, 2006 - 5:15 PM

That’s it - just what I needed! Thanks for the help!