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 Cell button question Collapse All
Subject Author Date
Offer Har Feb 20, 2008 - 8:59 AM

Dear Support,

I have a cell with a button using __EGCS_BUTTON_ELLIPSIS.
When the user presses the button, I need it to remain pressed until the next time the user presses it (a check-box button like)
Does the grid cell support this feature?

If not, can this be implemented?

Thanks,
Ron.

Technical Support Feb 26, 2008 - 5:08 AM

You can control whether a cell button is pressed or not if you override CExtGridCell::OnQueryButtonInfo()

virtual bool OnQueryButtonInfo(
    INT nButtonType,
    bool * p_bEnabled,
    bool * p_bPressed = NULL,
    bool * p_bStayPressed = NULL,
    UINT * p_nTimerElapseValue = NULL
    ) const;
When the nButtonType is equal to __EBTT_ELLIPSIS, just assign true to the p_bPressed parameter.

Offer Har Feb 25, 2008 - 5:34 AM

OK, I will try that out, thanks.

There is another problem in this thread:

I did a small test and added the __EGCS_PRESSED_ELLIPSIS to a cell containing an ellipsis button, and saw no change in the buttons drawing.
Is there any special thing I need to do for the pressed style to be displayed?

Offer Har Feb 25, 2008 - 5:08 AM

Are you sure your reply is in the right thread?

Technical Support Feb 25, 2008 - 5:31 AM

Your question was:

Can this feature be implemented into future builds?
I cannot derive all cell types, and the button can be in any cell type, so I need to specify it in a style, something like:
__EGCS_BUTTON_CHECK_STYLE


Here is our reply:

You can create and use a template decorator class which does the needed painting and/or modifies the default behavior. You could use such a template with any grid cells. For instance, the generic CExtGridCell class does not support text and background colors. The CExtGCC template decorator class provides this feature.

Technical Support Feb 25, 2008 - 4:55 AM

You can create and use a template decorator class which does the needed painting and/or modifies the default behavior. You could use such a template with any grid cells. For instance, the generic CExtGridCell class does not support text and background colors. The CExtGCC template decorator class provides this feature.

Offer Har Feb 21, 2008 - 6:46 AM

Dear Support,

I did a small test and added the __EGCS_PRESSED_ELLIPSIS to a cell containing an ellipsis button, and saw no change in the buttons drawing.
Is there any special thing I need to do for the pressed style to be displayed?

Thanks,
Ron.

Offer Har Feb 21, 2008 - 6:39 AM

Can this feature be implemented into future builds?
I cannot derive all cell types, and the button can be in any cell type, so I need to specify it in a style, something like:
__EGCS_BUTTON_CHECK_STYLE

Technical Support Feb 21, 2008 - 5:30 AM

The ellipsis cell button was not designed as a push like check-box. The __EGCS_PRESSED_ELLIPSIS grid cell style defines the pressed state of the built-in cell’s ellipsis button. You can override the CExtGridCell::GetStyle() virtual method to emulate the constantly pressed ellipsis button. Your method should look like as follows

DWORD CYourCell::GetStyle() const
{
      ASSERT_VALID( this );
DWORD dwStyle = CBaseClass::GetStyle();
      if( state of ellipsis button is checked )
            dwStyle |= __EGCS_PRESSED_ELLIPSIS;
      return dwStyle;
}
The __EGCS_CHECKED grid cell style defines the checked state of the built-in cell’s check box. If you are not using a check box in your grid cell, then you can use the __EGCS_CHECKED grid cell style for controlling the checked state of ellipsis button:
DWORD CYourCell::GetStyle() const
{
      ASSERT_VALID( this );
DWORD dwStyle = CBaseClass::GetStyle();
      if( ( dwStyle & __EGCS_CHECKED ) != 0 )
            dwStyle |= __EGCS_PRESSED_ELLIPSIS;
      return dwStyle;
}