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 » Grid & Tab stop in a dialog Collapse All
Subject Author Date
Offer Har Mar 4, 2009 - 3:14 AM

Dear Support,


I have a dialog with grids, and I added them to the tab order. When I walk through controls with the tab key, I know that the grid gets the focus, becuase I then can navigate in rows using the up & down keys, and edit with the F2 key etc. however, there is no visual clue that the grid got the focus, the select cell is not coloreed in the focus cell color for indication.


Is there a way to fix this?


Thanks,


Ron.

Technical Support Mar 11, 2009 - 11:30 AM

You need two things to avoid such invisible focus effect:

1) Do not forget to setup focused cell/row/column during grid initialization.

2) Handle the WM_SETFOCUS message in your grid class and check whether the CExtGridWnd::FocusGet() method returns negative row/column indices and invoke the CExtGridWnd::FocusSet() method to set focus on cells which you like.

Technical Support Mar 4, 2009 - 12:50 PM

The grid window highlights the focused cell with the standard dotted focus rectangle. This focus rectangle is displayed only when the grid window is focused. The selected cell(s) (or row(s), or column(s)) are highlighted using the standard COLOR_HIGHLIGHT Win32 color for painting selected background. This color is used only when the grid window is focused. It’s possible to make the selected grid cells highlighted COLOR_3DSHADOW color when the grid window is not selected. This can be done by applying the __EGBS_NO_HIDE_SELECTION using the CExtScrollItemWnd::SiwModifyStyle() method. So, the selection and focus highlighting in the Prof-UIS grid windows are implemented exactly like in Win32 controls. We suspect you initialized your grid window but didn’t set focus/selection to some cell(s) (or row(s), or column(s)).

Offer Har Mar 11, 2009 - 10:38 AM

When I have a dialog with many controls, and I press the tab button, and the next control is the grid control, I see nothing.


When I click on the grid,, of-course there is a focus rectangle.


The problem, my guess, is that becuase the tab sets the grid to focus, and not a mouse button, there is no cell focused, so the grid does not know what cell to draw focus to.


Is there anyway to tell the grid: ’by default cell 0,0 is the focus cell if you get from from the keyboard’. ?


Thanks,


Ron.