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 » CExtGridCellCheckBox & CExtGridWnd w/ __EGBS_SFB_NONE Style (2.8.3) Collapse All
Subject Author Date
Mike Van Duzee Dec 11, 2008 - 1:04 PM

A  CExtGridCellCheckBox in a  CExtGridWnd which has a __EGBS_SFB_NONE style becomes selected when the CheckBox is clicked.



This can be reproduced in the SimpleGrids application. Add “SiwModifyStyle(__EGBS_SFB_NONE, __EGBS_SFB_CELLS|__EGBS_SFB_FULL_ROWS|__EGBS_SFB_FULL_COLUMNS, true);” to CdemoGrid::_InitDemoTable_Products() after all other SiwModifyStyle/SiwModifyStyleEx/BseModifyStyle calls. Executing the application, Products Tab, Discontinued Column, Clicking the whitespace of a cell doesn’t select the cell. Enabling  or Disabling a CheckBox does.



A possible solution would be to handle the __EGBS_SFB_NONE style in CextGridCellCheckBox::OnClick(). The same code can be also found in other CextGridCell OnClick methods.



Will a fix for this item be included in the next release of Prof-UIS (2.8.4)?

Technical Support Dec 11, 2008 - 2:08 PM

We do not think this is a bug. The __EGBS_SFB_NONE style was designed for grid windows which do not have selected nor focused grid cells. Such grid window are typically used for viewing data only and contain the grid cells marked as read only.

The key events are delivered to the focused grid cell only. This is similar to the focused HWND window handle. There is only one focused window on the desktop. You can get its HWND handle using GetFocus() API. All the keyboard messages in range WM_KEYFIRST . . . WM_KEYLAST are sent to the focused window only. There is only one focused grid cell inside the grid window. You can get its location using the CExtGridBaseWnd::FocusGet() method. The keyboard messages of the focused grid window are re-translated to the virtual methods of the focused grid cell only. So, you need to make your grid window using some focus/selection model but not __EGBS_SFB_NONE.

You can use the __EGBS_SFB_CELLS focus/selection model and implement the CExtGridBaseWnd::SelectionGetForCellPainting() virtual method which should simply return false. In this case, your grid window will support selection but all the selected grid cells will look like unselected. The focused grid cell will be notified about keyboard events.