Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.
class CExtGridCell : public CObject

Remarks

The CExtGridCell class implements the basic cell type used in conjunction both with the CExtGridDataProvider-derived data provider component (like CExtGridDataProviderMemory or CExtGridDataProviderRecordset) and with the CExtGridWnd grid control. This class encapsulates the generic cell properties (defined with a set of style flags) and methods. The latter allow you implement particular behavior of the cell in any CExtGridCell-derived class. The CExtGridCell class does not keep any data such as text. For this, there are two useful cell types: CExtGridCellStringDM and CExtGridCellVariant. The CExtGridCellStringDM class keeps text data of a variable length in the dynamic memory of the data provider. The CExtGridCellVariant class stores data of the standard OLE VARIANT type.

Header

ExtGridWnd.h

Constants

The following flags, which can be accessed and modified with the CExtGridCell::GetStyle() and CExtGridCell::ModifyStyle() methods, specify basic grid cell styles:

Value Meaning
__EGCS_TA_HORZ_BY_TYPE Text inside the cell is horizontally aligned according to the data type.
__EGCS_TA_HORZ_LEFT Text inside the cell is horizontally aligned to the left.
__EGCS_TA_HORZ_RIGHT Text inside the cell is horizontally aligned to the right.
__EGCS_TA_HORZ_CENTER Text inside the cell is horizontally aligned to the center.
__EGCS_TA_HORZ_MASK Mask for the __EGCS_TA_HORZ_* styles.
__EGCS_TA_VERT_BY_TYPE Text inside the cell is vertically aligned according to the data type.
__EGCS_TA_VERT_TOP Text inside the cell is vertically aligned to the top.
__EGCS_TA_VERT_BOTTOM Text inside the cell is vertically aligned to the bottom.
__EGCS_TA_VERT_CENTER Text inside the cell is vertically aligned to the center.
__EGCS_TA_VERT_MASK Mask for the __EGCS_TA_VERT_* styles.
__EGCS_ICA_HORZ_BY_TYPE Icon and/or check box inside the cell is horizontally aligned according to the data type (by default the same as __EGCS_ICA_HORZ_CENTER).
__EGCS_ICA_HORZ_LEFT Icon and/or check box inside the cell is horizontally aligned to the left.
__EGCS_ICA_HORZ_RIGHT Icon and/or check box inside the cell is horizontally aligned to the right.
__EGCS_ICA_HORZ_CENTER Icon and/or check box inside the cell is horizontally aligned horizontally to the center (NOTE: it is only used when the text data of the cell is empty).
__EGCS_ICA_HORZ_MASK Mask for the __EGCS_ICA_HORZ_* styles.
__EGCS_ICA_VERT_BY_TYPE Icon and/or check box inside the cell is vertically aligned according to the data type (by default the same as __EGCS_ICA_VERT_CENTER).
__EGCS_ICA_VERT_TOP Icon and/or check box inside the cell is vertically aligned to the top.
__EGCS_ICA_VERT_BOTTOM Icon and/or check box inside the cell is vertically aligned to the bottom.
__EGCS_ICA_VERT_CENTER Icon and/or check box inside the cell is vertically aligned to the center.
__EGCS_ICA_VERT_MASK Mask for the __EGCS_ICA_VERT_* styles.
__EGCS_TEXT_ELLIPSIS The ellipsis (i.e. three dots) is drawn at the end of the text if there is not enough room for text.
__EGCS_HDR_ROW_COLUMN_NUMBER The row/column number is displayed in the outer (header) cell.
__EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE The space for the focus arrow in the header cell is reserved.
__EGCS_HDR_FOCUS_ARROW_DISPLAY The focus arrow in the header cell is drawn.
__EGCS_CHK_NONE The cell has neither the check box nor the radio circle.
__EGCS_CHK_CHECK Cell with the check box.
__EGCS_CHK_RADIO Cell with the radio circle.
__EGCS_CHK_INDETERMINATE Cell with the indeterminate check box.
__EGCS_CHK_MASK Mask for the __EGCS_CHK_* flags.
__EGCS_CHECKED The check box or radio circle is checked.
__EGCS_SORT_ARROW The sort arrow in the outer (header) cell is displayed.
__EGCS_SORT_DESCENDING The sort arrow points downward.
__EGCS_BUTTON_UPDOWN Cell with the built-in up/down button.
__EGCS_PRESSED_UP Top of the up/down button is pressed.
__EGCS_PRESSED_DOWN Bottom of the up/down button is pressed.
__EGCS_BUTTON_DROPDOWN Cell with the built-in drop-down button.
__EGCS_PRESSED_DROPDOWN The drop-down button is pressed.
__EGCS_BUTTON_ELLIPSIS Cell with the built-in ellipsis button.
__EGCS_PRESSED_ELLIPSIS The built-in ellipsis button is pressed.
__EGCS_READ_ONLY The cell is read only: The user cannot modify the data with the in-place editor.
__EGCS_TRACK_DROPDOWN_MENU The drop-down list box is displayed when the built-in drop-down button is clicked.
__EGCS_NO_INPLACE_CONTROL Activation of the in-place editor is suppressed.
__EGCS_DEFAULT_STYLES Specifies a set of basic cell styles for the newly created cell object.
__EGCS_COMPARE_MASK Default value of the dwStyleMask parameter of the CExtGridCell::Compare method, which is used to detect comparable basic cell styles (__EGCS_CHK_MASK|__EGCS_CHECKED).

The following flags, which can be accessed and modified with the CExtGridCell::GetStyleEx() and CExtGridCell::ModifyStyleEx() methods, specify extended grid cell styles:

Value Meaning
__EGCS_EX_DISABLE_SORT Column/row sorting when the cell is clicked is disabled. NOTE: Use for the outer (header) cells).
__EGCS_EX_DISABLE_START_DRAG Column/row drag-and-drop is disabled. NOTE: Use for the outer (header) cells).
__EGCS_EX_UNDEFINED_ROLE Undefined role. This flag is used for any cell that displays a result of combining different values. The __EGCS_EX_UNDEFINED_ROLE style makes sense when the cell is used in a report grid (the CExtPropertyGridWnd class) for displaying a property for more than two objects. When the property has different values at least for two objects, the cell displays nothing.
__EGCS_EX_NO_INPLACE_CONTROL_BORDER In-place active control has no border.
__EGCS_EX_DEFAULT_STYLES Specifies a set of extended cell styles for the newly created cell object.
__EGCS_EX_WRAP_TEXT Makes the cell multiline if the text contains \r\n symbols. The number of lines depends on the column width and text length.
__EGCS_EX_DO_NOT_PAINT_SORT_ARROW Sort arrow is not painted.
__EGCS_EX_NO_AUTO_EDIT Disable start editing automatically for a particular cell.
__EGCS_EX_EMPTY Makes the cell empty.
__EGCS_EX_VERTICAL_LAYOUT Applies the vertical layout if supported.
__EGCS_EX_REST_AREA Enforces the cell to use the area that is free of standard cell parts (icon, text, buttons, sort arrow, and focus arrow) for a built-in control.
__EGCS_EX_COMPARE_MASK Default value of the dwStyleMask parameter of the CExtGridCell::Compare method, which is used to detect comparable extended cell styles.
__EGCS_EX_AUTO_SIZE_INPLACE_CONTROL The width of the in-place text editor changes when the user types text.
__EGCS_EX_WRAP_TEXT When the user presses the Enter button in the in-place text editor, a new line is added in the editor. Should be used with __EGCS_EX_AUTO_SIZE_INPLACE_CONTROL.
__EGCS_EX_NO_INPLACE_CONTROL_SELECTION The text is not selected when the user starts editing the cell content.
__EGCS_EX_INVISIBLE Hides the cell content. Please note that this style does not remove the cell. So you can still access its content through its methods and properties.
__EGCS_EX_NO_VALIDATE_AUTO_EDIT_TEXT Cancels the first symbol checking performed by CExtGridCell::OnParseAutoEditStartText().
__EGCS_EX_MULTILINE_TEXT Provides support for multi-line text without word wrapping to the text grid cells.
__EGCS_EX_INPLACE_RICH_EDIT Makes grid cells using the rich edit control as inplace activated cell editor. For instance, the CExtGridCellSystemNumberCurrencyBase class supports the colorized rich editor.
__EGCS_EX_AUTO_BEST_FIT Makes header grid cells using the automatic best fitting algorithm for grid rows and columns if the grid control uses the __EGBS_BSE_EX_AUTO_BEST_FIT_COLUMNS and/or __EGBS_BSE_EX_AUTO_BEST_FIT_ROWS styles.

The following flags are used in the dwHelperPaintFlags parameter of the CExtGridBaseWnd::OnGbwPaintCell(), CExtGridCell::OnPaintBackground(), and CExtGridCell::OnPaintForeground() methods:

Value Meaning
__EGCPF_HOVER_BY_COLUMN Column to which the cell belongs is hovered by the mouse pointer.
__EGCPF_HOVER_BY_ROW Row to which the cell belongs is hovered by the mouse pointer.
__EGCPF_HIGHLIGHTED_BY_SELECTED_COLUMN Column to which the cell belongs contains at least one selected cell.
__EGCPF_HIGHLIGHTED_BY_SELECTED_ROW Row to which the cell belongs contains at least one selected cell.
__EGCPF_HIGHLIGHTED_BY_FOCUSED_COLUMN The Column to which the cell belongs contains the focused cell.
__EGCPF_HIGHLIGHTED_BY_FOCUSED_ROW The Row to which the cell belongs contains the focused cell.
__EGCPF_FOCUSED_CONTROL The Grid control or any kind of its child window (e.g., in-place cell editor) is focused.
__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN The Cell is highlighted by the pressed column header.
__EGCPF_HIGHLIGHTED_BY_PRESSED_ROW The Cell is highlighted by the pressed row header.
__EGCPF_OUTER_DND The Method for painting the contents of the outer (header) cell being dragged is called.

The CExtGridCell::e_button_type_t enumeration defines four constants that specify the hit-testing codes supported by the built-in buttons:

Value Meaning
__EBTT_ELLIPSIS Ellipsis button.
__EBTT_DROPDOWN Combo box-like drop-down button.
__EBTT_UPDOWN_UP Top of the built-in up/down button.
__EBTT_UPDOWN_DOWN Bottom of the built-in up/down button.

The CExtGridCell::e_cell_state_t enumeration specifies supported color types for different states of a cell. These constant are used in the following methods: TextColorSet(), TextColorGet(), BackColorSet() and BackColorGet().

Value Meaning
__ECS_ALL All states.
__ECS_NORMAL Normal (not hovered, not selected and not highlighted).
__ECS_SELECTED Selected.
__ECS_HOVERED Hovered.
__ECS_READ_ONLY Normal but read-only.
__ECS_HIGHLIGHT_PRESSING Pressed.
__ECS_HIGHLIGHT_BY_FOCUS Cell in the focused row or column.
__ECS_HIGHLIGHT_BY_SELECTION Cell in the selected row or column.
__ECS_HIGHLIGHT_BY_HOVER Cell in the hovered row or column.
__ECS_PPV Colors for printing/prevewing.
__ECS_COUNT Number of supported color types.

See Also

Class Members | Hierarchy Chart