//**************************************************************************** // $Module type: CLASS // $Module name: cReportControlGridColumn.pkg // $Author : Nils G. Svedmyr // Created : 2008-03-14 @ 17:56 // // Description : A wrapper class for the Report Control's cComReportColumn. // The class is used internally by the class cReportControlGrid. // // $Rev History // 2008-03-14 Module header created //**************************************************************************** // Note: If you don't have version 11.2.2 of the Report Control, you may use the 11.2.1 instead. // Of course you cannot Use both packages at the same time. // If you Use version 11.2.1 you wont be able to use the piWatermarkAlignment function // (If you have Set it in your code, it will be ignored.) //Use Codejock.ReportControl.v11.2.1.pkg Use Codejock.ReportControl.v11.2.2.pkg Use StdFont.pkg // cComFont This is a standard VDF package. Use cReportControlGridDefines.pkg { Visibility=Public } {DesignerClass=cDTGroup} { OverrideProperty=Color InitialValue=clWindow } // // Subclass (wrapper) for the RecordColumn Class. // A column in a grid (a cReportControlGrid Object). // This class is used by the cReportControlGrid class. // // NOTE: You would normally not instantiate this class. Instead // you would use the corresponding messages of the cReportControlGrid class, // with the 'Set/Get MessageName item iColumn to ...' syntax. // // These messages has been placed here as a 'safety precaution' only; // If the wrong syntax is used in a cReportControlGrid object, // when addressing a column, // e.g. 'Set Header_Label of hColumn to "Some Text"' // ...intead of the correct syntax: // 'Set Header_Label item iColumn to "Some Text"', // it will still work... // Class cReportControlGridColumn is a cComReportColumn Procedure Construct_Object Forward Send Construct_Object // Define Private Properties Send DefinePrivateProperties Property Handle phoComColumnHandle End_Procedure // Construct_Object Procedure End_Construct_Object Forward Send End_Construct_Object End_Procedure // End_Construct_Object Procedure DefinePrivateProperties { Visibility=Private DesignTime=False } Property String Private.psLabel { Visibility=Private DesignTime=False } Property Integer Private.piWidth End_Procedure // DefinePrivateProperties Procedure OnCreate Forward Send OnCreate End_Procedure // OnCreate { Visibility=Public MethodType=Property } // To set an icon for a column/header. // Syntax: Set HeaderIcon item iColumn to RC_ButtonNormal // Params: // iColumn is the column/header handle // iIcon is the in an ImageList Procedure Set HeaderIcon Integer iIcon If (not(IsComObjectCreated(Self))) Procedure_Return Set ComIcon to iIcon End_Procedure // Set HeaderIcon { MethodType=Property } // Syntax: Get HeaderIcon to iIconNumber Function HeaderIcon Returns Integer Integer iIcon Move 0 to iIcon If (not(IsComObjectCreated(Self))) Function_Return iIcon Get ComIcon to iIcon Function_Return iIcon End_Function // HeaderIcon { Visibility=Public MethodType=Property } // Set the width of a particular header column. // Syntax: // Set HeaderWidth to 300 // Note: // If pbAutoColumnSizing=True the iWidth value passed needs to be much larger than // the actual column width to be Set. // It seems like there is some sort of ratio between the grid width and the iWidth passed. // Trial and Error seems to be the way to Set the iWidth if pbAutoColumnSizing=True. // Tip: // Set pbAutoColumnSizing=False while you work out the optimal width for each column. Then // when you are satisfied, change the setting back to True. Procedure Set HeaderWidth Integer iWidth If (not(IsComObjectCreated(Self))) Procedure_Return Set ComResizable to True // This must be true to be able to change the column width. Set ComWidth to iWidth End_Procedure // HeaderWidth { MethodType=Property } // Get the width of a particular header column. // Syntax: // Get HeaderWidth to Integer Function HeaderWidth Returns Integer Integer iWidth If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComWidth to iWidth Function_Return iWidth End_Function // HeaderWidth // Same as Set HeaderWidth. Procedure Set ColumnWidth Integer iWidth Set HeaderWidth to iWidth End_Procedure // HeaderWidth // Same as Set HeaderWidth. Function ColumnWidth Returns Integer Integer iWidth Get HeaderWidth to iWidth Function_Return iWidth End_Function // ColumnWidth { Visibility=Public MethodType=Property Category=Appearance } { EnumList ="OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter" } { EnumList+="OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter" } { EnumList+="OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask" } // Aligns the text (and icons) for a particular header item. // It will override the HeaderJustificationMode and pbUseColumnJustificationModeForHeader // setting that are for all header items. // Syntax: // Set HeaderColumnJustificationMode to iMode // iMode Constants: // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter // OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter // OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask // You may use the plus sign (+) to combine constants in an expression. // Default: OLExtpAlignmentLeft // Note: This setting will override the HeaderJustificationMode and pbUseColumnJustificationModeForHeader // which are a Global settings. Procedure Set HeaderColumnJustificationMode Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComHeaderAlignment to iMode End_Procedure // Set HeaderColumnJustificationMode { MethodType=Property } // See: Procedure Set HeaderColumnJustificationMode for an explanation. Function HeaderColumnJustificationMode Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComHeaderAlignment to iMode Function_Return iMode End_Function // HeaderColumnJustificationMode { Visibility=Public MethodType=Property } // Define text for headers // Syntax: // Set HeaderLabel to "Some text" Procedure Set HeaderLabel String sLabel If (not(IsComObjectCreated(Self))) Procedure_Return Set ComCaption to sLabel End_Procedure // Set HeaderLabel { MethodType=Property } // Get the text for a header // Syntax: // Get HeaderLabel to sString Function HeaderLabel Returns String String sLabel If (not(IsComObjectCreated(Self))) Function_Return "" Get ComCaption to sLabel Function_Return sLabel End_Function // HeaderLabel { Visibility=Public MethodType=Property } // To set the footer text of the specified column. // Syntax: // Set FooterLabel to "Some text" // Note: The FooterVisibleState state must be true. Procedure Set FooterLabel String sText If (not(IsComObjectCreated(Self))) Procedure_Return Set ComFooterText to sText End_Procedure // Set FooterLabel { MethodType=Property } // See: Procedure Set FooterLabel for an explanation. Function FooterLabel Returns String String sText If (not(IsComObjectCreated(Self))) Function_Return "" Get ComFooterText to sText Function_Return sText End_Function // FooterLabel { Visibility=Public MethodType=Property } { EnumList ="OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter" } { EnumList+="OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter" } { EnumList+="OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask" } // Aligns the text (and icons) for a particular footer item. // Syntax: // Set FooterColumnJustificationMode to iMode // iMode Constants: // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter // OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter // OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask // You may use the plus sign (+) to combine constants in an expression. // Default: OLExtpAlignmentLeft Procedure Set FooterColumnJustificationMode Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComFooterAlignment to iMode End_Procedure // Set FooterColumnJustificationMode { MethodType=Property } // See: Procedure Set FooterColumnJustificationMode for an explanation. Function FooterColumnJustificationMode Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComFooterAlignment to iMode Function_Return iMode End_Function // FooterColumnJustificationMode { Visibility=Public MethodType=Property } { EnumList ="OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter" } { EnumList+="OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter" } { EnumList+="OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask" } // The property can be set for a particular column, which // will override the grid level AllColumnJustificationMode setting. // Aligns the text (and icons) for all items of the passed column. (Not the header, see // HeaderColumnJustificationMode for that). // Syntax: // Set ColumnJustificationMode to OLExtpAlignmentLeft // Constants (iMode): // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, // OLExtpAlignmentVCenter, OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, // OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter, OLExtpAlignmentIconRight, // OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, // OLExtpAlignmentIconMask // Default: OLExtpAlignmentLeft Procedure Set ColumnJustificationMode Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComAlignment to iMode End_Procedure // Set ColumnJustificationMode { MethodType=Property } Function ColumnJustificationMode Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComAlignment to iMode Function_Return iMode End_Function // ColumnJustificationMode { Visibility=Public MethodType=Property } // Specifies whether a grid column can be resized by dragging the header divider. // Syntax: // Set ColumnResizable to True/False // Default: True // Note: There is also a 'global' grid level ResizeColumnState property. Procedure Set ColumnResizable Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComResizable to bState End_Procedure // Set ColumnResizable { MethodType=Property } // See: Set ColumnResizable for an explanation. Function ColumnResizable Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComResizable to bState Function_Return bState End_Function // ColumnResizable { Visibility=Public MethodType=Property } // Set the tooltip for a column // Syntax: // Set HeaderToolTip to "Some Header tooltip text" Procedure Set HeaderToolTip String sToolTip If (not(IsComObjectCreated(Self))) Procedure_Return Set ComToolTip to sToolTip End_Procedure // Set HeaderToolTip { MethodType=Property } // Get the tooltip of a particular header item. // Syntax: // Get HeaderToolTip to sString Function HeaderToolTip Returns String String sToolTip If (not(IsComObjectCreated(Self))) Function_Return "" Set ComToolTip to sToolTip Function_Return sToolTip End_Function // HeaderToolTip { Visibility=Public MethodType=Property } // To set which edit mode should be used for items/cells in a column. // Syntax: // Set ColumnEditControlStyle to iStyle // Constants for iStyle: // RC_WordBreak Breaks words. The style automatically breaks lines between // words if a word would extend past the edge of the item rectangle. // RC_Single_Line Displays text on a single line only. // RC_Numeric Numeric digits only. // RC_Read_Only Do not allow to edit. // Note: // The property grid level pbSelectTextOnEdit or the pbColumnSelectTextOnEdit property // for the passed column number must be True for this Property to have any effect. // See Also: Specialized versions of this message; ColumnWordbreakState, // ColumnCapsLockState and ColumnNumericState. Procedure Set ColumnEditControlStyle Integer iStyle Handle hoItemEditOptions Integer iColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Set ComEditControlStyle of hoItemEditOptions to iStyle End_Procedure // Set ColumnEditControlStyle { MethodType=Property } // See: Set ColumnEditControlStyle for an explanation. Function ColumnEditControlStyle Returns Integer Integer iStyle iColumn Handle hoItemEditOptions If (not(IsComObjectCreated(Self))) Function_Return -1 Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComEditControlStyle of hoItemEditOptions to iStyle Function_Return iStyle End_Function // ColumnEditControlStyle { MethodType=Property } // Helper function for e.g. ColumnEditControlstyle. // Returns a handle to the ItemEditOptions object (VDF-side) // if it was successfull in connecting. // If unsuccessfull it Returns 0. Function IsEditOptionsObjectConnected Integer iColumn Returns Handle Variant vItemEditOptions Handle hoItemEditOptions If (not(IsComObjectCreated(Self))) Function_Return 0 Move (NullComObject()) to vItemEditOptions Get ComEditOptions of iColumn to vItemEditOptions If (IsNullComObject(vItemEditOptions)) Function_Return 0 Get phoItemEditOptions to hoItemEditOptions Set pvComObject of hoItemEditOptions to vItemEditOptions // Connect VDF-side with COM object. Function_Return hoItemEditOptions End_Function // IsEditOptionsObjectConnected // Determines if all text entered to this column from the keyboard will be // converted to upper Case. // Syntax: // Set ColumnCapsLockState to True/False // Note: The setting will _not_ format existing text, it will only control // how text can be entered into items/cells for the passed column number. Procedure Set ColumnCapsLockState Boolean bState Handle hoItemEditOptions Integer iStyle iColumn If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle to RC_CapsLock End Else Begin // Hmm, will it work to 'remove' the Capslock state from the style?? Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle to (iStyle - RC_CapsLock) End End_Procedure // Set ColumnCapsLockState // Breaks words for all items/cells in the passed column when in edit mode. // The style automatically breaks lines between words if a word would extend // past the edge of the item rectangle. // Syntax: // Set ColumnWordbreakState to True/False Procedure Set ColumnWordbreakState Boolean bState Handle hoItemEditOptions Integer iStyle iColumn If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle to RC_WordBreak End Else Begin // Hmm, will it work to 'remove' the Wordbreak state from the style?? Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle to (iStyle - RC_WordBreak) End End_Procedure // Set ColumnWordbreakState // Determines if all text entered to this column from the keyboard will be // numeric only. // Syntax: // Set ColumnNumericState to True/False // Note: It will also set the justification mode to Right. Procedure Set ColumnNumericState Boolean bState Handle hoItemEditOptions Integer iStyle iColumn If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle to RC_Numeric Set ColumnJustificationMode to OLExtpAlignmentRight End Else Begin // Hmm, will it work to 'remove' the Numeric state from the style?? Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) Begin Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle to (iStyle - RC_Numeric) Set ColumnJustificationMode to OLExtpAlignmentLeft // Default justification mode. End End End_Procedure // Set ColumnNumericState { Visibility=Public MethodType=Property } // Column variant of the 'global' grid level property pbSelectTextOnEdit. // It can be used to override the pbSelectTextOnEdit setting for a particular // column. // Syntax: // Set pbColumnSelectTextOnEdit to True/False Procedure Set pbColumnSelectTextOnEdit Boolean bState Handle hoItemEditOptions Integer iColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Set ComSelectTextOnEdit of hoItemEditOptions to bState End_Procedure // Set pbColumnSelectTextOnEdit { MethodType=Property } // See: Set pbColumnSelectTextOnEdit for an explanation. Function pbColumnSelectTextOnEdit Returns Boolean Handle hoItemEditOptions Boolean bState Integer iColumn If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComSelectTextOnEdit of hoItemEditOptions to bState Function_Return bState End_Function // pbColumnSelectTextOnEdit // Specifies if column auto sizing is on or off. // Syntax: // Set ColumnAutoSize to True/False // NOTE: When a column is added, the resizable parameter is used to set the value for // BOTH the Resizable and AutoSize Property. If these properties will have a // different value, then you will have to change the required value after the // column has been added. I.e. When the column was added you specified that // Resizable=True, If you require that Autosize = False then you need to Add code // to change this. Procedure Set ColumnAutoSize Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComAutoSize to bState End_Procedure // Set ColumnAutoSize // See: Procedure Set ColumnAutoSize for an explanation. Function ColumnAutoSize Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComAutoSize to bState Function_Return bState End_Function // ColumnAutoSize { Visibility=Public MethodType=Property } // Determines if a whole column can be edited or not. // Note: There are actually three different levels that can be used to // regulate if items/cells can be edited or not. // 1. Set pbAllowEdit at grid level (global for the entire grid) // 2. 'Set ColumnEntryState item iColumn to True/FALSE' at column // level will override the pbAllowEdit setting. // 3. 'Set EntryState item iItem to True/FALSE' at item // level will override both the pbAllowEdit and EntryState // setting at column level. // Syntax: // Set ColumnEntryState to bState Procedure Set ColumnEntryState Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComEditable to bState End_Procedure // Set ColumnEntryState { MethodType=Property } // See: Set ColumnEntryState for an explanation. Function ColumnEntryState Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComEditable to bState Function_Return bState End_Function // ColumnEntryState // Same as Set ColumnEntryState. To be compatable with the Column_Shadow_State // of the VDF DataList class (That is used by the VDF Grid class). // Syntax: // Set ColumnShadowState to True/False Procedure Set ColumnShadowState Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ColumnEntryState to (not(bState )) Set ComTag to 3 // Set tag value to 3 to indicate shadowed column. End_Procedure // Set ColumnEntryState { MethodType=Property } // Syntax: Get ColumnShadowState item iColumn to bState // See: Set ColumnShadowState for an explanation. Function ColumnShadowState Returns Boolean Integer iValue If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag to iValue Function_Return (If(iValue=3, True, False)) End_Function // ColumnShadowState // Specifies whether a column of a grid is presented as a combo form. // Syntax: // Set ColumnComboState to True/False Procedure Set ColumnComboState Boolean bState Handle hoItemEditOptions Variant vOptions Integer iColumn If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions < 1) Procedure_Return If (bState = True) Begin Send ComAddComboButton of hoItemEditOptions End Else Begin Send ComRemoveButtons of hoItemEditOptions End End_Procedure // Set ColumnComboState // Determines if column allows entry into the cell or only allows selection // of values from list. // Syntax: // Set ColumnComboEntryState to True/False Procedure Set ColumnComboEntryState Boolean bState Handle hoItemEditOptions Integer iColumn If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions < 1) Procedure_Return Set ComConstraintEdit of hoItemEditOptions to bState End_Procedure // Set ColumnComboEntryState // Specifies whether a column of a grid is presented with a prompt button. // Syntax: // Set ColumnPromptMode to True/False Procedure Set ColumnPromptMode Boolean bState Handle hoItemEditOptions Integer iColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions < 1) Procedure_Return If (bState = True) Begin Send ComAddExpandButton of hoItemEditOptions End Else Begin Send ComRemoveButtons of hoItemEditOptions End End_Procedure // Set ColumnPromptMode // To set the maximum number of characters that can be entered into // the passed column. // This will be of more interest for a db aware class variant. Procedure Set ColumnMaxLength Integer iLength Handle hoItemEditOptions Integer iColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComTag to iColumn Get IsEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Set ComMaxLength of hoItemEditOptions to iLength End_Procedure // Set ColumnMaxLength { Visibility=Public MethodType=Property } // To set if a particular column should be sortable. // Syntax: // Set pbColumnSortable to True/False // Note: There is also a grid level property 'pbAllowAllColumnSort' // If the pbColumnSortable property is used it will // override the pbAllowAllColumnSort setting. Procedure Set pbColumnSortable Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComSortable to bState End_Procedure // Set pbColumnSortable { MethodType=Property } // See: Procedure Set pbColumnSortable for an explanation. Function pbColumnSortable Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComSortable to bState Function_Return bState End_Function // pbColumnSortable { Visibility=Public MethodType=Property } // To set if a particular column should be visible or not. // Syntax: // Set pbColumnVisible to TRUE/False // Note: See also 'pbShowColumnInFieldChooser' // Depending on that setting, this column (if set to False) will be available // or not in the FieldChooser object. Procedure Set pbColumnVisible Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComVisible to bState End_Procedure // Set pbColumnVisible { MethodType=Property } // See procedure Set pbColumnVisible for an explanation. Function pbColumnVisible Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComVisible to bState Function_Return bState End_Function // pbColumnVisible { Visibility=Public MethodType=Property } // Indicates if a particular column will appear in the FieldChooser when the column // is hidden or in the "Group By Box." // Syntax: // Set pbShowColumnInFieldChooser to True/False // Note: There is also a pbShowAllColumnsInFieldChooser property at grid level that // will be used for each column where this message is not used. Procedure Set pbShowColumnInFieldChooser Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComShowInFieldChooser to bState End_Procedure // Set pbShowColumnInFieldChooser { MethodType=Property } // See procedure Set pbShowColumnInFieldChooser for an explanation. Function pbShowColumnInFieldChooser Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComShowInFieldChooser to bState Function_Return bState End_Function // pbShowColumnInFieldChooser // This is the Index of the column given when added to the ReportControl's collection // of columns. The ItemIndex starts at 0 and increments by 1 for each column in the // ReportControl. The ItemIndex will not change when the columns are moved (dragged and // dropped to another location). // The ItemIndex is used to Find and return a reference to a column. Since the Index of // the column might change frequently, the ItemIndex is used when the column needs to be // accessed. Procedure Set ColumnItemIndex Integer iValue If (not(IsComObjectCreated(Self))) Procedure_Return Set ComItemIndex to iValue End_Procedure // ColumnItemIndex // See procedure Set ColumnItemIndex for an explanation. Function ColumnItemIndex Returns Integer Integer iValue If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComItemIndex to iValue Function_Return iValue End_Function // ColumnItemIndex { Visibility=Public MethodType=Property } // Indicates if a particular column can be added to the "Group By Box". // Syntax: // Set pbColumnGroupable to True/False // Note: There is also a pbColumnsGroupable property at grid level that // shows/hides the "Group By Box". Procedure Set pbColumnGroupable Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComGroupable to bState End_Procedure // Set pbColumnGroupable { MethodType=Property } // See procedure Set pbColumnGroupable for an explanation. Function pbColumnGroupable Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComGroupable to bState Function_Return bState End_Function // pbColumnGroupable // Searches the collection of columns sequentially to find the first column matching // the specified ItemIndex. If no matching Found, NULL is returned. Function ColumnFind Integer iIndex Returns Variant Variant vColumn Handle hoReportControl hoColumnCollection Move (NullComObject()) to vColumn If (not(IsComObjectCreated(Self))) Function_Return vColumn Delegate Get Private.phoReportControl to hoReportControl // Property of the cReportControlGrid class. Get phoColumnCollection of hoReportControl to hoColumnCollection Get ComFind of hoColumnCollection iIndex to vColumn Function_Return vColumn End_Function // ColumnFind // TRF ================= // Procedure Set Size Integer iHeight Integer iWidth Set Private.piWidth to iWidth End_Procedure // Set Size { DesignTime=True } Procedure Set Label String sVal Set Private.psLabel to sVal End_Procedure // Set Label Procedure AddColumn String sHeaderLabel Handle hColumn Boolean bCreated Integer iWidth Delegate Get IsComObjectCreated to bCreated If (not(bCreated)) Function_Return 0 Delegate Get AddColumnEx sHeaderLabel "" iWidth True to hColumn Set phoComColumnHandle to hColumn End_Procedure // AddColumn Procedure OnCreate String sHeaderLabel Handle hColumn Integer iWidth Get Private.psLabel to sHeaderLabel Get Private.piWidth to iWidth Delegate Get AddColumn sHeaderLabel to hColumn Delegate Set HeaderWidth item hColumn to iWidth Delegate Set ColumnJustificationMode item hColumn to OLExtpAlignmentCenter End_Procedure // TRF ================= // End_Class // cReportControlGridColumn