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 » Read only grid cells Collapse All
Subject Author Date
David Skok Jun 12, 2008 - 3:01 PM

I override OnSiwPaintBackground in all of the grids in my app to paint a gradient fill.   In v2.82 grid cells with the __EGCS_READ_ONLY style had a transparent background showing the gradient through like the other cells. in v2.83 they have a fixed color of white.   In addition the methods I used to show coloring other than transparent in such cells no longer works.  How can I revert to previous behaviour?


Dave

Technical Support Jun 16, 2008 - 10:16 AM

The CExtGridCell::BackColorSet(), CExtGridCell::BackColorGet(), CExtGridCell::TextColorSet() and CExtGridCell::TextColorGet() methods in v.2.83 are exactly the same as in v.2.82. All these methods take a e_cell_state_t eCellState parameter. The CExtGridCell::e_cell_state_t enumeration was extended in v.2.83 with several new constants:

      enum e_cell_state_t
      {
            __ECS_ALL                                 = 0, // color in any state
            __ECS_NORMAL                                    = 1, // normal, not hovered, not selected, not highlighted
            __ECS_SELECTED                            = 2, // selected
            __ECS_HOVERED                             = 3, // hovered
            // next added in 2.83
            __ECS_READ_ONLY                           = 4, // normal, but read-only
            __ECS_HIGHLIGHT_PRESSING                        = 5, // pressed
            __ECS_HIGHLIGHT_BY_FOCUS                        = 6, // in the same row or column with focused
            __ECS_HIGHLIGHT_BY_SELECTION              = 7, // in the same row or column with selected
            __ECS_HIGHLIGHT_BY_HOVER                        = 8, // in the same row or column with hovered
            // total count of supported colors
            __ECS_COUNT                               = 9,
      };
Which background color types you are using in your grid cells? And which cell classes you are using?

Technical Support Jun 14, 2008 - 3:19 AM

The CExtScrollItemWnd::OnSiwPaintBackground() virtual method in v.2.83 works in the same way as in v.2.82. The CExtScrollItemWnd::OnSiwGetReadOnlyBackgroundColor() and CExtScrollItemWnd::OnSiwGetReadOnlyTextColor() virtual methods return the background/text colors of read-only grid cells. You can implement the CExtScrollItemWnd::OnSiwGetReadOnlyBackgroundColor() virtual method and return the COLORREF(-1L) value from it to make all the read-only grid cells having the default background.


David Skok Jun 16, 2008 - 7:34 AM

Thank you, that fixes read only cells that I want to have the default background like they did in v2.82 but there still is a problem.


I have some read only cells that I set the background color using BackColorSet for the cell.  This works fine in v2.82 but no longer works in v2.83.  How can I fix this?  Keep in mind that I do not set all read only cells in a single grid to the same background color.  There are different background colors for read only cells in the same grid.


Thanks, Dave