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 » __EGCS_READ_ONLY - migration from 2.64 to 3.20 Collapse All
Subject Author Date
Mark Hatfield Jun 29, 2016 - 12:59 PM

Hi,

Recently we upgraded our software to use the latest ProfUIS verion. Prior we were using 2.64.

We have a significant amount of grids in our product. With all our grids we set the BseStyle as follows:
BseModifyStyle( __EGWS_BSE_DEFAULT, false);

This made by default, all the cells added to the grid EDITABLE. The cells which we DIDN’T want to edit, we would explicitly call:
exerciseCell->ModifyStyle(__EGCS_READ_ONLY);

In Version 2.64, setting a cell READ_ONLY did not modify the color of the text. In Version 3.20, the text gets changed to a light grey. As expected, every cell in our application now shows looking disabled.

I have tried with some success to change this behavior. However, I’m looking for suggestions.

I’m aware that I can change the BseStyle to:
BseModifyStyleEx(
__EGBS_BSE_EX_HIGHLIGHT_PRESSING_COLUMNS_OUTER | __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS, 0,
false
);

I then remove all the calls exerciseCell->ModifyStyle(__EGCS_READ_ONLY) - there are more than 500+ throughout the code. I would rather not do this. I would also have to address the cells in which I need modification permission.

I tried to change the text color for READ_ONLY to black by calling:
TextColorSet(__ECS_READ_ONLY, RGB(0, 0, 0));
in my Cell classes. This seemed to work at first, the text shows as black, until a hover over the cell (with hover shading selected), and the text goes grey, instead of staying black.

And finally, I wanted to be able to set the text color of a READ_ONLY cell at the grid level, when the cells are created. I thought I could do this by overriding CExtGridWnd::OnGridCellInplaceControlCreate in my grid class, however this doesn’t seem to be called when creating cells. (in my source, or the SimpleGrids sample)


To summarize, I’m trying to get the look I had with version 2.64 without having to remove every call to ModifyStyle(__EGCS_READ_ONLY).

Thanks!
Mark

Mark Hatfield Jul 4, 2016 - 8:51 AM

Thanks for the reply.

How do I set the text color for __ECS_SELECTED and __ECS_HOVERED for ONLY read only grid cells?

This sets for ALL read only:
TextColorSet(__ECS_READ_ONLY, RGB(0, 0, 0));

Wouldn’t:
TextColorSet(__ECS_SELECTED , RGB(0, 0, 0));
set the text color for ALL SELECTED, read only or otherwise?

TSELLC Support Jul 4, 2016 - 3:51 AM

Hi,

You should set the cell text color for __ECS_SELECTED and __ECS_HOVERED also for read only grid cells. You can rewrite "virtual CExtGridCell * GridCellGet" method CExtGridWnd class and apply your desired cell style only when pInitRTC member is valid (the cell is created now).

TSELLC_Support

Mark Hatfield Jul 4, 2016 - 8:52 AM

Reply

Thanks for the reply.

How do I set the text color for __ECS_SELECTED and __ECS_HOVERED for ONLY read only grid cells?

This sets for ALL read only:
TextColorSet(__ECS_READ_ONLY, RGB(0, 0, 0));

Wouldn’t:
TextColorSet(__ECS_SELECTED , RGB(0, 0, 0));
set the text color for ALL SELECTED, read only or otherwise?