class CGXSpinEdit: public CGXEditControl

The CGXSpinEdit class implements a text input control with spin buttons. The user can modify text in place, increase or decrease the value by clicking on the spin buttons or change any style attributes with the CGXStyleSheet dialog.

Style attributes which specify the appearance of the cell are:

  • Text with SetValue.

  • Text color with SetColor.

  • Background color with SetInterior.

  • Cell frame 3d-effect (raised, inset, normal) with SetDraw3dFrame.

  • Borders with SetBorder.

  • Horizontal alignment with SetHorizontalAlignment.

  • Vertical alignment with SetVerticalAlignment.

  • Font with SetFont.

  • Read only with SetReadOnly.

  • Wordbreak with SetWrapText.

  • Maximal text length with SetMaxTextLength.

  • Vertical scrollbar with SetVertScrollBar.

  • Auto size with SetAutoSize. When auto size is enabled, the cell will grow automatically when the user enters text and the text won’t fit into the cell.

  • Interpret ENTER with SetAllowEnter. If allow enter is TRUE, pressing ENTER will start a new line in the cell. If it is FALSE, the key will be processed by the grid to move the current cell.

  • Lower bound for validation: user attribute GX_IDS_UA_VALID_MIN.

  • Higher bound for validation: user attribute GX_IDS_UA_VALID_MAX.

  • Message text to be displayed for warning message when value is invalid: user attribute GX_IDS_UA_VALIDATE_MSG.

  • Lower bound for value: user attribute GX_IDS_UA_SPINBOUND_MIN.

  • Higher bound for value: user attribute GX_IDS_UA_SPINBOUND_MAX.

  • Wrap the value when it exceeds the bound with user attribute: user attribute GX_IDS_UA_SPINBOUND_WRAP.

  • Start spin (The cell’s content will be set to this value when the user presses an arrow key on an empty cell): GX_IDS_UA_SPINEDIT_START.

Because CGXSpinEdit is derived from CGXEditControl, it fully supports find and replace.

The default id for CGXSpinEdit controls is GX_IDS_CTRL_SPINEDIT.

When the user clicks one of the buttons, the control’s OnClickedButton method is called. The default behavior of OnClickedButton is to increase or decrease the value and, finally, call CGXGridCore::OnClickedButtonRowCol.

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

#include <gxall.h>

See Also

 CGXGridCore::RegisterControl  CGXStyle::SetControl  CGXStyle

CGXSpinEdit

 Class Members