class CGXEditControl: public CEdit, public CGXControl

The CGXEditControl class implements a text input control that can be used to display and edit text in cells. The user can modify this text in place and can change any style attributes with the CGXStyleSheet dialog.

Style attributes that 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_VALIDATE_MIN.

  • Higher bound for validation: user attribute GX_IDS_UA_VALIDATE_MAX.

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

CGXEditControl fully supports find and replace.

The default id for CGXEditControl controls is GX_IDS_CTRL_EDIT.

You can apply text to cells with

   SetStyleRange(range,
      CGXStyle()
         .SetControl(GX_IDS_CTRL_EDIT)
         .SetValue("Input Text")
         .SetMaxLength(20)
         .SetAutoSize(TRUE)
         .SetAllowEnter(TRUE)
         .SetWrapText(TRUE)
         .SetDraw3dFrame(gxFrameInset)
      );

#include <gxall.h>

See Also

 CGXGridCore::RegisterControl  CGXStyle::SetControl  CGXStyle

CGXEditControl

 Class Members