class CGXPushbutton: public CGXControl

The CGXPushbutton class implements a pushbutton control which can be used in grid cells.

You can specify the text with CGXStyle::SetChoiceList and the the text color with CGXStyle::SetColor. The background color is the same as for a pushbutton in a dialog (COLOR_BUTTONFACE). The font is specified with CGXStyle::SetFont.The user can change this style setting through the CGXStyleSheet dialog (“font”-page, “color”-page and “control”-page).

When the user clicks the button, the control’s OnClickedButton method is called. The default behavior of OnClickedButton is to call CGXGridCore::OnClickedButtonRowCol.

To process this event, you can either subclass CGXPushbutton and override the control’s OnClickedButton method, or simply override OnClickedButtonRowCol in your CGXGridCore-derived class.

The default id for CGXPushbutton controls is GX_IDS_CTRL_PUSHBTN.

You can apply pushbuttons to cells with

   SetStyleRange(range,
      CGXStyle()
         .SetControl(GX_IDS_CTRL_PUSHBTN)
         .SetChoiceList("Push Me!")
      );

 

#include <gxall.h>

See Also

 CGXStyle::SetChoiceList  CGXStyle::SetInterior  CGXControl::OnClickedButton  CGXGridCore::OnClickedButtonRowCol  CGXStyle

CGXPushbutton

 Class Members