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 » CExtGricCell buttons Collapse All
Subject Author Date
David Skok Feb 25, 2007 - 1:53 PM

Would it be possible to interpret an Enter keypress in a cell that contains a button as pressing the button. This would be especially handy for CExtGridCellCheckListComboBox and CExtGridCellComboBox types. I also use a custom cell that contains a drop down type button that opens a menu that I would like to make accept Enter.

Thanks

Technical Support Feb 27, 2007 - 9:51 AM

By default, the drop-down popup menu opens up when the user presses F4 or Alt+Down. Please take a look at the CExtGridCell::OnKey() virtual method where F4 is processed. You can override this method and implement any custom behavior you need.

David Skok Feb 25, 2007 - 2:40 PM

I discovered that Enter causes button to be pressed for CExtGridCellComboBox and CExtGridCellCheckListComboBox types if ModifyStyle( __EGCS_NO_INPLACE_CONTROL ) style set however does not work for CExtGridCellButton. How can I make it work with this cell type?

There is a BUG with CExtGridCellCheckListComboBox when ModifyStyle( __EGCS_NO_INPLACE_CONTROL ) is used with it. Hard to describe the problem but you can see it right away in Prof-UIS_Controls sample if you set this style in CExtGridCellCheckListComboBox column. Please take a look.

Thanks.



Technical Support Feb 27, 2007 - 9:54 AM

It is not clear what the bug you mean. When the Enter key is pressed in the opened popup list box, the current item is selected (or checked for the CExtGridCellCheckListComboBox cell) and the menu closes. Do you mean that this is incorrect?

David Skok Feb 27, 2007 - 11:44 AM

My apologies for not describing the problem clearly.

The problem is with the CExtGridCellCheckListComboBox cell type.

Set this style to the first cell in the CheckComboBox column in PROF-UIS_Controls sample:

pCellComboBox0->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );

Without activating the drop down combo, select the cell. Press Enter. The dropdown combo appears. Use either the mouse to check/uncheck items or alternately up/down arrows, space key to check/uncheck items. You will notice that the items check in the drop down but are not added/removed from the cell. When you are done, press Enter and you will see that the cell does not display the correct list of checked items here either. If you activate the dropdown with the mouse by pressing the button, the control works properly.

Technical Support Mar 1, 2007 - 9:14 AM

Thank you for reporting this issue. We have just fixed it. Please make the following changes in ExtGridWnd.cpp:

1. Open the CExtGridWnd::GridCellRectsGet method and replace the following lines

    if( pRectCellExtra != NULL )
        ::CopyRect( pRectCellExtra, &rcCell );
with these ones
   if( pRectCellExtra != NULL )
        ::CopyRect( pRectCellExtra, &rcCellExtra );
2. Find the following line in the CExtGridBaseWnd::OnGbwCalcVisibleItemRect method:
rcCalcItem.OffsetRect( nColFirstOffset, nRowFirstOffset );
Insert this line just after the above line:
rcCalcExtra.OffsetRect( nColFirstOffset, nRowFirstOffset );
3. Rebuild the library


David Skok Feb 25, 2007 - 1:55 PM

This would also work well with the CExtGridCellButton type.