cGridColumn
-------------
Wraps the interface for each grid column.
Class Hierarchy:
DFCOMAUTOMATIONOBJECT

cComAutomationObject


cCJReportColumn



cCJGridColumnDirect Known Subclasses:
cCJGridColumnRowIndicator,
cDbCJGridColumn,
Class Definition
Properties
Boolean
pbFocusable
Specifies whether the column can have focus. See ReportRecordItem.Focusable
Boolean
pbIconAlignmentSet
Tracks whether peIconAlignment has been explicitly set.
Boolean
pbTextAlignmentSet
Boolean
pbVDFEditControl
if set false, it will use the codejock edit control
tComboItemData[]
pComboItemData
Used to store combo list items before the COM object has been instanciated.
Handle
phcEditClass
Handle
phoConstraints
Create a constraints object for the column. The pvComObject for this child object
is assigned during OnCreate of the parent grid object....
ReportRecordItemConstraints for the column
Handle
phoDataSourceColumnClass
Handle
phoEdit
Handle
phoEditOptions
Create an edit options object for the column. The pvComObject for this child object
is assigned during OnCreate of the parent grid object....
ReportRecordItemEditOptions for the column
Handle
phoMaskForm
control needed to handle masking
Integer
piBindingColumn
Integer
piBindingTable
these can be set via entry_item command
Integer
piColumnId
will be assigned when the grid is registered belowd
Integer
private_Color
Grid Column Properties (private with Get/Set methods)....
specifies the column's background color (clNone = use Grid's Color)
Boolean
private_pbAllowDrag
Allows\Disallows dragging of the column, see ReportColumn.AllowDrag
Boolean
private_pbAllowRemove
Specifies whether the column can be removed from the grid at runtime, see ReportColumn.AllowRemove
Boolean
private_pbCapslock
Boolean
private_pbCheckbox
Specifies whether the column contains a CheckBox. See ReportRecordItem.HasCheckbox
Boolean
private_pbComboButton
Specifies whether the Items in the column display a combo button when selected. See ReportRecordItemEditOptions.AddComboButton
Boolean
private_pbComboEntryState
Similar to VDF Grid.Column_Combo_Entry_State. See ReportRecordItemEditOptions.ConstraintEdit
Boolean
private_pbDrawFooterDivider
Specifies whether a divider is drawn between column footers, see ReportColumn.DrawFooterDivider
Boolean
private_pbDrawHeaderDivider
Specifies whether the divider is drawn Between column headers. See ReportColumn.DrawHeaderDivider
Boolean
private_pbEditable
Specifies whether the Items in the column can be edited. See ReportColumn.Editable and ReportRecordItemEditOptions.AllowEdit
Boolean
private_pbMultiLine
Indicates whether the column supports multi-line rows. See ReportColumn.Alignment
Boolean
private_pbResizable
Indicates whether the column is resizable. See ReportColumn.Resizable
Boolean
private_pbShowInFieldChooser
Indicates If a column will appear in the FieldChooser when the column is hidden. See See ReportColumn.ShowInFieldChooser.
Boolean
private_pbVisible
Specifies whether the column is visible in the ReportControl. See ReportColumn.Visible
Integer
private_peDataType
XTPColumnAlignment
private_peFooterAlignment
Specifies the column footer text alignment. See ReportColumn.FooterAlignment
XTPColumnAlignment
private_peHeaderAlignment
Specifies the column header text alignment. See ReportColumn.HeaderAlignment
XTPColumnAlignment
private_peIconAlignment
column icon alignment. See ReportColumn.Alignment
XTPColumnAlignment
private_peTextAlignment
column text alignment. See ReportColumn.Alignment
Integer
private_piDisabledColor
specifies the disabled column's background color (clNone = use Column Color)
Integer
private_piDisabledTextColor
specifies the disabed column's text color (clNone = use Column Color)
Integer
private_piIcon
(internal) Icon ID of the image to display in column header, psImage (above)
Integer
private_piMaximumWidth
Maximum column width (If Set as positive). This only applies when AutoSize is False. See ReportColumn.MaximumWidth
Integer
private_piMaxLength
the maximum number of characters that can be entered when editing an item. See ReportControlItemEditOptions.MaxLength
Integer
private_piMinimumWidth
Specifies the minimum width that a column can be sized to If resizable. See ReportColumn.MinimumWidth
Integer
private_piWidth
Specifies the minimal default column width. See ReportColumn.Width
Handle
private_Prompt_Object
String
private_psCaption
Text caption for the column header, see ReportColumn.Caption
String
private_psFooterText
The text that is displayed in the column's footer. see ReportColumn.FooterText
String
private_psImage
Image to display in column header, see ReportColumn.Icon
String
private_psMask
Specifies the mask token characters. See VDF Grid, Form_Mask
String
private_psTooltip
Tool tip that is displayed when the mouse cursor is positioned over the column header. See ReportColumn.Tooltip
String
private_Status_Help
Integer
private_TextColor
specifies the column's text color (clNone = use Grid's Color)
Handle
private_Zoom_Object
Integer
Prompt_Button_Mode
String
Prompt_Button_Value
String
psCheckboxFalse
String
psCheckboxTrue
Functions and Procedures
Variant
AnsiValueToVariant(String sSource)
Boolean
CanNavigateIntoColumn(Boolean bForward)
returns true if keyboard navigation is allowed for this column.
pass whether the navigation is forward or backwards, return True if allowed
We don't test Entering here, which can refuse the focus. Even though you can navigate
into the column, Entering or Exiting might not allow it when the change is attempted.
String
CheckedStateToValue(Boolean bChecked)
returns a string representing the passed checked state
Integer
Color()
Integer
ColumnDisplayIndex()
This is the column displayed order of this object
tGridSortRules
ColumnSortRules()
returns a tGridSortRules type which defines the rules for sorting this column.
by default the rule is sort ascending the current column based on its datatype

ComboAddItem(String sCaption Integer iData)
========================================================================================
Methods.................................................................................
========================================================================================
ComboAddItem
Adds a member to the combo list for this column. See ReportColumn.EditOptions.Constraints.Add
sCaption - Is the value displayed in the combo list.
iData - Is the numeric data value representing the combo item.
tComboItemData[]
ComboData()
ComboData
Returns the set of combo items in the combo list for this column. See ReportColumn.EditOptions.Constraints.Constraint.Data
I decided to return the entire set of combo items in an array of struct. We could change this to provide an indexed access.

ComboDeleteData()
ComboDeleteData
Clears the combo list for this column. See ReportColumn.EditOptions.Constraints.DeleteAll
Integer
ComboFindItem(Integer iStartAt String sCaption)
Returns a match for the passed caption starting at position iStartAt

ComboInitialize()
ComboInitialize:
Rebuilds the column combo list (ReportRecordItemConstraints) from the internal array of constraint data.

Construct_Object()
Handle
ContextMenu(Handle hoMenu)
allows you to assign a different row context menu for this column. The
current default grid menu is passed in. If you return 0, no menu is used

CreateColumn(Integer iColumn)
Creates the COM column object. Called as part of grid activation

CreateCurrencyMask(Integer iLeft Integer iRight)
Can be used to set up a currency/mask for this column by passing
digits to the left and right

CreateNumericMask(Integer iLeft Integer iRight)
Can be used to set up a numric/mask for this column by passing
digits to the left and right
Handle
CustomEditObject()
returns an initialized custom VDF edit object

DatatypeEQtest(String sVal1 String sVal2 Boolean ByRef bError Boolean ByRef bIsEQ)
test if two values are valid and eq based on the passed datatype
Boolean
DEO_Object()
Can be used to determine if the column object understands the DEO interface

DrawCell(Handle hoRow Handle hoItem Handle hoMetrics Integer iRow String sValue)
called in OnComBeforeDrawRow to paint for this column
Boolean
Entering()

Entry()

Error_Report(Integer iErrNum Integer iErrLine String sErrMsg)
Use this object to trap the error and do nothing

Exit()
Boolean
Exiting()
Boolean
FormatDisplayValue(String ByRef sValue)
takes value from datasource and formats it for display.
String
FormatEditedValue(String sValue)
takes value from edit control and "unformats" it
Handle
HeaderContextMenu(Handle hoMenu)
allows you to assign a different header context menu for this column. The
current default grid menu is passed in. If you return 0, no menu is used
String
InitialValue()
Called when an initial value is needed. With simple grids this is called
when a row is inserted or appended. With dbgrids it is called for each record found
Boolean
IsColumnFocusable()
returns true of column can take the focus (focusable and editable)
Boolean
NextColumn(Handle ByRef hoCol Boolean ByRef bWrap)
Find the next column that can be navigated into. Returns byref the new column and if this is
a wrap. If return value is True if column could be found
Boolean
NotifyEndEdit(String sValue)
sent when the grid exits edit mode and the value needs to be
updated. ret true if changed
Boolean
NotifyItemChecked()
notification that a checked value has been pressed.

OnCreateColumn()
OnCreateColumn
event called at end of creation of com column object

OnEditChanging()

OnEndEdit(String sOldValue String sNewValue)
OnEndEdit
Boolean
OnEntering()
OnEntering

OnEntry()
OnEntry

OnExit()
OnExit
Boolean
OnExiting()
OnExiting
String
OnGetTooltip(Integer iRow String sValue String sText)
OnGetTooltip
Fired whenever the mouse is positioned over a grid cell belonging to this column.
iRow - Is the row number of the cell that the mouse is positioned over.
sValue - Is the current cell value of the cell that the mouse is positioned over.
sText - Is the default tooltip to be displayed
returns - The tooltip to display for the current mouse co-ordinate.
Return empty string to cancel tooltip display over this cell.

OnSelectedRowDataChanged(String sOldValue String sValue)

OnSetDisplayMetrics(Handle hoGridItemMetrics Integer iRow String ByRef sValue)
OnSetDisplayMetrics
Fired when each cell in the column is about to get painted. Use this method to customize the cell's display attributes (color etc).
hoGridItemMetrics - This is a handle to a cCJReportRecordItemMetrics object. Manipulate the properties of this objecty to modify
the display attributes of the cell being painted.
iRow - Is the row number of the row whose cell is being painted.
sValue - Is the cell text that is to be painted.
Boolean
OnValidating()
OnValidating
Boolean
pbAllowDrag()
Boolean
pbAllowRemove()
Integer
pbCapslock()
Boolean
pbCheckbox()
Boolean
pbComboButton()
Boolean
pbComboEntryState()
Boolean
pbDrawFooterDivider()
Boolean
pbDrawHeaderDivider()
Boolean
pbEditable()
Boolean
pbMultiLine()
Boolean
pbResizable()
Boolean
pbShowInFieldChooser()
Boolean
pbVisible()
Integer
peDataType()
XTPColumnAlignment
peFooterAlignment()
XTPColumnAlignment
peHeaderAlignment()
XTPColumnAlignment
peIconAlignment()
XTPColumnAlignment
peTextAlignment()
Integer
piDisabledColor()
Integer
piDisabledTextColor()
Integer
piMaximumWidth()
Integer
piMaxLength()
Integer
piMinimumWidth()
Integer
piWidth()
Boolean
PreviousColumn(Handle ByRef hoCol Boolean ByRef bWrap)
Find the previous column that can be navigated into. Returns byref the new column and if this is
a wrap. If return value is True if success

Prompt()

Prompt_Callback(Handle hoPrompt)
Handle
Prompt_Object()
String
psCaption()
String
psFooterText()
String
psImage()
String
psMask()
String
psTooltip()

ReleaseObject()
Release/destroy the COM column object. Called as part of grid deactivation
String
RowValue(Integer iRow)
Return the value for this column for the passed row. If this happens to be
a column being edited it has the edited value (i.e., the value in the edit object)
String
SelectedRowValue()
Return the value for this column for the selected row. If this happens to be
a column being edited it has the edited value (i.e., the value in the edit object)
String
SelectedRowValueBeforeEdit()
This is the before value of this column for the selected row where before means
the value before the edit is commited.

Set(Integer iValue)
========================================================================================
Property Get/Set Methods................................................................
========================================================================================
Color:
specifies the column's background color (clNone = use Grid's Color)

Set(Integer iValue)
piDisabledColor:
specifies the column's disabled background color (clNone = use Grid's Color)

Set(Integer iValue)
piDisabledTextColor:
specifies the column's disabled text color (clNone = use Grid's Color)

Set(Boolean bValue)
pbAllowDrag
Allows\Disallows dragging of the column, see ReportColumn.AllowDrag

Set(Boolean bValue)
pbAllowRemove
Allows\Disallows removing of the column, see ReportColumn.AllowRemove

Set(Boolean bOn)
pbCapslock
Set True to force data entry in this column to uppercase characters.

Set(Boolean bValue)
pbCheckbox
Specifies whether the column contains a CheckBox. See ReportRecordItem.HasCheckbox

Set(Boolean bValue)
pbComboButton
Specifies whether a combo control is used to edit this column.

Set(Boolean bValue)
pbComboEntryState
Similar to VDF Grid.Column_Combo_Entry_State. See ReportRecordItemEditOptions.ConstraintEdit

Set(Boolean bValue)
pbDrawFooterDivider
Specifies whether a divider is drawn between column footers, see ReportColumn.DrawFooterDivider.

Set(Boolean bValue)
pbDrawHeaderDivider
Specifies whether the divider is drawn Between column headers. See ReportColumn.DrawHeaderDivider

Set(Boolean bValue)
pbEditable:
Specifies whether the Items in the column can be edited. See ReportColumn.Editable and ReportRecordItemEditOptions.AllowEdit

Set(Boolean bValue)
pbMultiLine
Indicates whether the column supports multi-line rows. See ReportColumn.Alignment

Set(Boolean bValue)
pbResizable:
Indicates whether the column is resizable. See ReportColumn.Resizable

Set(Boolean bValue)
pbShowInFieldChooser
Indicates If a column will appear in the FieldChooser when the column is hidden. See See ReportColumn.ShowInFieldChooser.

Set(Boolean bValue)
pbVisible
Specifies whether the column is visible in the ReportControl. See ReportColumn.Visible

Set(Integer eType)
peDataType

Set(XTPColumnAlignment eValue)
peIconAlignment:
Column alignment. See ReportColumn.Alignment

Set(XTPColumnAlignment eValue)
peFooterAlignment
Specifies the column footer text alignment. See ReportColumn.FooterAlignment

Set(XTPColumnAlignment eValue)
peHeaderAlignment
Specifies the column header text alignment. See ReportColumn.HeaderAlignment

Set(XTPColumnAlignment eValue)
peTextAlignment:
Column alignment. See ReportColumn.Alignment

Set(Integer iValue)
piMaximumWidth
Maximum column width (If Set as positive). This only applies when AutoSize is False. See ReportColumn.MaximumWidth .

Set(Integer iValue)
piMaxLength
the maximum number of characters that can be entered when editing an item. See ReportControlItemEditOptions.MaxLength

Set(Integer iValue)
piMinimumWidth:
Specifies the minimum width that a column can be sized to If resizable. See ReportColumn.MinimumWidth

Set(Integer iValue)
piWidth:
Specifies the minimal default column width. See ReportColumn.Width

Set(String sValue)
psCaption
Text caption for the column header, see ReportColumn.psCaption

Set(String sValue)
psFooterText
The text that is displayed in the column's footer. see ReportColumn.FooterText

Set(String sValue)
psImage:
Sets the image/icon name of an icon that is displayed in the column header. See ReportColumn.Icon.

Set(String sMask)
psMask
Edit mask string.

Set(String sValue)
psTooltip
Tool tip that is displayed when the mouse cursor is positioned over the column header. See ReportColumn.Tooltip

Set(Integer iValue)
TextColor:
specifies the column's background text color (clNone = use Grid's Color)

Set(Integer iItem Handle hoPrompt)

Set(Integer iItem Handle hoZoom)

Set(String sHelp)
String
Status_Help()
Integer
TextColor()

UpdateCurrentValue(String sValue)
update value in data-source

UpdateDataSourceForSelectedRow(String sValue Boolean bPush)

UpdateDataToExternalSource(String sValue Integer iUpdateFlag Integer iFlags)

UpdateFocusFieldValue()
commit the value in the edit control without losing its focus
Boolean
Validating()
Boolean
ValueToCheckedState(String sValue)
returns boolean checked state of the passed value

Zoom()
Handle
Zoom_Object()
References (4):