//**************************************************************************** // $Module type: CLASS // $Module name: cReportControlGrid.pkg // $Author : Nils G. Svedmyr // Created : 2008-01-29 @ 19:41 // // Note : Although this text is included in the cReportControlGrid.htm help doc in the // Help folder, it might be easier to read it in the Studio. // // Description : A wrapper class for the CodeJock's ReportControl component. // Which is really a fancy grid class (not dbgrid). // // Used is also the wrapper help classes; cReportControlGridColumn, // which is a column in the grid, and the cReportControlGridItem // class, which is an item/cell in the grid. // The two classes are included as 'Use xxx.pkg' // // Usage : Drag a cReportControlGrid from the Base Controls section of the Studio's Class Palette // onto a view (or dbview) object. A source skeleton will get created for you with the // most important sections to get started. You can use the Studio's Object Properties // to set a whole range of properties for the grid. // // In Procedure AddIcons; // Add icons to be used by the grid headers and for buttons in the grid // with the AddImage function: // 'Get AddImage "MyName.ico" RC_IconHeaderColumn to iRetval' // where the RC_IconHeaderColumn is a number in the icon list to be // referred to. Is a constant declared in cReportControlGridDefines.pkg // // In Procedure AddColumns; // Add columns to the grid with the AddColumn function: // 'Get AddColumn "Header label" to hColumn // You can use the returned handle (hColumn) to set more properties for the column. // // In a Procedure FillGrid; // // Add items/cells with the AddItem function: // 'Get AddItem "Some value" to iItem' // You can use the returned handle (iItem) to set properties for that particular // item/cell. E.g. Set pbIsButton item iItem to True // // Finally, when you are done with creating all items/cells you _must_ // end with a: // 'Send Populate' // The message will display all your elements on the screen, else the grid will // show up blank! // // Properties Note: // The property names that does not start with 'pb' or 'pi', are properties that // mimics existing VDF properties used by (mostly) the grid class. // // Important: NONE of the messages use underscores in their name! // That means that familiar properties like e.g. Header_Justification_Mode // and Highlight_Row_State instead are named; // HeaderJustificationMode and HighlightRowState, respectively. // WHY? Well, I have always disliked those underscored message names, // because the naming always seemed to be inconsistent, giving you more grief // than being of help reading them. // //Documentation: See also 'ClassReference.htm' in the Help folder. This is essential reading for // all available procedures and functions. // // // Syntax : // Use cReportControlGrid.pkg // // Object oReportControlGrid is a cReportControlGrid // // *** Object based properties *** // Set Size to height width // Set Location to Row Column // // Set HeaderVisibleState to True|False // Set HeaderJustificationMode to iMode // Set pbUseColumnJustificationModeForHeader to True|False // Set ResizeColumnState to True|False // Set pbAllowColumnReorder to True|False // Set pbAllowColumnRemove to True|False // Set pbAllowAllColumnSort to True|False // Set pbAllowMoveRow to True|False // Set pbShowAllColumnsInFieldChooser to True|False // Set pbAutoColumnSizing to True|False // Set pbColumnsGroupable to True|False // Set pbShowItemsInGroups to True|False // Set pbShadeGroupHeadings to True|False // Set pbSkipGroupsFocus tp True|False // Set pbFocusSubItems to True|False // Set pbDrawGridForEmptySpace to True|False // Set pbFixedRowHeight to True|False // Set pbEnableToolTips to True|False // Set Typeface to "Tahoma" // Set Fontsize to 8 // Set HeaderTypeface to "Tahoma" // Set HeaderFontsize to 8 // Set FooterTypeface to "Tahoma" // Set FooterFontsize to 8 // // Set psWatermarkBitmap to sFilename // Set piWatermarkAlignment to iAlignmentStyle // Set piWatermarkTransparancy to iPercentage // // Set BorderStyle to iBorderStyle // Set HighlightRowState to True|False // Set piReportGridStyle to iGridStyle // Set GridLineMode to iGridVisibleMode // Set peGridLineColor to RGBColor // // Set Color to RGBColor // Set TextColor to RGBColor // Set CurrentRowColor to RGBColor // Set CurrentRowTextColor to RGBColor // Set CurrentRowColorNoGridFocus to RGBColor // Set CurrentRowTextColorNoGridFocus to RGBColor // // Set EnabledState to True|False // Set pbAllowEdit to True|False // Set pbDeleteAllowed to True|False // Set pbEditOnClick to True|False // Set SelectMode to Single|Multi // Set pbUseColumnAlignmentWhenEditing to True|False // // Set HeaderVisibleState to True|False // Set piHeaderColor to RGBColor // Set piHeaderTextColor to RGBColor // Set piHeaderStyle to HeaderStyle // Set pbHotTracking to True|False // Set pbInvertColumnOnClick to True|False // Set pbShadeSortColumn to True|False // Set piShadeSortColor to RGBColor // Set pbDrawSortTriangleAlways to True|False // Set AllColumnJustificationMode to iAlignmentStyle // Set psSortByText to "Sort by text string" // Set psNoFieldsAvailableText to "The headerlist is empty" // Set psNoItemsText to "No rows to display" // Set psNoGroupByText to "No groups to display" // // Set piColumnShadowStateColor to RGBColor // Set piColumnShadowStateTextColor to RGBColor // Set piButtonDownColor to RGBColor // Set piButtonDownTextColor to RGBColor // Set piButtonBackColor to RGBColor // Set piButtonForeColor to RGBColor // // // *** Column Properties: *** // Get AddColumn to col# // // Set HeaderLabel item col# to "Header label text" // Set HeaderToolTip item col# to "Header tooltip text" // Set HeaderColumnJustificationMode item col# to iMode // Set HeaderIcon item col# to iIcon // Set HeaderWidth item col# to iWidth // Set ColumnJustificationMode item col# to iMode // Set ColumnEntryState item col# to True|False // Set ColumnShadowState item col# to True|False // Set ColumnCapsLockState item col# to True|False // Set ColumnWordbreakState item col# to True|False // Set ColumnNumericState item col# to True|False // Set ColumnComboState item col# to True|False // Set ColumnCheckboxState item col# to True|False // Set ColumnButtonState item col# to True|False // Set ColumnComboEntryState item col# to True|False // Set ColumnPromptMode item col# to True|False // Set pbColumnSortable item col# to True|False // Set pbColumnVisible item col# to True|False // Set pbShowColumnInFieldChooser item col# to True|False // Set pbColumnGroupable item col# to True|False // // // You may also set footer values for each column // Set FooterLabel item col# to "Footer label text" // Set FooterColumnJustificationMode item col# to iMode // // // *** Item Properties: *** // Get AddItem "ItemValue" to item# // // Set Value item item# to Value // Set ItemColor item item# to RGBColor // Set ItemTextColor item item# to RGBColor // Set ItemShadowState item item# to True|False // Set CheckboxItemState item item# to True|False // Set CheckedState item item# to True|False // Set pbBold item item# to True|False // Set Icon item item# to iIconID // Set ToolTip item item# to "Item tooltip value" // Set EntryState item item# to True|False // Set pbIsButton item item# to True|False // Set AuxValue item item# to Value // Set psGroupCaption item item# to "" // // End_Object // oReportControlGrid // // // $Rev History // 2008-01-29 Module header created. // 2008-03-05 Documentation done including the .htm help (Located in the Help folder.) // Note: It is not many properties listed in the html help properties section. // However, there are a lot more properties available! You need to check above and // the procedures and functions that starts with 'pi, pb and ps' to see // them all. The reason is that many of the properties are just defined as // a pair of a procedure and a function, instead of a 'simple' property line. // It has been created in such a way to make it possible to be able to set // properties for the grid, before it has been paged - Else we would be // getting runtime errors because the COM objects does not yet exist. // This doesn't matter for the Studio; properties will show up properly in // the object properties dialog, it's more a 'defect' in CodeSpy that is tool // used to create the html documentation for this project. It cannot correctly // detect a procedure/function pair as a property. // 2008-03-09 Changed class names and AddColumn syntax(es) // 2008-03-16 Major reorganization of the VDF proxy object handling and how messages // communicate with the COM objects through these proxy objects. // 2008-04-18 Implemented ability to group columns // 2008-04-24 Fixed Tab & Enter navigation issues with combo list // Fixed incorrect assignment of default fonts //**************************************************************************** // 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 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 cReportControlGridFont.pkg Use cReportControlGridDefines.pkg Use cReportControlGridColumn.pkg Use cReportControlGridItem.pkg //Use cReportControlGridStyle.pkg //{ DesignerClass=cDTGrid } //cDTComControl } { DesignerClass=cDTComControl } { OverrideProperty=Visible_State DesignTime=False } { OverrideProperty=Attach_Parent_State DesignTime=False } { OverrideProperty=Block_Mouse_State DesignTime=False } { OverrideProperty=Client_Area_State DesignTime=False } { OverrideProperty=Delegation_Mode DesignTime=False } { OverrideProperty=Focus_Mode DesignTime=False } { OverrideProperty=pbBindValue DesignTime=False } { OverrideProperty=Popup_State DesignTime=False } { OverrideProperty=Ring_State DesignTime=False } { OverrideProperty=Scope_State DesignTime=False } { OverrideProperty=Skip_State DesignTime=False } { OverrideProperty=Search_Case DesignTime=False } { OverrideProperty=peAutoCreate DesignTime=False } { OverrideProperty=Label DesignTime=False } { OverrideProperty=Label_Col_Offset DesignTime=False } { OverrideProperty=Label_Row_Offset DesignTime=False } { OverrideProperty=Label_Justification_Mode DesignTime=False } { OverrideProperty=Border_Style DesignTime=False InitialValue=OLExtpBorderClientEdge } { OverrideProperty=Enabled_State DesignTime=False InitialValue=True } { OverrideProperty=FontSize DesignTime=False } Class cReportControlGrid is a cComReportControl // { EnumList+="OLESTDCOLOR_BACKGROUND, OLESTDCOLOR_ACTIVECAPTION, OLESTDCOLOR_INACTIVECAPTION, OLESTDCOLOR_MENU, OLESTDCOLOR_WINDOW, OLESTDCOLOR_WINDOWFRAME, OLESTDCOLOR_MENUTEXT" } // { EnumList+="OLESTDCOLOR_WINDOWTEXT, OLESTDCOLOR_CAPTIONTEXT, OLESTDCOLOR_ACTIVEBORDER, OLESTDCOLOR_INACTIVEBORDER, OLESTDCOLOR_APPWORKSPACE, OLESTDCOLOR_HIGHLIGHT, OLESTDCOLOR_HIGHLIGHTTEXT"} // { EnumList+="OLESTDCOLOR_BTNFACE, OLESTDCOLOR_BTNSHADOW, OLESTDCOLOR_GRAYTEXT, OLESTDCOLOR_BTNTEXT, OLESTDCOLOR_INACTIVECAPTIONTEXT, OLESTDCOLOR_BTNHIGHLIGHT, OLESTDCOLOR_3DDKSHADOW"} // { EnumList+="OLESTDCOLOR_3DLIGHT, OLESTDCOLOR_INFOTEXT, OLESTDCOLOR_INFOBK, OLESTDCOLOR_HOTLIGHT, OLESTDCOLOR_GRADIENTACTIVECAPTION, OLESTDCOLOR_GRADIENTINACTIVECAPTION, OLEXPCOLOR_TOOLBAR_FACE"} // { EnumList+="OLEXPCOLOR_HIGHLIGHT, OLEXPCOLOR_HIGHLIGHT_BORDER, OLEXPCOLOR_HIGHLIGHT_PUSHED, OLEXPCOLOR_HIGHLIGHT_CHECKED, OLEXPCOLOR_HIGHLIGHT_CHECKED_BORDER, OLEXPCOLOR_ICONSHADDOW"} // { EnumList+="OLEXPCOLOR_GRAYTEXT, OLEXPCOLOR_TOOLBAR_GRIPPER, OLEXPCOLOR_SEPARATOR, OLEXPCOLOR_DISABLED, OLEXPCOLOR_MENUBAR_FACE, OLEXPCOLOR_MENUBAR_EXPANDED, OLEXPCOLOR_MENUBAR_BORDER"} // { EnumList+="OLEXPCOLOR_MENUBAR_TEXT, OLEXPCOLOR_HIGHLIGHT_TEXT, OLEXPCOLOR_TOOLBAR_TEXT, OLEXPCOLOR_PUSHED_TEXT, OLEXPCOLOR_TAB_INACTIVE_BACK, OLEXPCOLOR_TAB_INACTIVE_TEXT"} // { EnumList+="OLEXPCOLOR_HIGHLIGHT_PUSHED_BORDER, OLEXPCOLOR_3DFACE, OLEXPCOLOR_3DSHADOW, OLEXPCOLOR_FRAME, OLEXPCOLOR_SPLITTER_FACE, OLEXPCOLOR_LABEL, OLEXPCOLOR_STATICFRAME"} Procedure Construct_Object Forward Send Construct_Object // This is the standard VDF Verify_Delete_msg. It can be changed from the // Studio's Object Properties dialog. // It can have one of three predefined parameters; // get_Delete_Confirmation = 'Delete this record.' // get_Line_Delete_Confirmation = 'Delete this line.' // get_No_Confirmation = Do not ask, just delete the row. Set Verify_Delete_Msg to get_Delete_Confirmation Set peAutoCreate to acAutoCreate // *** Public but not designtime Properties: *** { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoColumnCollection 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoCurrentColumn 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoRecordCollection 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoRowCollection 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoCurrentRecord 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoCurrentRow 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoCurrentItem 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoRecordItemMetrics 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoPaintManager 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoImageManager 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoGlobalSettings 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoPropExchange 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoColorManager 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoItemEditOptions 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoInplaceButton 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoNavigator 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoHitTestInfo 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoConstraintsCollection 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoItemConstraint 0 { Visibility=Public MethodType=Property DesignTime=False } Property Handle phoStdFont 0 // *** VDF Proxy objects used internally by the class: *** // These are considered to be private! // This object will contain all created Columns for the grid. (Collection object). Object oColumns is a cComReportColumns Set phoColumnCollection to Self End_Object // This will contain one column in the grid. // Note: All messages (mostly properties) for a particular column will be channeled // through this object. In order to do this, each time a property is // set in program code, the COM object for that property will automatically // be connected to this VDF proxy object. Object oColumn is a cReportControlGridColumn Set phoCurrentColumn to Self End_Object // * Explanation of the difference between rows and records; * // // The oRows is all the rows in the report, each row contains a oRecord that // it displays, and the oRow contains the items (oItem). // // Briefly, a Record is a bunch of data stored by the Report control. Some data pieces // (items) could be quite large, so Record objects do not "run" across the memory. // Its main responsibility is to maintain the data inside. // // Row is a piece of visual interface. It processes record drawing, user mouse and // keyboard events. Rows could be rebuilt frequently inside the Report control // depending on currently specified Grouping, Sorting, Hiding and other options. // Each regular row has an associated Record. But there are other kinds of rows - // for example Group Rows. They implement another specific behavior. // // So If you'd like to simply access data inside the Report control - you should // work with Records. // This object will contain all grid records. (Collection object). // Records hold all the data in the grid. Object oRecords is a cComReportRecords Set phoRecordCollection to Self End_Object // This object will contain all grid rows. (Collection object). // This is the visual representation of the data in the grid. It may or may not // be the same as the phoRecordCollection above, depending on sorting, grouping and // other stuff. Object oRows is a cComReportRows Set phoRowCollection to Self End_Object // This represents one record in the grid. // It will be used as a template. As soon a new Com side record will either // get created or 'pointed' to, it will get connected to this VDF proxy object. Object oRecord is a cComReportRecord Set phoCurrentRecord to Self End_Object // This represents one row in the grid. // It will be used as a template. As soon a new Com side record will either // get created or 'pointed' to, it will get connected to this VDF proxy object. // It will be especially used to visually present the phoCurrentRecord's data on screen. // The phoCurrentRecord object will contain the data, while the phoCurrentRow is the visual // representation of that data. Object oRow is a cComReportRow Set phoCurrentRow to Self End_Object // This will contain one item or cell in the grid. // Note: All messages (properties) for a particular item/cell will be channeled // through this object. In order to do this, each time a property is // set in program code or a navigational change is made, the COM object for // the COM cell object will automatically be connected to this VDF proxy object. Object oItem is a cReportControlGridItem Set phoCurrentItem to Self End_Object // Note: This proxy object is connected to the COM part in event OnBeforeDrawRow. Object oRecordItemMetrics is a cComReportRecordItemMetrics Set phoRecordItemMetrics to Self End_Object // *** Other miscellaneous objects that are being used by the grid object: *** // Used with navigation keys. Object oNavigator is a cComReportNavigator Set phoNavigator to Self End_Object // This will contain all icons to be used in grid header and items/cells. Object oImageManager is a cComImageManagerIcons Set phoImageManager to Self End_Object // This object is used for drawing the grid. Object oPaintManager is a cComReportPaintManager Set phoPaintManager to Self End_Object Object oReportRecordItemEditOptions is a cComReportRecordItemEditOptions Set phoItemEditOptions to Self End_Object Object oInplaceButton is a cComReportInplaceButton Set phoInplaceButton to Self End_Object Object oHittestInfo is a cComReportHitTestInfo Set phoHitTestInfo to Self End_Object Object oConstraintsCollection is a cComReportRecordItemConstraints Set phoConstraintsCollection to Self End_Object Object oItemConstraint is a cComReportRecordItemConstraint Set phoItemConstraint to Self End_Object // Object to get certain global settings from Object oGlobalSettings is a cComReportControlGlobalSettings Set phoGlobalSettings to Self End_Object // This object is connected to the phoGlobalSettings object. // Without the phoGlobalSettings object this object cannot be used. Object oColorManager is a cComColorManager Set phoColorManager to Self End_Object // This object is connected to the phoGlobalSettings object. // Without the phoGlobalSettings object this object cannot be used. // The PropExchange object provides a universal solution to save the layout and state // of the CommandBars, Docking Pane, TaskPanel, and Report Controls to a single file or // the system registry with support to Write/load directly to/from a file or registry. Object oPropExchange is a cComPropExchange Set phoPropExchange to Self End_Object Object oStdFont is a cComStdFont //cReportControlGridFont //cComStdFont Set phoStdFont to Self End_Object // Public Properties : // *** Header/Columns Area *** { Visibility=Public MethodType=Property DesignTime=True } // The default width to use for columns. // Default: 100 Property Integer piDefaultColWidth 100 { Visibility=Public MethodType=Property DesignTime=True } // Specifies whether all columns should be available in a FieldChooser object list, // after they have been draged and droped outside the grid object. // Default: True // Note: This can be overriden by the pbShowColumnInFieldChooser property at column level. // You will need to implement a FieldChooser object to be able to get removed // columns back to the grid header. Property Boolean pbShowAllColumnsInFieldChooser True // *** Grid Area in General *** { Visibility=Public MethodType=Property DesignTime=True Category=Appearance } // Specifies whether an item's text should be auto-selected when an item/cell is clicked upon. // This setting effects the whole grid. // Default: True // Note: There is also a pbColumnSelectTextOnEdit that can override this setting. Property Boolean pbSelectTextOnEdit True { Visibility=Public MethodType=Property DesignTime=True Category=Appearance } // Specifies whether rows can be deleted from the grid object. // Default: True Property Boolean pbDeleteAllowed True { Visibility=Public MethodType=Property Category=Appearance } { EnumList="OLExtpGridNoLines, OLExtpGridSmallDots, OLExtpGridLargeDots, OLExtpGridDashes, OLExtpGridSolid" } // Determines how grid lines will be drawn in the grid. // It will be used by the GridLineMode procedure. // Constants: // OLExtpGridNoLines, OLExtpGridSmallDots, OLExtpGridLargeDots, OLExtpGridDashes, OLExtpGridSolid // Default: OLExtpGridSolid Property Integer piReportGridStyle OLExtpGridSolid { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=False PropertyType=Color } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background Color to use for the current row, when the grid doesn't have the focus. // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default : clDefault // Note: The property is not exposed in the Studio's Object Properties dialog. It's just // to obscure to understand in that dialog. Property Integer CurrentRowColorNoGridFocus clDefault { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=False PropertyType=Color } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Foreground or text color to use for the current row, when the grid doesn't have the focus. // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clDefault // Note: The property is not exposed in the Studio's Object Properties dialog. It's just // to obscure to understand in that dialog. Property Integer CurrentRowTextColorNoGridFocus clDefault { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList ="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background color to use when a column has its ColumnShadowState set to True. // It also works to use the color selector from the Object Properties dialog in the Studio. // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clDefault Property Integer piColumnShadowStateColor clDefault { Visibility=Public MethodType=Property InitialValue=clGray DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Foreground or Text color to use when a column has its ColumnShadowState set to True. // Constants: // clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clGray Property Integer piColumnShadowStateTextColor clGray { Visibility=Public MethodType=Property InitialValue=clAqua DesignTime=True PropertyType=Color Category=Appearance } { EnumList ="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background color to use when an item/cell is set to pbIsButton, // and is pressed with the left mouse or the space button. // It also works to use the color selector from the Object Properties dialog in the Studio. // Constants: // clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clAqua Property Integer piButtonDownColor clAqua { Visibility=Public MethodType=Property InitialValue=clGray DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Foreground or Text color to use when an item/cell is set to pbIsButton, // and is pressed with the left mouse or the space button. // Constants: // clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clGray Property Integer piButtonDownTextColor clGray { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background color to use when an item/cell has been set to pbIsButton, // and the button is _not_ pressed. // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clDefault Property Integer piButtonBackColor clDefault { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Foreground or Text color to use when an item/cell has been set to pbIsButton, // and the button is _not_ pressed. // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clNone Property Integer piButtonForeColor clDefault { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // The property is used for combo's only. When a column has its ColumnComboState = True, // should the combo drop-down button be drawn within the item/cell? // Default: True Property Boolean pbDrawComboButtonInsideCell True // Preparation for using rowIDs when using grid with data tables. Property RowID priRowId // *** Private properties: *** { Visibility=Private MethodType=Property } Property Handle Private.phoReportControl 0 { Visibility=Private MethodType=Property } Property Handle Private.phoHitTestInfo 0 { Visibility=Private MethodType=Property DesignTime=False } Property Handle phoFieldChooser 0 { Visibility=Private MethodType=Property } Property Boolean Private.HighlightRowState True { Visibility=Private MethodType=Property } Property Boolean Private.HeaderVisibleState True { Visibility=Private MethodType=Property } Property Boolean Private.FooterVisibleState False { Visibility=Private MethodType=Property } Property Boolean Private.ResizeColumnState True { Visibility=Private MethodType=Property } Property Integer Private.SelectMode Single_Select { Visibility=Private MethodType=Property } Property Integer Private.piHeaderStyle OLExtpColumnShaded { Visibility=Private MethodType=Property } Property Boolean Private.pbHotTracking True { Visibility=Private MethodType=Property } Property Integer Private.piHeaderColor clDefault { Visibility=Private MethodType=Property } Property Integer Private.piHeaderTextColor clDefault { Visibility=Private MethodType=Property } Property Boolean Private.pbInvertColumnOnClick True { Visibility=Private MethodType=Property } Property Boolean Private.pbShadeSortColumn False { Visibility=Private MethodType=Property } Property Integer Private.piShadeSortColor clDefault { Visibility=Private MethodType=Property } Property Boolean Private.pbDrawSortTriangleAlways True { Visibility=Private MethodType=Property } Property String Private.psNoFieldsAvailableText "The headerlist is empty" { Visibility=Private MethodType=Property } Property String Private.psNoItemsText "No rows to display" { Visibility=Private MethodType=Property } Property String Private.psNoGroupByText "No groups to display" { Visibility=Private MethodType=Property } Property String Private.psSortByText "Sort by:" { Visibility=Private MethodType=Property } Property Integer Private.BorderStyle OLExtpBorderClientEdge { Visibility=Private MethodType=Property } Property Boolean Private.pbUseColumnAlignmentWhenEditing True { Visibility=Private MethodType=Property } Property Boolean Private.EnabledState True { Visibility=Private MethodType=Property } Property Boolean Private.pbAllowEdit True { Visibility=Private MethodType=Property } Property Boolean Private.pbEditOnClick True { Visibility=Private MethodType=Property } Property Boolean Private.pbEnableToolTips True { Visibility=Private MethodType=Property } Property String Private.Typeface RC_DefaultTypeface { Visibility=Private MethodType=Property } Property Integer Private.Fontsize RC_DefaultFontSize { Visibility=Private MethodType=Property } Property String Private.HeaderTypeface RC_DefaultTypeface { Visibility=Private MethodType=Property } Property Integer Private.HeaderFontsize RC_DefaultFontSize { Visibility=Private MethodType=Property } Property String Private.FooterTypeface RC_DefaultTypeface { Visibility=Private MethodType=Property } Property Integer Private.FooterFontsize RC_DefaultFontSize { Visibility=Private MethodType=Property } Property Integer Private.Color clDefault { Visibility=Private MethodType=Property } Property Integer Private.TextColor clDefault { Visibility=Private MethodType=Property } Property Integer Private.GridLineMode Grid_Visible_Both { Visibility=Private MethodType=Property } Property Integer Private.peGridLineColor clBlue { Visibility=Private MethodType=Property } Property Integer Private.CurrentRowColor clDefault { Visibility=Private MethodType=Property } Property Integer Private.CurrentRowTextColor clDefault { Visibility=Private MethodType=Property } Property Boolean Private.HighlightRowState True { Visibility=Private MethodType=Property } Property Boolean Private.pbFixedRowHeight False { Visibility=Private MethodType=Property } Property String Private.psWatermarkBitmap "" { Visibility=Private MethodType=Property } Property Integer Private.piWatermarkTransparancy 25 #IFDEF OLExtpReportWatermarkUnknown { Visibility=Private MethodType=Property } Property Integer Private.piWatermarkAlignment OLExtpReportWatermarkUnknown #ELSE Property Integer Private.piWatermarkAlignment 0 #ENDIF { Visibility=Private MethodType=Property } Property Boolean Private.pbDrawGridForEmptySpace True { Visibility=Private MethodType=Property } Property Boolean Private.pbAutoColumnSizing False { Visibility=Private MethodType=Property } Property Integer Private.piCustomDraw OLEExtpCustomDrawNone { Visibility=Private MethodType=Property } Property Integer Private.HeaderJustificationMode OLExtpAlignmentLeft { Visibility=Private MethodType=Property } Property Boolean Private.pbUseColumnJustificationModeForHeader True { Visibility=Private MethodType=Property } Property Integer Private.AllColumnJustificationMode OLExtpAlignmentLeft { Visibility=Private MethodType=Property } Property Boolean Private.pbAllowColumnReorder True { Visibility=Private MethodType=Property } Property Boolean Private.pbAllowColumnRemove False { Visibility=Private MethodType=Property } Property Boolean Private.pbAllowAllColumnSort True { Visibility=Private MethodType=Property } Property Boolean Private.pbAllowMoveRow True { Visibility=Private MethodType=Property } Property Integer Private.piSetVirtualMode -1 { Visibility=Private MethodType=Property } Property Integer Private.pbColumnsGroupable False { Visibility=Private MethodType=Property } Property Integer Private.pbShowItemsInGroups False { Visibility=Private MethodType=Property } Property Boolean Private.pbShadeGroupHeadings False { Visibility=Private MethodType=Property } Property Boolean Private.pbSkipGroupsFocus False // *** Other internally used private properties: *** { Visibility=Private MethodType=Property } Property Integer piLastImageId 0 { Visibility=Private MethodType=Property } Property Integer Private.pix 0 { Visibility=Private MethodType=Property } Property Integer Private.piy 0 { Visibility=Private MethodType=Property } Property Integer Private.ItemColor 0 { Visibility=Private MethodType=Property } Property Integer Private.ItemTextColor 0 { Visibility=Private MethodType=Property } Property Integer Private.ItemCount 0 { Visibility=Private MethodType=Property } Property Variant Private.pvCurrentRow { Visibility=Private MethodType=Property } Property Variant Private.pvCurrentColumn { Visibility=Private MethodType=Property } Property Variant Private.pvCurrentItem { Visibility=Private MethodType=Property } Property Variant Private.ClipboardRecordVariant { Visibility=Private MethodType=Property } Property Integer Private.ClipboardRecordIndex 0 { Visibility=Private MethodType=Property } Property Boolean Private.pbFocusSubItems True { Visibility=Private MethodType=Property } Property Boolean Private.pbDescriptionValue False { Visibility=Private MethodType=Property } // pbNavigateOutOfEditMode: Internal - Used to determine if the Tab, Shift Tab or Enter keys // were used to navigate out of a cell that was being edited. This property is used to stop // the navigated to cell from going into edit mode. See OnComRequestEdit. Property Boolean Private.pbNavigateOutOfEditMode False //JVH - private storage of control's default Font attributes. Property String Private.DefaultTypeface RC_DefaultTypeface Property Integer Private.DefaultFontsize RC_DefaultFontSize Property String Private.DefaultHeaderTypeface RC_DefaultTypeface Property Integer Private.DefaultHeaderFontsize RC_DefaultFontSize Property String Private.DefaultFooterTypeface RC_DefaultTypeface Property Integer Private.DefaultFooterFontsize RC_DefaultFontSize //{ Visibility=Private MethodType=Property } //Property Boolean Private.pbIsReleased False // * Not implemented: { Visibility=Private MethodType=Property } Property Integer Private.CurrentCellColor clAqua { Visibility=Private MethodType=Property } Property Integer Private.CurrentCellTextColor clBlack // *** Key Procedures: *** // * TODO: Remark these for now. // If used it won't work with home/end keys // to get at beginning/end of an item/cell's data when in edit mode... // On_Key Key_Home Send MoveToFirstColumn // On_Key Key_End Send MoveToLastColumn On_Key Key_Tab Send Default_Key //TabRight //JVH - Works better. Does not cancel selection of combo item On_Key Key_Shift+Key_Tab Send Default_Key //TabLeft //JVH - Works better. Does not cancel selection of combo item On_Key Key_Enter Send Default_Key //DoEnter //JVH - Works better. This allows selection of items in combo items On_Key Key_Ctrl+Key_Up_Arrow Send MoveRowUp On_Key Key_Ctrl+Key_Down_Arrow Send MoveRowDown On_Key Key_Shift+Key_F2 Send Request_Delete On_Key Key_Ctrl+Key_D Send Request_Delete On_Key Key_Ctrl+Key_X Send Cut On_Key Key_Shift+Key_Delete Send Cut On_Key Key_Ctrl+Key_C Send Copy On_Key Key_Ctrl+Key_Insert Send Copy On_Key Key_Ctrl+Key_V Send Paste On_Key Key_Shift+Key_Insert Send Paste End_Procedure // Construct_Object Procedure End_Construct_Object Forward Send End_Construct_Object End_Procedure // End_Construct_Object // The procedure creates several necessary COM objects and connects them to // 'their' VDF Proxy objects. It also initilizes all necessary property values. Procedure CreateReportControl Variant vColumns vRecords vRows Variant vNavigator vImageManager vPaintManager vColorManager Variant vHitTestInfo vItemEditOptions vPropExchange Handle ho Boolean bState Set Private.phoReportControl to Self // Needs to be first in OnCreate. Used by column & item sub-classes. Forward Send OnCreate // *** Create all needed COM objects and connect them to the VDF side: *** Move (NullComObject()) to vColumns Get ComColumns to vColumns If (IsNullComObject(vColumns)) Begin Error DfErr_Program "Report Component Error. Could not create the Column collection object." Procedure_Return End Set pvComObject of (phoColumnCollection(Self)) to vColumns Move (NullComObject()) to vRecords Get ComRecords to vRecords If (IsNullComObject(vRecords)) Begin Error DfErr_Program "Report Component Error. Could not create the Record collection object." Procedure_Return End Set pvComObject of (phoRecordCollection(Self)) to vRecords Move (NullComObject()) to vRows Get ComRows to vRows If (IsNullComObject(vRows)) Begin Error DfErr_Program "Report Component Error. Could not create the Row collection object." Procedure_Return End Set pvComObject of (phoRowCollection(Self)) to vRows // *** Other miscellanous COM objects used by the Report Control: *** Move (NullComObject()) to vNavigator Get ComNavigator to vNavigator If (IsNullComObject(vNavigator)) Begin Error DfErr_Program "Report Component Error. Could not create the Navigator object." Procedure_Return End Set pvComObject of (phoNavigator(Self)) to vNavigator Move (NullComObject()) to vImageManager Get ComIcons to vImageManager If (IsNullComObject(vImageManager)) Begin Error DfErr_Program "Report Component Error. Could not create the Icon Manager object." Procedure_Return End Set pvComObject of (phoImageManager(Self)) to vImageManager Move (NullComObject()) to vPaintManager Get ComPaintManager to vPaintManager If (IsNullComObject(vPaintManager)) Begin Error DfErr_Program "Report Component Error. Could not create the Paint Manager object." Procedure_Return End Set pvComObject of (phoPaintManager(Self)) to vPaintManager Get phoGlobalSettings to ho Get IsComObjectCreated of ho to bState If (bState = False) Send CreateComObject of ho Move (NullComObject()) to vColorManager Get ComColorManager of ho to vColorManager If (IsNullComObject(vColorManager)) Begin Error DfErr_Program "Report Component Error. Could not create the Color Manager object." Procedure_Return End Set pvComObject of (phoColorManager(Self)) to vColorManager Get phoGlobalSettings to ho Move (NullComObject()) to vPropExchange Get ComCreatePropExchange of ho to vPropExchange If (IsNullComObject(vPropExchange)) Begin Error DfErr_Program "Report Component Error. Could not create the Property Exchange object." Procedure_Return End Set pvComObject of (phoPropExchange(Self)) to vPropExchange Move (NullComObject()) to vHitTestInfo Get ComHitTest 0 0 to vHitTestInfo If (IsNullComObject(vHitTestInfo)) Begin Error DfErr_Program "Report Component Error. Could not connect to HitTestInfo object." Procedure_Return End Set pvComObject of (phoHitTestInfo(Self)) to vHitTestInfo Send InitializeProperties Send InitPrivateProperties Send OnCreateGrid // This is the public event fired when creating the COM object. // Send LoadEnvironment of (phoPropExchange(Self)) // Load layout if needed. End_Procedure // CreateReportControl { MethodType=Event Visibility=Private } // This is a private event. Use OnCreateGrid for custom event. Procedure OnCreate Forward Send OnCreate Send CreateReportControl End_Procedure // OnCreate { MethodType=Event } Procedure OnCreateGrid End_Procedure // OnCreateGrid // The InitializeGrid message will destroy all data in the grid and remove all columns // (and headers). // This is only needed if you already have constructed and filled the grid, but // want to start all over with a different number of columns. // If you only need to remove all data from the grid; use 'Send DeleteData' instead. // Note: There is also a RemoveIcons message that will remove all icons from the Icon // manager, if there is a need to use another set of icons at runtime. Procedure InitializeGrid Send DeleteData Send RemoveColumns Send InitPrivateProperties End_Procedure // InitializeGrid // This message is automatically send when the COM-object grid is created. // It initializes all public properties. Procedure InitializeProperties Handle hoPaintManager hoStdFont Variant vFont Integer iDefaultFontSize String sDefaultTypeface //JVH - Set up default font properties.... Get phoPaintManager to hoPaintManager Get phoStdFont to hoStdFont Get ComTextFont of hoPaintManager to vFont Set pvComObject of hoStdFont to vFont Get ComSize of hoStdFont to iDefaultFontSize Get ComName of hoStdFont to sDefaultTypeface Set Private.DefaultFontsize to iDefaultFontSize Set Private.DefaultTypeface to sDefaultTypeface Get ComCaptionFont of hoPaintManager to vFont Set pvComObject of hoStdFont to vFont Get ComSize of hoStdFont to iDefaultFontSize Get ComName of hoStdFont to sDefaultTypeface Set Private.DefaultHeaderFontsize to iDefaultFontSize Set Private.DefaultHeaderTypeface to sDefaultTypeface Set Private.DefaultFooterFontsize to iDefaultFontSize // Assume the default footer font is the same as the default header font Set Private.DefaultFooterTypeface to sDefaultTypeface // Report control properties: // Important: The piCustomDraw property setting _must_ precede all other visual appearancy // properties. Else they will not show properly! Set piCustomDraw to (Private.piCustomDraw(Self)) // This property also sets the piCustomDraw property, and thus needs to be // at the very top of properties that are set. // * Not yet fully implemented Set piSetVirtualMode to (Private.piSetVirtualMode(Self)) Set pbAllowColumnRemove to (Private.pbAllowColumnRemove(Self)) Set pbAllowColumnReorder to (Private.pbAllowColumnReorder(Self)) Set pbAllowAllColumnSort to (Private.pbAllowAllColumnSort(Self)) Set pbAllowMoveRow to (Private.pbAllowMoveRow(Self)) Set pbAutoColumnSizing to (Private.pbAutoColumnSizing(Self)) Set AllColumnJustificationMode to (Private.AllColumnJustificationMode(Self)) Set pbFocusSubItems to (Private.pbFocusSubItems(Self)) Set GridLineMode to (Private.GridLineMode(Self)) Set HeaderVisibleState to (Private.HeaderVisibleState(Self)) Set FooterVisibleState to (Private.FooterVisibleState(Self)) Set HeaderJustificationMode to (Private.HeaderJustificationMode(Self)) Set pbUseColumnJustificationModeForHeader to (Private.pbUseColumnJustificationModeForHeader(Self)) Set ResizeColumnState to (Private.ResizeColumnState(Self)) Set pbEnableToolTips to (Private.pbEnableToolTips(Self)) Set WatermarkEx to (Private.psWatermarkBitmap(Self)) (Private.piWatermarkTransparancy(Self)) (Private.piWatermarkAlignment(Self)) Set EnabledState to (Private.EnabledState(Self)) Set pbAllowEdit to (Private.pbAllowEdit(Self)) Set pbEditOnClick to (Private.pbEditOnClick(Self)) Set BorderStyle to (Private.BorderStyle(Self)) Set pbUseColumnAlignmentWhenEditing to (Private.pbUseColumnAlignmentWhenEditing(Self)) Set SelectMode to (Private.SelectMode(Self)) Set pbColumnsGroupable to (Private.pbColumnsGroupable(Self)) Set pbShowItemsInGroups to (Private.pbShowItemsInGroups(Self)) Set pbShadeGroupHeadings to (Private.pbShadeGroupHeadings(Self)) Set pbSkipGroupsFocus to (Private.pbSkipGroupsFocus(Self)) // Paint manager properties: Set pbFixedRowHeight to (Private.pbFixedRowHeight(Self)) Set pbDrawSortTriangleAlways to (Private.pbDrawSortTriangleAlways(Self)) Set Color to (Private.Color(Self)) Set TextColor to (Private.TextColor(Self)) Set piHeaderColor to (Private.piHeaderColor(Self)) Set piHeaderTextColor to (Private.piHeaderTextColor(Self)) Set piHeaderStyle to (Private.piHeaderStyle(Self)) Set HighlightRowState to (Private.HighlightRowState(Self)) Set CurrentRowColor to (Private.CurrentRowColor(Self)) Set CurrentRowTextColor to (Private.CurrentRowTextColor(Self)) Set CurrentCellColor to (Private.CurrentCellColor(Self)) Set peGridLineColor to (Private.peGridLineColor(Self)) Set pbDrawGridForEmptySpace to (Private.pbDrawGridForEmptySpace(Self)) Set pbHotTracking to (Private.pbHotTracking(Self)) Set pbInvertColumnOnClick to (Private.pbInvertColumnOnClick(Self)) Set pbShadeSortColumn to (Private.pbShadeSortColumn(Self)) Set piShadeSortColor to (Private.piShadeSortColor(Self)) Set psSortByText to (Private.psSortByText(Self)) Set psNoFieldsAvailableText to (Private.psNoFieldsAvailableText(Self)) Set psNoItemsText to (Private.psNoItemsText(Self)) Set psNoGroupByText to (Private.psNoGroupByText(Self)) End_Procedure // InitializeProperties // Internal usage only. // It initializes all private properties. Procedure InitPrivateProperties Set piLastImageId to 0 Set Private.ItemColor to 0 Set Private.ItemTextColor to 0 Set Private.ItemCount to 0 Set Private.pvCurrentRow to OLE_VT_EMPTY Set Private.pvCurrentColumn to OLE_VT_EMPTY Set Private.pvCurrentItem to OLE_VT_EMPTY End_Procedure // InitPrivateProperties // Keyboard navigation. // If the Home key is pressed, navigate to the current row's first column. Procedure MoveToFirstColumn Handle hoNavigator Boolean bEditMode Integer iRow If (Not(IsComObjectCreated(Self))) Procedure_Return // Are we editing an item/cell? Get ComEditMode to bEditMode If (bEditMode = False) Begin Get phoNavigator to hoNavigator Send ComMoveFirstColumn of hoNavigator False False Procedure_Return End End_Procedure // MoveToFirstColumn // Keyboard navigation. // If the End key is pressed, navigate to the current row's last column. Procedure MoveToLastColumn Handle hoNavigator Boolean bEditMode Integer iRow If (not(IsComObjectCreated(Self))) Procedure_Return // Are we editing an item/cell? Get ComEditMode to bEditMode If (bEditMode = False) Begin Get phoNavigator to hoNavigator Send ComMoveLastColumn of hoNavigator False False Procedure_Return End End_Procedure // MoveToLastColumn // Helper function to decide the next focusable column. // Takes a column number as parameter. // Returns: An integer value that is the first found column number // that is not shadowed or invisible. // Note: The returned value could be less or equal to the passed column // number, in case it indicates that the next focusable item will // be on a next row. Function NextFocusableColumn Integer iColumn Returns Integer Handle hoColumns hCol Integer iCols i Boolean bShadowed bVisible Get phoColumnCollection to hoColumns Get ColumnCount to iCols Move (iCols = iColumn) to bShadowed // Then start searching from first column. If (bShadowed = False) Begin For i from iColumn to (iCols -1) Get ColumnProxyObjectFromColumnNumber item i to hCol Get pbColumnVisible item hCol to bVisible If (bVisible = True) ; Get ColumnShadowState item hCol to bShadowed If (bShadowed = False) Break Loop End // If bShadowed = True it means that we reached the last column, // but found no un-shadowed column. So start searching from first column (column zero). If (bShadowed = True) Begin For i from 0 to (iCols -1) Get ColumnProxyObjectFromColumnNumber item i to hCol Get pbColumnVisible item hCol to bVisible If (bVisible = True) ; Get ColumnShadowState item hCol to bShadowed If (bShadowed = False) Break Loop End Function_Return i End_Function // NextFocusableColumn Procedure TabRight Handle hoNavigator hoRows hoCurrentRow hoColumns hoCurrentColumn Variant vNextColumn vNextRow Boolean bWrapped bEditMode Integer iItem_Count iCurrent_Item iColumn iNextColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComEditMode to bEditMode // If we are not editing then use the normal navigator to move to the next cell. // This ensures we do not enter edit mode if we were not already editing... If (bEditMode = False) Begin Get phoNavigator to hoNavigator Send ComMoveRight of hoNavigator False False Procedure_Return End // If we are editing then use ComEditItem to initiate editing the next logical cell. // This is the only way (I know of) to actually exit the edit mode of the current // cell and also have all the correct event handler control to cancel the operation etc... If (not(IsNullComObject(ComFocusedColumn(Self)))) Begin If (not(IsNullComObject(ComFocusedRow(Self)))) Begin Get Item_Count to iItem_Count Get Current_Item to iCurrent_Item // If at last grid item, then do nothing. If (iCurrent_Item = (iItem_Count -1)) Procedure_Return // Set the current column... Get phoCurrentColumn to hoCurrentColumn Set pvComObject of hoCurrentColumn to (ComFocusedColumn(Self)) // Set the current row... Get phoCurrentRow to hoCurrentRow Set pvComObject of hoCurrentRow to (ComFocusedRow(Self)) // Get the next focusable column... Get CurrentCol to iColumn Get NextFocusableColumn (iColumn + 1) to iNextColumn Get ColumnComObjectFromColumnNumber item iNextColumn to vNextColumn Move (iNextColumn <= iColumn) to bWrapped // Determine the next row... Move (ComFocusedRow(Self)) to vNextRow If (bWrapped = True) Begin // If we wrapped try to move down to the next row... Get phoRowCollection to hoRows Set pvComObject of hoRows to (ComRows(Self)) If (ComIndex(hoCurrentRow) < (ComCount(hoRows)-1)) Begin // Get the next row Get ComRow of hoRows (ComIndex(hoCurrentRow)+1) to vNextRow End End // Used to stop the next cell from going into edit mode. Set Private.pbNavigateOutOfEditMode to True // Move the edit cursor.... Send ComEditItem vNextRow vNextColumn End End End_Procedure // TabRight // Helper function to decide the previous focusable column. // Takes a column number as parameter to start searching from. // Returns: An integer value that is the first found column number // that is not shadowed or unvisible. // Note: The returned value could be greater or equal to the passed column // number, in case it indicates that the next focusable item will // be on a previous row. Function PrevFocusableColumn Integer iColumn Returns Integer Handle hoColumns hCol Integer iCols i Boolean bShadowed bVisible Get phoColumnCollection to hoColumns Get ColumnCount to iCols Move (iColumn < 0) to bShadowed // Then start searching from the next column. If (bShadowed = False) Begin Move iColumn to i Repeat Get ColumnProxyObjectFromColumnNumber item i to hCol Get pbColumnVisible item hCol to bVisible If (bVisible = True) ; Get ColumnShadowState item hCol to bShadowed Decrement i Until (bShadowed = False or i <=0) Increment i End // If bShadowed = True it means that we reached the first column, // but found no un-shadowed column. So start searching from last column. If (bShadowed = True) Begin Move (iCols -1) to i Repeat Get ColumnProxyObjectFromColumnNumber item i to hCol Get pbColumnVisible item hCol to bVisible If (bVisible = True) ; Get ColumnShadowState item hCol to bShadowed Decrement i Until (bShadowed = False or i <=0) Increment i End Function_Return i End_Function // PrevFocusableColumn Procedure TabLeft Handle hoNavigator hoRows hoColumns hoCurrentColumn hoCurrentRow Variant vNextColumn vNextRow Boolean bWrapped bEditMode Integer iCurrentRow iCurrentCol iColumn iPrevColumn If (not(IsComObjectCreated(Self))) Procedure_Return Get ComEditMode to bEditMode // If we are not editing then use the normal navigator to move to the previous cell. This ensures we do not // enter edit mode if we were not already editing.... If (bEditMode = False) Begin Get phoNavigator to hoNavigator Send ComMoveLeft of hoNavigator False False Procedure_Return End // If we are editing then use ComEditItem to initiate editing the next logical cell. This // is the only way (I know of) to actually exit the edit mode of the current cell and // also have all the correct event handler control to cancel the operation etc... If (not(IsNullComObject(ComFocusedColumn(Self)))) Begin If (not(IsNullComObject(ComFocusedRow(Self)))) Begin Get CurrentRow to iCurrentRow Get CurrentCol to iCurrentCol // If at first grid item, then do nothing. If (iCurrentRow = 0 and iCurrentCol = 0) Procedure_Return // Set the current column... Get phoCurrentColumn to hoCurrentColumn Set pvComObject of hoCurrentColumn to (ComFocusedColumn(Self)) // Set the current row... Get phoCurrentRow to hoCurrentRow Set pvComObject of hoCurrentRow to (ComFocusedRow(Self)) // Get the previous focusable column... Get CurrentCol to iColumn Get PrevFocusableColumn (iColumn - 1) to iPrevColumn Get ColumnComObjectFromColumnNumber item iPrevColumn to vNextColumn Move (iPrevColumn >= iColumn) to bWrapped // Determine the next row... Move (ComFocusedRow(Self)) to vNextRow If (bWrapped) Begin // If we wrapped try to move up to the previous row... // Get the Rows collection Get phoRowCollection to hoRows Set pvComObject of hoRows to (ComRows(Self)) If (ComIndex(hoCurrentRow) > 0) Begin // Get the prev row Get ComRow of hoRows (ComIndex(hoCurrentRow)-1) to vNextRow End End // Used to stop the next cell from going into edit mode Set Private.pbNavigateOutOfEditMode to True // Move the edit cursor... Send ComEditItem vNextRow vNextColumn End End End_Procedure // TabLeft //JVH- Was DoEdit: Modified to handle only going into edit mode. This is called now only when Enter is // pressed when not in edit mode via OnComPreviewKeyDown. // If we are editing a cell then enter acts just like pressing Tab. // If we are not editing then Enter will put the cell into Edit mode. Procedure EditCurrentItem Boolean bEditMode bFocusable bCheckboxState bEditable bColShadowed Integer hItem iCurrent_Item iCurrent_Col Handle hCol // // Get ComEditMode to bEditMode // // If (bEditMode = True) Begin // Send TabRight // End // Else Begin If (not(IsNullComObject(ComFocusedColumn(Self)))) Begin If (not(IsNullComObject(ComFocusedRow(Self)))) Begin Get Current_Item to iCurrent_Item Get ItemProxyObjectFromItemNumber iCurrent_Item to hItem Get Current_Col to iCurrent_Col Get ColumnProxyObjectFromColumnNumber item iCurrent_Col to hCol // Is the current column editable? Get ColumnShadowState item hCol to bColShadowed If (bColShadowed = True) Begin Send TabRight // The TabRight will take care of which column to jump to. Procedure_Return End // If current col is not shadowed, is the current cell editable? Get ComEditable of hItem to bEditable // Is the current cell a checkbox? Get ComHasCheckbox of hItem to bCheckboxState If (bEditable = True and bCheckboxState = False) Begin Send ComEditItem (ComFocusedRow(Self)) (ComFocusedColumn(Self)) End Else Begin Send TabRight End End End // End End_Procedure // EditCurrentItem // Same as pressing the Up-Arrow key. // This can be used to programatically move the focus. Procedure Up Handle hoNavigator If (not(IsComObjectCreated(Self))) Procedure_Return Get phoNavigator to hoNavigator Send ComMoveUp of hoNavigator False False End_Procedure // Up // Same as pressing the Down-Arrow key. // This can be used to programatically move the focus. Procedure Down Handle hoNavigator If (not(IsComObjectCreated(Self))) Procedure_Return Get phoNavigator to hoNavigator Send ComMoveDown of hoNavigator False False End_Procedure // Down // Moves focus to the item of the specified column of the currently selected row. // Parameters: // iIndex - Index of the column to focus. Procedure MoveToColumn Integer iIndex Handle hoNavigator If (not(IsComObjectCreated(Self))) Procedure_Return Get phoNavigator to hoNavigator // Set ComFocusSubItems to True // This must be true, else the move will fail. Send ComMoveToColumn iIndex False // False means; Do not move if iIndex has Focusable=False. End_Procedure // MoveToColumn // Moves the focus and/or selection to a specified row number. Procedure MoveToRow Integer iIndex Handle hoNavigator If (not(IsComObjectCreated(Self))) Procedure_Return Get phoNavigator to hoNavigator // Set ComFocusSubItems to True // This must be true, else the move will fail. Send ComMoveToRow iIndex False False End_Procedure // MoveToRow { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // *** We have lots of 'Set xxx messages here that are really properties *** // // The reason is a timing problem... When properties are set by the Object Properties // dialog in the Studio, they will get written to the cReportControlGrid and thus will get // executed when the object is created upon program start. However, this is to soon! // Most of the properties cannot be set until the COM objects has been // initialized and they don't; until the OnCreate method is executed when the object // is paged. // // So how does it work? // // Well, when a property is set upon program start the Private.xxx counterpart property // will be set. The Set xxx property won't be set until the OnCreate event is fired // - then all of the properties will be set by the InitializeProperties procedure. // // // Makes it possible to click on an individual item (else only the row takes focus) // Syntax: // Set pbFocusSubItems to True/False // Default: True // Note: If set to False, all attempts to edit items/cells will fail. Procedure Set pbFocusSubItems Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbFocusSubItems to bState Procedure_Return End Set ComFocusSubItems to bState Set Private.pbFocusSubItems to bState End_Procedure // pbFocusSubItems { MethodType=Property } // See: Procedure Set pbFocusSubItems for an explanation. Function pbFocusSubItems Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbFocusSubItems(Self)) End_Function // pbFocusSubItems { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background color for the header. // Syntax: // Set piHeaderColor to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // The Windows color dialog may also be used to select a color. // Default: clDefault // Note: This only works if piHeaderStyle = OLExtpColumnShaded. Procedure Set piHeaderColor Integer iColor Handle hoPaintManager If (iColor < 1) Procedure_Return // * Is this correct? If (not(IsComObjectCreated(Self))) Begin Set Private.piHeaderColor to iColor Procedure_Return End If (iColor = clDefault) Move -1 to iColor Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComCaptionBackColor of hoPaintManager to iColor Set Private.piHeaderColor to iColor Send ComRedraw End_Procedure // Set piHeaderColor { MethodType=Property } // See: Procedure Set piHeaderColor for an explanation. Function piHeaderColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piHeaderColor(Self)) End_Function // piHeaderColor { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Color for the header texts. // Syntax: // Set piHeaderTextColor to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // The Windows color dialog may also be used to select a color. // Default: clDefault // Note: This only works if piHeaderStyle = OLExtpColumnShaded. Procedure Set piHeaderTextColor Integer iColor Handle hoPaintManager If (iColor < 1) Procedure_Return If (not(IsComObjectCreated(Self))) Begin Set Private.piHeaderTextColor to iColor Procedure_Return End If (iColor = clDefault) Move -1 to iColor Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComCaptionForeColor of hoPaintManager to iColor Set Private.piHeaderTextColor to iColor Send ComRedraw End_Procedure // Set piHeaderTextColor { MethodType=Property } // See: Procedure Set piHeaderTextColor for an explanation. Function piHeaderTextColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piHeaderTextColor(Self)) End_Function // piHeaderTextColor { Visibility=Public MethodType=Property InitialValue=OLExtpColumnShaded Category=Appearance } { EnumList="OLExtpColumnShaded, OLExtpColumnExplorer, OLExtpColumnOffice2003, OLExtpColumnOffice2007" } // Visual appearance of grid headers. // Syntax: // Set piHeaderStyle to iStyle // iStyle Constants: // OLExtpColumnShaded, OLExtpColumnExplorer, OLExtpColumnOffice2003, OLExtpColumnOffice2007 // Default: OLExtpColumnShaded Procedure Set piHeaderStyle Integer iStyle Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.piHeaderStyle to iStyle Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComColumnStyle of hoPaintManager to iStyle Set Private.piHeaderStyle to iStyle Send ComRedraw End_Procedure // Set piHeaderStyle { MethodType=Property } // See: Procedure Set piHeaderStyle for an explanation. Function piHeaderStyle Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piHeaderStyle(Self)) End_Function // piHeaderStyle { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Set whether hot tracking is used while moving the mouse over the column header. // Syntax: // Set pbHotTracking to True/False // Default: True // Note: This only work if piHeaderStyle <> OLExtpColumnShaded. Procedure Set pbHotTracking Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbHotTracking to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComHotTracking of hoPaintManager to bState Set Private.pbHotTracking to bState End_Procedure // pbHotTracking { MethodType=Property } // See: Procedure Set pbHotTracking for an explanation. Function pbHotTracking Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.pbHotTracking(Self)) End_Function // pbHotTracking { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Sets whether the column header will appear "inverted" when clicked. // Syntax: // Set pbInvertColumnOnClick to True/False // Default: True Procedure Set pbInvertColumnOnClick Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbInvertColumnOnClick to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComInvertColumnOnClick of hoPaintManager to bState Set Private.pbInvertColumnOnClick to bState End_Procedure // pbInvertColumnOnClick { MethodType=Property } // See: Procedure Set pbInvertColumnOnClick for an explanation. Function pbInvertColumnOnClick Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.pbInvertColumnOnClick(Self)) End_Function // pbInvertColumnOnClick { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether the items/cells of a sorted column will be shaded, when // a column header is clicked to resort the grid. // Syntax: // Set pbShadeSortColumn to True/False // Default: False Procedure Set pbShadeSortColumn Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbShadeSortColumn to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComShadeSortColumn of hoPaintManager to bState Set Private.pbShadeSortColumn to bState Send Redraw End_Procedure // pbShadeSortColumn { MethodType=Property } // See: Procedure Set pbShadeSortColumn for an explanation. Function pbShadeSortColumn Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.pbShadeSortColumn(Self)) End_Function // pbShadeSortColumn { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Color for the sorted column. // Syntax: // Set piShadeSortColor to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // The Windows color dialog may also be used to select a color. // Default: clDefault // Note: This only works if pbShadeSortColumn = True. Procedure Set piShadeSortColor Integer iColor Handle hoPaintManager If (iColor < 1) Procedure_Return If (not(IsComObjectCreated(Self))) Begin Set Private.piShadeSortColor to iColor Procedure_Return End If (iColor = clDefault) Move -1 to iColor Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComShadeSortColor of hoPaintManager to iColor Set Private.piShadeSortColor to iColor Send ComRedraw End_Procedure // Set piShadeSortColor { MethodType=Property } // See: Procedure Set piShadeSortColor for an explanation. Function piShadeSortColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piShadeSortColor(Self)) End_Function // piShadeSortColor { Visibility=Public MethodType=Property InitialValue="Sort by:" } // SortByText is the text string that is displayed in the tooltip window for column // headers when _no_ tooltip is Set for the column. The tooltip normally reads // "SortBy: + HeaderLabel". // Syntax: // Set psSortByText to "Sort by text" Procedure Set psSortByText String sText Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.psSortByText to sText Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComSortByText of hoPaintManager to sText Set Private.psSortByText to sText End_Procedure // psSortByText { MethodType=Property } // See: Procedure Set psSortByText for an explanation. Function psSortByText Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.psSortByText(Self)) End_Function // psSortByText { Visibility=Public MethodType=Property InitialValue="The headerlist is empty" } // The "No Fields Available" text message displayed in the Field Chooser when no // column headers are present. // Syntax: // Set psNoFieldsAvailableText to "No columns text" // Default: "" Procedure Set psNoFieldsAvailableText String sText Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.psNoFieldsAvailableText to sText Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComNoFieldsAvailableText of hoPaintManager to sText Set Private.psNoFieldsAvailableText to sText Send ComRedraw End_Procedure // Set psNoFieldsAvailableText { MethodType=Property } // See: Procedure Set psNoFieldsAvailableText for an explanation. Function psNoFieldsAvailableText Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.psNoFieldsAvailableText(Self)) End_Function // psNoFieldsAvailableText { Visibility=Public MethodType=Property InitialValue="No rows to display" } // Text message to display when grid is empty. // Syntax: // Set psNoItemsText to "No records text" Procedure Set psNoItemsText String sText Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.psNoItemsText to sText Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComNoItemsText of hoPaintManager to sText Set Private.psNoItemsText to sText Send ComRedraw End_Procedure // Set psNoItemsText { MethodType=Property } // See: Procedure Set psNoItemsText for an explanation. Function psNoItemsText Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.psNoItemsText(Self)) End_Function // psNoItemsText { Visibility=Public MethodType=Property InitialValue="No groups to display" } // The "No Items" text message displayed in the "Group By" box when no groups has been added. // Syntax: // Set psNoGroupByText to "No group text" Procedure Set psNoGroupByText String sText Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.psNoGroupByText to sText Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComNoGroupByText of hoPaintManager to sText Set Private.psNoGroupByText to sText Send ComRedraw End_Procedure // Set psNoGroupByText { MethodType=Property } // See: Procedure Set psNoGroupByText for an explanation. Function psNoGroupByText Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.psNoGroupByText(Self)) End_Function // psNoGroupByText { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // If DrawSortTriangleAlways is True, the Sort triangle displayed in column headers when a // column is sorted will always be displayed as long as the column size is large enough to // drawn the triangle. // If DrawSortTriangleAlways is False, the triangle will be removed when the column size is // too small to display both the caption and triangle, this will cause only the caption to // be drawn. If the column size is too small to display the entire caption, the caption // will be abbreviated with ellipses. // Syntax: // Set pbDrawSortTriangleAlways to True/False // Default: True Procedure Set pbDrawSortTriangleAlways Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbDrawSortTriangleAlways to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComDrawSortTriangleAlways of hoPaintManager to bState Set Private.pbDrawSortTriangleAlways to bState Send ComRedraw End_Procedure // Set pbDrawSortTriangleAlways { MethodType=Property } // See: Procedure Set pbDrawSortTriangleAlways for an explanation. Function pbDrawSortTriangleAlways Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.pbDrawSortTriangleAlways(Self)) End_Function // pbDrawSortTriangleAlways { Visibility=Public MethodType=Property InitialValue=clBlue DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Color of the grid lines. // Syntax: // Set peGridLineColor to RGBColor // Constants: // clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clBlue Procedure Set peGridLineColor Integer iColor Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.peGridLineColor to iColor Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComGridLineColor of hoPaintManager to iColor Set Private.peGridLineColor to iColor Send ComRedraw End_Procedure // Set peGridLineColor // See: Procedure Set peGridLineColor for an explanation. Function peGridLineColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.peGridLineColor(Self)) End_Function // peGridLineColor { Visibility=Public MethodType=Property InitialValue=OLExtpAlignmentLeft Category=Appearance } { EnumList ="OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter" } { EnumList+="OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter" } { EnumList+="OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask" } // Aligns the text (and icons) for all header items, iif (if and only if) // pbUseColumnJustificationModeForHeader=False. // Syntax: // Set HeaderJustificationMode to iMode // iMode Constants: // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter // OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter // OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask // Default: OLExtpAlignmentLeft // Note: The pbUseColumnJustificationModeForHeader property _must_ be set to False for // this Property to be used. // You may Use the plus sign (+) to combine constants. You can // override this setting with the HeaderColumnJustificationMode property, // for a particular column. Procedure Set HeaderJustificationMode Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set Private.HeaderJustificationMode to iMode End_Procedure // HeaderJustificationMode // See: Procedure Set HeaderJustificationMode for an explanation. Function HeaderJustificationMode Returns Integer Function_Return (Private.HeaderJustificationMode(Self)) End_Function // HeaderJustificationMode { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // The pbUseColumnJustificationModeForHeader property specifies whether the text in the column // header will Use the ColumnJustificationMode setting to align the header label. // Syntax: // Set pbUseColumnJustificationModeForHeader to True/False // Default: True // Note: This setting will override the HeaderJustificationMode if set to True (Default). Procedure Set pbUseColumnJustificationModeForHeader Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Procedure_Return Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComUseColumnTextAlignment of hoPaintManager to bState Set Private.pbUseColumnJustificationModeForHeader to bState End_Procedure // pbUseColumnJustificationModeForHeader // See: Procedure Set pbUseColumnJustificationModeForHeader for an explanation. Function pbUseColumnJustificationModeForHeader Returns Boolean Function_Return (Private.pbUseColumnJustificationModeForHeader(Self)) End_Function // pbUseColumnJustificationModeForHeader { Visibility=Public MethodType=Property InitialValue=OLExtpAlignmentLeft Category=Appearance } { EnumList="OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter" } { EnumList+="OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter" } { EnumList+="OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask" } // Aligns the text (and icons) of items for all grid columns. (Not headers, see // HeaderJustificationMode, pbUseColumnJustificationModeForHeader and HeaderColumnJustificationMode // for that). // There is also a ColumnJustificationMode property that can be set for a particular column, which // will override this setting. // Syntax: // Set AllColumnJustificationMode to iMode // iMode Constants: // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, OLExtpAlignmentVCenter // OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter // OLExtpAlignmentIconRight, OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, OLExtpAlignmentIconMask // Default: OLExtpAlignmentLeft // Note: You may use the plus sign (+) between operators to combine constants in an expression. Procedure Set AllColumnJustificationMode Integer iMode Set Private.AllColumnJustificationMode to iMode End_Procedure // AllColumnJustificationMode // See: Procedure Set AllColumnJustificationMode for an explanation. Function AllColumnJustificationMode Returns Integer Function_Return (Private.AllColumnJustificationMode(Self)) End_Function // AllColumnJustificationMode { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Specifies whether the ColumnJustificationMode setting is automatically applied to items // for all columns when in edit mode of an item. // Syntax: // Set pbUseColumnAlignmentWhenEditing to True/False // Default: True Procedure Set pbUseColumnAlignmentWhenEditing Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbUseColumnAlignmentWhenEditing to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager > 0) Begin Set ComUseEditTextAlignment of hoPaintManager to bState Set Private.pbUseColumnAlignmentWhenEditing to bState End End_Procedure // Set pbUseColumnAlignmentWhenEditing { MethodType=Property } // See: Procedure pbUseColumnAlignmentWhenEditing for an explanation. Function pbUseColumnAlignmentWhenEditing Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbUseColumnAlignmentWhenEditing(Self)) End_Function // pbUseColumnAlignmentWhenEditing { Visibility=Public MethodType=Property InitialValue=Grid_Visible_Both DesignTime=True Category=Appearance } { EnumList="Grid_Visible_None, Grid_Visible_Horz, Grid_Visible_Vert, Grid_Visible_Both" } // Determines which grid lines will be displayed in the grid, none, horizontal, vertical or both. // Syntax: // Set GridLineMode to iStyle // iStyle Constants: // Grid_Visible_None, Grid_Visible_Horz, Grid_Visible_Vert, Grid_Visible_Both // Default: Grid_Visible_Both Procedure Set GridLineMode Integer iMode Handle hoPaintManager Integer iGridStyleVert iGridStyleHor iReportGridStyle If (not(IsComObjectCreated(Self))) Begin Set Private.GridLineMode to iMode Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Get piReportGridStyle to iReportGridStyle Case Begin Case (iMode = Grid_Visible_None) Set ComVerticalGridStyle of hoPaintManager to OlextpGridNoLines Set ComHorizontalGridStyle of hoPaintManager to OlextpGridNoLines Break Case (iMode = Grid_Visible_Horz) Set ComVerticalGridStyle of hoPaintManager to OlextpGridNoLines Set ComHorizontalGridStyle of hoPaintManager to iReportGridStyle Break Case (iMode = Grid_Visible_Vert) Set ComVerticalGridStyle of hoPaintManager to iReportGridStyle Set ComHorizontalGridStyle of hoPaintManager to OlextpGridNoLines Break Case (iMode = Grid_Visible_Both) Set ComVerticalGridStyle of hoPaintManager to iReportGridStyle Set ComHorizontalGridStyle of hoPaintManager to iReportGridStyle Break Case End Set Private.GridLineMode to iMode Send ComRedraw End_Procedure // Set GridLineMode { MethodType=Property } // See: Procedure Set GridLineMode for an explanation. Function GridLineMode Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.GridLineMode(Self)) End_Function // GridLineMode { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // This mimics the VDF Grid class message to show/hide the column headers. // Syntax: // Set HeaderVisibleState to True/False // Default: True Procedure Set HeaderVisibleState Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.HeaderVisibleState to bState Procedure_Return End Set ComShowHeader to bState Set Private.HeaderVisibleState to bState Send ComRedraw End_Procedure // Set HeaderVisibleState { MethodType=Property } // See: Procedure Set HeaderVisibleState for an explanation. Function HeaderVisibleState Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.HeaderVisibleState(Self)) End_Function // HeaderVisibleState { Visibility=Public MethodType=Property InitialValue=False DesignTime=True Category=Appearance } // This message show/hide the column footers. // Syntax: // Set FooterVisibleState to True/False // Default: False // Note: // The column footer is similar to the column header except that it is displayed at the // bottom of the column. Text can be placed in the footer for each column. This can be // used to display data such as column totals. The FooterLabel property is used to // set the text for each column's footer. Procedure Set FooterVisibleState Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.FooterVisibleState to bState Procedure_Return End Set ComShowFooter to bState Set Private.FooterVisibleState to bState Send ComRedraw End_Procedure // Set FooterVisibleState { MethodType=Property } // See: Procedure Set FooterVisibleState for an explanation. Function FooterVisibleState Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.FooterVisibleState(Self)) End_Function // FooterVisibleState { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // Sets wether grid lines will be drawn after rows to fill the empty space. // Syntax: // Set pbDrawGridForEmptySpace to True/False // Default: True Procedure Set pbDrawGridForEmptySpace Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbDrawGridForEmptySpace to bState Procedure_Return End Set ComDrawGridForEmptySpace of (phoPaintManager(Self)) to bState Set Private.pbDrawGridForEmptySpace to bState Send ComRedraw End_Procedure // pbDrawGridForEmptySpace { MethodType=Property } // See: Procedure Set pbDrawGridForEmptySpace for an explanation. Function pbDrawGridForEmptySpace Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbDrawGridForEmptySpace(Self)) End_Function // pbDrawGridForEmptySpace { Visibility=Public MethodType=Property InitialValue=False DesignTime=True Category=Appearance } // Make row only one line high or multiple lines per row? // True = One line per row only. // Syntax: // Set pbFixedRowHeight to True/False // Note: If set to True, the max size of button icons that can be used is 16x16 pixels. // Default: False Procedure Set pbFixedRowHeight Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbFixedRowHeight to bState Procedure_Return End Set ComFixedRowHeight of (phoPaintManager(Self)) to bState Set Private.pbFixedRowHeight to bState Send ComRedraw End_Procedure // Set pbFixedRowHeight { MethodType=Property } // See: Procedure Set pbFixedRowHeight for an explanation. Function pbFixedRowHeight Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbFixedRowHeight(Self)) End_Function // pbFixedRowHeight { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // Specifies whether grid columns can be resized by dragging the header divider. // Syntax: // Set ResizeColumnState to True/False // Default: True // Note: There is also a ColumnResizable property that can be set on column level. Procedure Set ResizeColumnState Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.ResizeColumnState to bState Procedure_Return End Set ComAllowColumnResize to bState Set Private.ResizeColumnState to bState Send ComRedraw End_Procedure // Set ResizeColumnState { MethodType=Property } // See: Procedure Set ResizeColumnState for an explanation. Function ResizeColumnState Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.ResizeColumnState(Self)) End_Function // ResizeColumnState { Visibility=Public MethodType=Property InitialValue=True DesignTime=True Category=Appearance } // Will enable/disable all tooltips for the entire grid, // including rows and columns. // Syntax: // Set pbEnableToolTips to True/False // Default: True Procedure Set pbEnableToolTips Boolean bState Handle hRecordCollection If (not(IsComObjectCreated(Self))) Begin Set Private.pbEnableToolTips to bState Procedure_Return End Get phoRecordCollection to hRecordCollection If (hRecordCollection > 0) Begin Send ComEnableToolTips of hRecordCollection bState Set Private.pbEnableToolTips to bState End End_Procedure // Set pbEnableToolTips { MethodType=Property } // See: Procedure Set pbEnableToolTips for an explanation. Function pbEnableToolTips Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbEnableToolTips(Self)) End_Function // pbEnableToolTips { Visibility=Public MethodType=Property InitialValue=RC_DefaultTypeface DesignTime=True Category=Appearance } // Will set the typeface for the grid items. // Syntax: // Set Typeface to "Tahoma" // Default: RC_DefaultTypeface // Note: To set the typeface for header and footers; see HeaderTypeface & FooterTypeface Procedure Set Typeface String sTypeface Handle hoPaintManager hoStdFont Variant vFont If (not(IsComObjectCreated(Self))) Begin Set Private.Typeface to sTypeface Procedure_Return End //JVH - check for default typeface special case.... If (sTypeface = RC_DefaultTypeface) Begin Get Private.DefaultTypeface to sTypeface End Get phoPaintManager to hoPaintManager Move (NullComObject()) to vFont Get ComTextFont of hoPaintManager to vFont If (IsNullComObject(vFont)) Begin Error DfErr_Program "Report Component Error. Could not connect to Font object." Procedure_Return End Get phoStdFont to hoStdFont Set pvComObject of hoStdFont to vFont Set ComName of hoStdFont to sTypeface Set Private.Typeface to sTypeface Send ReDraw End_Procedure // Set Typeface { MethodType=Property } // See: Procedure Set Typeface for an explanation. Function Typeface Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.Typeface(Self)) End_Function // Typeface { Visibility=Public MethodType=Property InitialValue=RC_DefaultFontSize DesignTime=True Category=Appearance } // Will set the fontsize for the grid items. // Syntax: // Set FontSize to 10 // Default: RC_DefaultFontSize // Note: To set the fontsize for header and footers; see HeaderFontSize & FooterFontSize Procedure Set FontSize Integer iSize Handle hoPaintManager hoStdFont Variant vFont If (not(IsComObjectCreated(Self))) Begin Set Private.FontSize to iSize Procedure_Return End //JVH - check for default font size special case.... If (iSize = RC_DefaultFontSize) Begin Get Private.DefaultFontSize to iSize End Get phoPaintManager to hoPaintManager Move (NullComObject()) to vFont Get ComTextFont of hoPaintManager to vFont If (IsNullComObject(vFont)) Begin Error DfErr_Program "Report Component Error. Could not connect to Font object." Procedure_Return End Get phoStdFont to hoStdFont Set pvComObject of hoStdFont to vFont Set ComSize of hoStdFont to iSize Set Private.FontSize to iSize Send ReDraw End_Procedure // Set FontSize { MethodType=Property } // See: Procedure Set FontSize for an explanation. Function FontSize Returns String If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.FontSize(Self)) End_Function // FontSize { Visibility=Public MethodType=Property InitialValue=RC_DefaultTypeface DesignTime=True Category=Appearance } // To set the typeface for column headers. // The setting is only used during column creation. // Syntax: // Set HeaderTypeface to "Tahoma" // Default: RC_DefaultTypeface // Note: To set the typeface for items see Typeface and for footers; see FooterTypeface Procedure Set HeaderTypeface String sTypeface Set Private.HeaderTypeface to sTypeface End_Procedure // Set HeaderTypeface { MethodType=Property } // See: Procedure Set HeaderTypeface for an explanation. Function HeaderTypeface Returns String If (not(IsComObjectCreated(Self))) Function_Return "" //JVH - check for default typeface special case.... If (Private.HeaderTypeface(Self) = RC_DefaultTypeface) Begin Function_Return (Private.DefaultHeaderTypeface(Self)) End Function_Return (Private.HeaderTypeface(Self)) End_Function // HeaderTypeface { Visibility=Public MethodType=Property InitialValue=RC_DefaultFontSize DesignTime=True Category=Appearance } // To set the fontsize for column headers. // The setting is only used during column creation. // Syntax: // Set HeaderFontSize to 10 // Default: RC_DefaultFontSize // Note: To set the fontsize for items see FontSize and footers; see FooterFontSize Procedure Set HeaderFontSize Integer iSize Set Private.HeaderFontSize to iSize End_Procedure // Set HeaderFontSize { MethodType=Property } // See: Procedure Set HeaderFontSize for an explanation. Function HeaderFontSize Returns Integer //JVH - check for default font size special case.... If (Private.HeaderFontSize(Self) = RC_DefaultFontSize) Begin Function_Return (Private.DefaultHeaderFontsize(Self)) End Function_Return (Private.HeaderFontSize(Self)) End_Function // FontSize { Visibility=Public MethodType=Property InitialValue=RC_DefaultTypeface DesignTime=True Category=Appearance } // To set the typeface for column footers. // The setting is only used during column creation. // Syntax: // Set FooterTypeface to "Tahoma" // Default: RC_DefaultTypeface // Note: To set the typeface for items see Typeface and for headers; see HeaderTypeface Procedure Set FooterTypeface String sTypeface Set Private.FooterTypeface to sTypeface End_Procedure // Set FooterTypeface { MethodType=Property } // See: Procedure Set FooterTypeface for an explanation. Function FooterTypeface Returns String //JVH - check for default typeface special case.... If (Private.FooterTypeface(Self) = RC_DefaultTypeface) Begin Function_Return (Private.DefaultFooterTypeface(Self)) End Function_Return (Private.FooterTypeface(Self)) End_Function // FooterTypeface { Visibility=Public MethodType=Property InitialValue=RC_DefaultFontSize DesignTime=True Category=Appearance } // To set the fontsize for column footers. // The setting is only used during column creation. // Syntax: // Set FooterFontSize to 10 // Default: RC_DefaultFontSize // Note: To set the fontsize for items see FontSize and headers; see HeaderFontSize Procedure Set FooterFontSize Integer iSize Set Private.FooterFontSize to iSize End_Procedure // Set FooterFontSize { MethodType=Property } // See: Procedure Set FooterFontSize for an explanation. Function FooterFontSize Returns Integer //JVH - check for default font size special case.... If (Private.FooterFontSize(Self) = RC_DefaultFontSize) Begin Function_Return (Private.DefaultFooterFontsize(Self)) End Function_Return (Private.FooterFontSize(Self)) End_Function // FooterFontSize { Visibility=Public MethodType=Property DesignTime=True Category=Appearance PropertyType=Image } // To display a bitmap file as a watermark background for the 'grid' object. // the image file. The bitmap file needs to be in the bitmaps folder // Syntax: // Set psWatermarkBitmap sBitmapFile // Default: None Procedure Set psWatermarkBitmap String sBitmap If (not(IsComObjectCreated(Self))) Begin Set Private.psWatermarkBitmap to sBitmap Procedure_Return End Set WatermarkEx to sBitmap (Private.piWatermarkTransparancy(Self)) (Private.piWatermarkAlignment(Self)) Set Private.psWatermarkBitmap to sBitmap End_Procedure // Procedure Set { MethodType=Property } // See: Procedure Set psWatermarkBitmap for an explanation. Function psWatermarkBitmap Returns String If (not(IsComObjectCreated(Self))) Function_Return "" Function_Return (Private.psWatermarkBitmap(Self)) End_Function // psWatermarkBitmap { Visibility=Public MethodType=Property InitialValue=25 DesignTime=True Category=Appearance } // A percentage (0-100) of transparancy to use when displaying a watermark bitmap. // Syntax: // Set piWatermarkTransparancy to iTransparancyPercentage // Note: In CodeJock the range is really between 0 to 255, but we use a percentage // here instead to simplify. // Default: 25 (percent) Procedure Set piWatermarkTransparancy Integer iTransparancy If (not(IsComObjectCreated(Self))) Begin Set Private.piWatermarkTransparancy to iTransparancy Procedure_Return End Set WatermarkEx to (Private.psWatermarkBitmap(Self)) iTransparancy (Private.piWatermarkAlignment(Self)) Set Private.piWatermarkTransparancy to iTransparancy End_Procedure // piWatermarkTransparancy { MethodType=Property } // See: Procedure Set piWatermarkTransparancy for an explanation. Function piWatermarkTransparancy Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piWatermarkTransparancy(Self)) End_Function // piWatermarkTransparancy { Visibility=Public MethodType=Property InitialValue=OLExtpReportWatermarkUnknown DesignTime=True Category=Appearance } { EnumList= "OLExtpReportWatermarkUnknown, OLExtpReportWatermarkLeft, OLExtpReportWatermarkCenter, OLExtpReportWatermarkRight" } { EnumList+="OLExtpReportWatermarkHmask, OLExtpReportWatermarkTop, OLExtpReportWatermarkVCenter, OLExtpReportWatermarkBottom" } { EnumList+="OLExtpReportWatermarkVmask, OLExtpReportWatermarkStretch, OLExtpReportWatermarkEnlargeOnly" } { EnumList+="OLExtpReportWatermarkShrinkOnly, OLExtpReportWatermarkPreserveRatio" } // Alignment of the watermark image in the grid. You may use the plus sign (+) to combine constants. // Syntax: // Set piWatermarkAlignment to iAlignment // Constants: // OLExtpReportWatermarkUnknown - Unknown (empty) value. // OLExtpReportWatermarkLeft - Horizontal alignment: left side of report control client rect. // OLExtpReportWatermarkCenter - Horizontal alignment: center of report control client rect. // OLExtpReportWatermarkRight - Horizontal alignment: right side of report control client rect. // OLExtpReportWatermarkHmask - A mask for horizontal alignment flags. // OLExtpReportWatermarkTop - Vertical alignment: top side of report control client rect. // OLExtpReportWatermarkVCenter - Vertical alignment: center of report control client rect. // OLExtpReportWatermarkBottom - Vertical alignment: bottom side of report control client rect. // OLExtpReportWatermarkVmask - A mask for vertical alignment flags. // OLExtpReportWatermarkStretch - Stretch watermark to entire report control client rect. // OLExtpReportWatermarkEnlargeOnly - Watermark can be enlarged only, shrinking is disabled. // OLExtpReportWatermarkShrinkOnly - Watermark can be shrunk only, enlarging is disabled. // OLExtpReportWatermarkPreserveRatio - Watermark aspect ratio is preserved. // Default: OLExtpReportWatermarkUnknown Procedure Set piWatermarkAlignment Integer iAlignement If (not(IsComObjectCreated(Self))) Begin Set Private.piWatermarkAlignment to iAlignement Procedure_Return End Set WatermarkEx to (Private.psWatermarkBitmap(Self)) (Private.piWatermarkTransparancy(Self)) iAlignement Set Private.piWatermarkAlignment to iAlignement End_Procedure // piWatermarkAlignment { MethodType=Property } // See: Procedure Set piWatermarkAlignment for an explanation. Function piWatermarkAlignment Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.piWatermarkAlignment(Self)) End_Function // piWatermarkAlignment // This procedure is used by the 'Set psWatermarkBitmap', Set piWatermarkTransparancy, // and Set piWatermarkAlignement procedures. // You may want to use this procedure instead to set all three properties at // one command line. For params see the tree individual Set procedures. // Syntax: // Set WatermarkEx to sFile iPercentageTransparancy iAlignmentParameter Procedure Set WatermarkEx String sFile Integer iTransparancy Integer iAlignment Boolean bState String sPath If (Not(IsComObjectCreated(Self))) Procedure_Return Get psBitmapPath of (phoWorkspace(ghoApplication)) to sPath If (Right(sPath, 1) <> "\") Move (sPath + "\") to sPath Move (sPath + String(sFile)) to sFile Move ((Number(iTransparancy) / 100) * 255) to iTransparancy If (iTransparancy > 255) Move 255 to iTransparancy Get ComSetWatermarkBitmapFromFile sFile iTransparancy to bState #IFDEF get_ComWatermarkAlignment Set ComWatermarkAlignment to iAlignment // Only for CJ version 11.2.2 and later. #ENDIF Send ComRedraw End_Procedure // WatermarkEx // We need to kill this procedure, else the procedures // Set Color and Set TextColor wont work. (Internal VDF behaviour). Procedure Set Dynamic_Colors Integer i1 Integer i2 End_Procedure // Set Dynamic_Colors { Visibility=Public MethodType=Property InitialValue=clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Background color for the entire grid. // Syntax: // Set Color to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Note: Individual items/cells can be set with the ItemColor item property. // Default: clNone Procedure Set Color Integer iColor Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.Color to iColor Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return If (iColor = clNone or iColor = clDefault) Move -1 to iColor Set ComBackColor of hoPaintManager to iColor Set Private.Color to iColor Send ComRedraw End_Procedure // Set Color { MethodType=Property } // See: Procedure Set Color for an explanation. Function Color Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.Color(Self)) End_Function // Color { Visibility=Public MethodType=Property DesignTime=True InitialValue=clDefault PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Foreground or Text color of the grid. // Syntax: // Set TextColor to RGBColor // Constants: // clNone, clDefault, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clBlack Procedure Set TextColor Integer iColor Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.TextColor to iColor Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return If (iColor = clNone or iColor = clDefault) Move -1 to iColor Set ComForeColor of hoPaintManager to iColor Set Private.TextColor to iColor Send ComRedraw End_Procedure // Set TextColor { MethodType=Property } // See: Procedure Set TextColor for an explanation. Function TextColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.TextColor(Self)) End_Function // TextColor { Visibility=Public MethodType=Property InitialValue= clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Sets the background color for the selected row in the grid. // Syntax: // Set CurrentRowColor to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clDefault // Note: The passed iColor will set the color for the current row. However, if the grid // does not have the focus the CurrentRowColorNoGridFocus color will be // used instead. Procedure Set CurrentRowColor Integer iColor Handle hoPaintManager Integer iNoFocusColor If (not(IsComObjectCreated(Self))) Begin Set Private.CurrentRowColor to iColor Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return // The HighlightRowState must have been set to True, else the row color won't display. Set ComSelectionEnable to (Private.HighlightRowState(Self)) // This color is only used when the grid doesn't take the focus. Get CurrentRowColorNoGridFocus to iNoFocusColor // -1 means, let the Report Control set it's default value. If (iNoFocusColor = clNone or iNoFocusColor = clDefault) Move -1 to iNoFocusColor Set ComSelectedRowBackColor of hoPaintManager to iNoFocusColor If (iColor = clNone or iColor = clDefault) Move -1 to iColor // Sets the background color for selected rows. Set ComHighlightBackColor of hoPaintManager to iColor Set Private.CurrentRowColor to iColor // To be able to get function value. Send ComRedraw End_Procedure // CurrentRowColor { MethodType=Property } // See: Procedure Set CurrentRowColor for an explanation. Function CurrentRowColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.CurrentRowColor(Self)) End_Function // CurrentRowColor { Visibility=Public MethodType=Property InitialValue= clDefault DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Sets the text color for the selected row in the grid. // Syntax: // Set CurrentRowTextColor to RGBColor // Constants: // clDefault, clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clDefault // Note: The passed iColor will set the text color for the current row. However, if the grid // does not have the focus the CurrentRowTextColorNoGridFocus color will be // used instead. Procedure Set CurrentRowTextColor Integer iColor Handle hoPaintManager Integer iNoFocusColor If (not(IsComObjectCreated(Self))) Begin Set Private.CurrentRowTextColor to iColor Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return // The HighlightRowState must have been set to True, else the row color won't display. Set ComSelectionEnable to (Private.HighlightRowState(Self)) // This color is only used when the grid doesn't take the focus. Get CurrentRowTextColorNoGridFocus to iNoFocusColor // -1 means, let the Report Control set it's default value. If (iNoFocusColor = clNone or iNoFocusColor = clDefault) Move -1 to iNoFocusColor Set ComHighlightForeColor of hoPaintManager to iNoFocusColor If (iColor = clNone or iColor = clDefault) Move -1 to iColor // Sets the foreground or text color for selected rows. Set ComSelectedRowForeColor of hoPaintManager to (CurrentRowTextColorNoGridFocus(Self)) Set Private.CurrentRowTextColor to iColor // To be able to get the function value. Send ComRedraw End_Procedure // CurrentRowTextColor { MethodType=Property } // See: Procedure Set CurrentRowColor for an explanation. Function CurrentRowTextColor Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.CurrentRowTextColor(Self)) End_Function // CurrentRowTextColor { Visibility=Public MethodType=Property InitialValue= True DesignTime=True Category=Appearance } // When this property is true, the current row will be displayed with the CurrentRowColor. // Syntax: // Set HighlightRowState to True/False // Default: True Procedure Set HighlightRowState Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.HighlightRowState to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return // Specifies whether to draw a focus rectangle around the focused row. Set ComShowRowFocus to bState Set ComSelectionEnable to bState Set Private.HighlightRowState to bState // To be able to get the function value. Send ComRedraw End_Procedure // HighlightRowState { MethodType=Property } // See: Procedure Set HighlightRowState for an explanation. Function HighlightRowState Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.HighlightRowState(Self)) End_Function // HighlightRowState { Visibility=Public MethodType=Property InitialValue= OLEExtpCustomDrawNone Category=Appearance } { EnumList="OLEExtpCustomDrawNone, OLExtpCustomDrawItem, OLExtpCustomMeasureRow, OLExtpCustomBeforeDrawRow, OLExtpCustomDrawPreviewItem" } // The piCustomDraw method is used to specify which of the three custom draw // events should be executed when the rows and items are drawn. // Any combination of the events can be enabled at the same time, // except the OLEExtpCustomDrawNone parameter. // Syntax: // Set piCustomDraw to iMode // iMode Constants: // OLEExtpCustomDrawNone, OLExtpCustomDrawItem, OLExtpCustomMeasureRow, OLExtpCustomBeforeDrawRow, OLExtpCustomDrawPreviewItem // Default: OLEExtpCustomDrawNone // Imporant: The piCustomDraw property setting _must_ precede all other visual appearancy // properties. Else they will not show properly. The Procedure Set piCustomDraw Integer iMode If (not(IsComObjectCreated(Self))) Begin Set Private.piCustomDraw to iMode Procedure_Return End Send ComSetCustomDraw iMode Set Private.piCustomDraw to iMode Send ComRedraw End_Procedure // Set piCustomDraw { MethodType=Property } // See: Procedure Set piCustomDraw for an explanation. Function piCustomDraw Returns Integer Function_Return (Private.piCustomDraw(Self)) End_Function // piCustomDraw { Visibility=Public MethodType=Property InitialValue= False DesignTime=True Category=Appearance } // If True, all columns are sized to fill the entire width of the ReportControl. // When the ReportControl is resized, the Columns will automatically be resized // to fit the new size of the RepotControl. // If False, the columns will Use the width they were assigned when they were created, // or whatever value is stored in the columns width Property. The columns widths may // occupy more or less than the total width of the ReportControl. If the total width // of the columns exceeds the width of the ReportControl, then those columns will not // be visible. When the ReportControl is resized, the size of the columns will not be effected. // Syntax: // Set pbAutoColumnSizing to True/False // Default: True // Note: It is suggested that the developer keeps this property False when designing and // testing an application. As soon as the columns has the right width, this property // can be changed to True, if applicable. Procedure Set pbAutoColumnSizing Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAutoColumnSizing to bState Procedure_Return End Set ComAutoColumnSizing to bState Set Private.pbAutoColumnSizing to bState End_Procedure // Set pbAutoColumnSizing { MethodType=Property } // See: Procedure Set pbAutoColumnSizing for an explanation. Function pbAutoColumnSizing Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAutoColumnSizing(Self)) End_Function // pbAutoColumnSizing { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether Columns can be removed from the ReportControl header. // Syntax: // Set pbAllowColumnRemove to True/False // Note: You will need a FieldChooser object to be able to drop removed columns // back to the grid header. // Default: False Procedure Set pbAllowColumnRemove Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAllowColumnRemove to bState Procedure_Return End Set ComAllowColumnRemove to bState Set Private.pbAllowColumnRemove to bState End_Procedure // Set pbAllowColumnRemove { MethodType=Property } // See: Procedure Set pbAllowColumnRemove for an explanation. Function pbAllowColumnRemove Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAllowColumnRemove(Self)) End_Function // pbAllowColumnRemove { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Specifies whether Columns can be moved to another column place. // Syntax: // Set pbAllowColumnReorder to True/False // Default: True Procedure Set pbAllowColumnReorder Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAllowColumnReorder to bState Procedure_Return End Set ComAllowColumnReorder to bState Set Private.pbAllowColumnReorder to bState End_Procedure // Set pbAllowColumnReorder { MethodType=Property } // See: Procedure Set pbAllowColumnReorder for an explanation. Function pbAllowColumnReorder Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAllowColumnReorder(Self)) End_Function // pbAllowColumnReorder { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Specifies whether the grid can be sorted by clicking on one of the column headers. // This is a grid level setting and effects all columns. There is also a // pbColumnSortable property that can be set at to override this setting // for a particular column. // Syntax: // Set pbAllowAllColumnSort to True/False // Default: True Procedure Set pbAllowAllColumnSort Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAllowAllColumnSort to bState Procedure_Return End Set ComAllowColumnSort to bState Set Private.pbAllowAllColumnSort to bState End_Procedure // Set pbAllowAllColumnSort { MethodType=Property } // See: Procedure Set pbAllowAllColumnSort for an explanation. Function pbAllowAllColumnSort Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAllowAllColumnSort(Self)) End_Function // pbAllowAllColumnSort { Visibility=Public MethodType=Property InitialValue=True Category=Appearance } // Specifies whether a row can be moved up and down with the Ctrl+Up_Arrow and // Ctrl+Down_Arrow. // Syntax: // Set pbAllowMoveRow to True/False // Default: True Procedure Set pbAllowMoveRow Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAllowMoveRow to bState Procedure_Return End Set Private.pbAllowMoveRow to bState End_Procedure // Set pbAllowMoveRow { MethodType=Property } // See: Procedure Set pbAllowMoveRow for an explanation. Function pbAllowMoveRow Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAllowMoveRow(Self)) End_Function // pbAllowMoveRow { Visibility=Public MethodType=Property InitialValue= True DesignTime=True Category=Appearance } // Determines if the grid is enabled or disabled. It will override the // pbAllowEdit state. The whole grid will be grayed and the user will not be able // to click anywhere in the grid or headers or use scroll bars. // Syntax: // Set EnabledState to True/False // Default: True Procedure Set EnabledState Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.EnabledState to bState Procedure_Return End Set ComEnabled to bState Set Private.EnabledState to bState Send ComRedraw End_Procedure // Set EnabledState { MethodType=Property } // See: Procedure Set EnabledState for an explanation. Function EnabledState Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.EnabledState(Self)) End_Function // EnabledState { Visibility=Public MethodType=Property InitialValue= True DesignTime=True Category=Appearance } // Determines if grid items/cells are editable or not. // Syntax: // Set pbAllowEdit to True/False // Default: True // Important: There is also an EntryState property that can be set on // Column and/or on item/cell level. // An EntryState set on either Column or Item/Cell level will override // the pbAllowEdit property. // Note: If an item/cell has its pbIsButton property set to True, it can never be edited. // If set to false it is still possible to delete rows (pbDeleteAllowed), use Cut, // Copy & Paste and move rows up and down. Procedure Set pbAllowEdit Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbAllowEdit to bState Procedure_Return End Set ComAllowEdit to bState Set Private.pbAllowEdit to bState Send ComRedraw End_Procedure // Set pbAllowEdit { MethodType=Property } // See: Procedure Set pbAllowEdit for an explanation. Function pbAllowEdit Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbAllowEdit(Self)) End_Function // pbAllowEdit { Visibility=Public MethodType=Property InitialValue= True DesignTime=True Category=Appearance } // Determine whether items can be edited by single-clicking on the item. // Default: True // Syntax: // Set pbEditOnClick to True/False // It True, when the item is single-clicked, the item will become editable. // The entire ReportControl or the specific Item must have the pbAllowEdit property set to // True for this to work. // If False, the item must be double-clicked to become editable. // Note: If an item/cell has its pbIsButton property set to True, it can never be edited. Procedure Set pbEditOnClick Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbEditOnClick to bState Procedure_Return End Set ComEditOnClick to bState Set Private.pbEditOnClick to bState Send ComRedraw End_Procedure // Set pbEditOnClick { MethodType=Property } // See: Procedure Set pbEditOnClick for an explanation. Function pbEditOnClick Returns Boolean If (not(IsComObjectCreated(Self))) Function_Return False Function_Return (Private.pbEditOnClick(Self)) End_Function // pbEditOnClick { MethodType=Property } // Indicates whether a Copy operation can be performed. // Syntax: // Get CanCopy to bState // Note: If an item/cell has its pbIsButton property set to True, it can never be edited. // There is not a Procedure Set CanCopy Function CanCopy Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComCanCopy to bState Function_Return bState End_Function // CanCopy { MethodType=Property } // Indicates whether a Cut operation can be performed. // Syntax: // Get CanCut to bState // Note: If an item/cell has its pbIsButton property set to True, it can never be edited. // There is not a Procedure Set CanCut Function CanCut Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComCanCut to bState Function_Return bState End_Function // CanCut { MethodType=Property } // Indicates whether a Paste operation can be performed. // Syntax: // Get CanCut to bState // Note: If an item/cell has its pbIsButton property set to True, it can never be edited. // There is not a Procedure Set CanPaste Function CanPaste Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComCanPaste to bState Function_Return bState End_Function // CanPaste // Function needed for CodeJock's toolbar buttons (and menu items). // Returns: EnabledState of the grid object. Function CanDelete Returns Boolean Function_Return (pbDeleteAllowed(Self)) End_Function // CanDelete // Function needed for CodeJock's toolbar buttons (and menu items). // Returns: Always returns False Function CanUndo Returns Boolean Function_Return False End_Function // CanUndo // Function needed for CodeJock's toolbar buttons (and menu items). // Returns: Always returns False Function CanRedo Returns Boolean Function_Return False End_Function // CanRedo // Function needed for CodeJock's toolbar buttons (and menu items). // Returns: EnabledState of the grid object. Function CanSelect Returns Boolean Function_Return (EnabledState(Self)) End_Function // CanSelect { Visibility=Public MethodType=Property DesignTime=True InitialValue= OLExtpBorderClientEdge Category=Appearance } { EnumList="OLExtpBorderNone, OLExtpBorderFlat, OLExtpBorderStaticEdge, OLExtpBorderClientEdge, OLExtpBorderFrame" } // Specifies the border style of the grid object. // Syntax: // Set BorderStyle to iState // Constants: // OLExtpBorderNone, OLExtpBorderFlat, OLExtpBorderStaticEdge, OLExtpBorderClientEdge, OLExtpBorderFrame // Default: OLExtpBorderClientEdge Procedure Set BorderStyle Integer iState If (not(IsComObjectCreated(Self))) Begin Set Private.BorderStyle to iState Procedure_Return End Set ComBorderStyle to iState Set Private.BorderStyle to iState Send ComRedraw End_Procedure // BorderStyle { MethodType=Property } // See: Procedure Set BorderStyle for an explanation. Function BorderStyle Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.BorderStyle(Self)) End_Function // BorderStyle { Visibility=Public MethodType=Property InitialValue= Single_Select Category=Appearance } { EnumList="Single_Select, Multi_Select"} // Determines how item-level selections are processed. // Syntax: // Set SelectMode to iState // Single_Select - Is used when none or a single selection is allowed. As the user selects // a row any previously selected row will be reset. // Multi_Select - Allows the operator to select one, or many rows. // Default: // Single_Select Procedure Set SelectMode Integer iState Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.SelectMode to iState Procedure_Return End Move (iState = Multi_Select) to bState Set ComMultipleSelection to bState Set Private.SelectMode to iState Send ComRedraw End_Procedure // Set SelectMode { MethodType=Property } // See: Procedure Set SelectMode for an explanation. Function SelectMode Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.SelectMode(Self)) End_Function // SelectMode { Visibility=Public MethodType=Property InitialValue= -1 Category=Appearance } // VirtualMode should be used when there will be a very large Number of rows in the Report // Control. VirtualMode can be used with any number of rows, but it is recommended that // VirtualMode be used If adding more than 10,000 rows. Adding more than 10,000 rows in // normal mode becomes quite slow. Using VirtualMode will dramatically increase performance. // // VirtualMode does not require you to manually create the rows and records, all you need to // do is fill in the record data in the BeforeDrawRow event when the record is being displayed. // // When using VirtualMode, the rows that will be displayed should be stored internally in an // Array that can easily be accessed by the Report Control. // // Default: -1 Means do not use virtual mode. // // The following steps should be followed when working in VirtualMode: // 1. Create your own array(dim) with the records that you want to Show in the Report Control. // Each "row" in the array will represent a row in the Report Control. Each element in the // "row" of a multi-dimensional array will represent a record in a row. // // 2. Call piSetVirtualMode, specifying the number of rows that will be in the Report Control. // // 3. Call the SetCustomDraw method and specify that the xtpBeforeDrawRow event will be // executed. by default, this event is not called. // // 4. Use the BeforeDrawRow event to manually fill in the records for each row. Only records // modified in the BeforeDrawRow event will become visible. // // 5. Call Populate to adjust the scroll bars with the current virtual record count. // // 6. Each Time the Number of rows increases or decreases you must call VirtualMode #ofRows // to indicate the new row count. // // Note: You can _not_ group rows or Use the tree view While in virtual mode. Procedure Set piSetVirtualMode Integer iRows If (not(IsComObjectCreated(Self))) Begin Set Private.piSetVirtualMode to iRows Procedure_Return End If (iRows > -1) Begin Send ComSetCustomDraw OLExtpCustomBeforeDrawRow Send ComSetVirtualMode iRows End Set Private.piSetVirtualMode to iRows End_Procedure // Set piSetVirtualMode { MethodType=Property } // See: Procedure Set piSetVirtualMode for an explanation. Function pbSetVirtualMode Returns Integer Function_Return (Private.piSetVirtualMode(Self)) End_Function // piSetVirtualMode { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether Columns can be grouped. // Syntax: // Set pbColumnsGroupable to True/False // Default: False Procedure Set pbColumnsGroupable Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbColumnsGroupable to bState Procedure_Return End Set ComShowGroupBox to bState Set Private.pbColumnsGroupable to bState End_Procedure // Set piSetVirtualMode { MethodType=Property } // See: Procedure Set pbColumnsGroupable for an explanation. Function pbColumnsGroupable Returns Boolean Function_Return (Private.pbColumnsGroupable(Self)) End_Function // pbColumnsGroupable { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether clicked Columns are automatically added to the group box. // Syntax: // Set pbShowItemsInGroups to True/False // Default: False Procedure Set pbShowItemsInGroups Boolean bState If (not(IsComObjectCreated(Self))) Begin Set Private.pbShowItemsInGroups to bState Procedure_Return End Set ComShowGroupBox to bState Set Private.pbShowItemsInGroups to bState End_Procedure // Set pbShowItemsInGroups { MethodType=Property } // See: Procedure Set pbShowItemsInGroups for an explanation. Function pbShowItemsInGroups Returns Boolean Function_Return (Private.pbShowItemsInGroups(Self)) End_Function // pbShowItemsInGroups { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether grouped columns are shaded // Syntax: // Set pbShadeGroupHeadings to True/False // Default: False Procedure Set pbShadeGroupHeadings Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbShadeGroupHeadings to bState Procedure_Return End Get phoPaintManager to hoPaintManager If (hoPaintManager < 1) Procedure_Return Set ComShadeGroupHeadings of hoPaintManager to bState Set Private.pbShadeGroupHeadings to bState Send Redraw End_Procedure // Set pbShadeGroupHeadings { MethodType=Property } // See: Procedure Set pbShadeGroupHeadings for an explanation. Function pbShadeGroupHeadings Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.pbShadeGroupHeadings(Self)) End_Function // pbShadeGroupHeadings { Visibility=Public MethodType=Property InitialValue=False Category=Appearance } // Specifies whether groups can be navigated to via the up and down arrows // Syntax: // Set pbSkipGroupsFocus to True/False // Default: False Procedure Set pbSkipGroupsFocus Boolean bState Handle hoPaintManager If (not(IsComObjectCreated(Self))) Begin Set Private.pbSkipGroupsFocus to bState Procedure_Return End Set ComSkipGroupsFocus to bState Set Private.pbSkipGroupsFocus to bState End_Procedure // Set pbSkipGroupsFocus { MethodType=Property } // See: Procedure Set pbSkipGroupsFocus for an explanation. Function pbSkipGroupsFocus Returns Integer If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.pbSkipGroupsFocus(Self)) End_Function // pbSkipGroupsFocus // *** Column Properties: *** { 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 icon number in an ImageList Procedure Set HeaderIcon Integer iColumn Integer iIcon If (Not(IsComObjectCreated(Self))) Procedure_Return If (iColumn > 0) Set ComIcon of iColumn to iIcon End_Procedure // Set HeaderIcon { MethodType=Property } // Syntax: Get HeaderIcon item iColumn to iIconNumber Function HeaderIcon Integer iColumn Returns Integer Integer iIcon Move 0 to iIcon If (not(IsComObjectCreated(Self))) Function_Return 0 If (iColumn > 0) Get ComIcon of iColumn to iIcon Function_Return iIcon End_Function // HeaderIcon { Visibility=Public MethodType=Property } // Set the width of a particular header column. // Syntax: // Set HeaderWidth item iColumn 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 iColumn Integer iWidth If (not(IsComObjectCreated(Self))) Procedure_Return Set ComResizable of iColumn to True // This must be true to be able to change the column width. Set ComWidth of iColumn to iWidth End_Procedure // HeaderWidth { MethodType=Property } // Get the width of a particular header column. // Syntax: // Get HeaderWidth item iColumn to Integer Function HeaderWidth Integer iColumn Returns Integer Integer iWidth If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComWidth of iColumn to iWidth Function_Return iWidth End_Function // HeaderWidth // Same as Set HeaderWidth. Procedure Set ColumnWidth Integer iColumn Integer iWidth Set HeaderWidth item iColumn to iWidth End_Procedure // HeaderWidth // Same as Set HeaderWidth. Function ColumnWidth Integer iColumn Returns Integer Integer iWidth Get HeaderWidth item iColumn to iWidth Function_Return iWidth End_Function // ColumnWidth // Specifies whether a grid column can be resized by dragging the header divider. // Syntax: // Set ColumnResizable item iColumn to True/False // Default: True // Note: There is also a 'global' grid level ResizeColumnState property. Procedure Set ColumnResizable Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComResizable of iColumn to bState End_Procedure // Set ColumnResizable // See: Set ColumnResizable for an explanation. Function ColumnResizable Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComResizable of iColumn to bState Function_Return bState End_Function // ColumnResizable { 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 item iColumn 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 hColumn Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComHeaderAlignment of hColumn to iMode End_Procedure // Set HeaderColumnJustificationMode { MethodType=Property } // See: Procedure Set HeaderColumnJustificationMode for an explanation. Function HeaderColumnJustificationMode Integer hColumn Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComHeaderAlignment of hColumn to iMode Function_Return iMode End_Function // HeaderColumnJustificationMode { Visibility=Public MethodType=Property } // Define text for headers // Syntax: // Set HeaderLabel item iColumn to "Some text" Procedure Set HeaderLabel Integer iColumn String sLabel Set ComCaption of iColumn to sLabel End_Procedure // Set HeaderLabel { MethodType=Property } // Get the text for a header // Syntax: // Get HeaderLabel item iColumn to sString Function HeaderLabel Integer iColumn Returns String String sLabel If (not(IsComObjectCreated(Self))) Function_Return "" Get ComCaption of iColumn to sLabel Function_Return sLabel End_Function // HeaderLabel { Visibility=Public MethodType=Property } // To set the footer text of the specified column. // Syntax: // Set FooterLabel item iColumn to "Some text" // Note: The FooterVisibleState state must be true. Procedure Set FooterLabel Integer iColumn String sText If (not(IsComObjectCreated(Self))) Procedure_Return Set ComFooterText of iColumn to sText End_Procedure // Set FooterLabel { MethodType=Property } // See: Procedure Set FooterLabel for an explanation. Function FooterLabel Integer iColumn Returns String String sText If (not(IsComObjectCreated(Self))) Function_Return "" Get ComFooterText of iColumn 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 item iColumn 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 hColumn Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComFooterAlignment of hColumn to iMode End_Procedure // Set FooterColumnJustificationMode { MethodType=Property } // See: Procedure Set FooterColumnJustificationMode for an explanation. Function FooterColumnJustificationMode Integer hColumn Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComFooterAlignment of hColumn 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 item iColumn to OLExtpAlignmentLeft // Constants (iMode): // OLExtpAlignmentLeft, OLExtpAlignmentCenter, OLExtpAlignmentRight, // OLExtpAlignmentVCenter, OLExtpAlignmentWordBreak, OLExtpAlignmentTextMask, // OLExtpAlignmentIconLeft, OLExtpAlignmentIconCenter, OLExtpAlignmentIconRight, // OLExtpAlignmentIconTop, OLExtpAlignmentIconVCenter, OLExtpAlignmentIconBottom, // OLExtpAlignmentIconMask // Default: OLExtpAlignmentLeft Procedure Set ColumnJustificationMode Integer iColumn Integer iMode If (not(IsComObjectCreated(Self))) Procedure_Return Set ComAlignment of iColumn to iMode End_Procedure // Set ColumnJustificationMode { MethodType=Property } Function ColumnJustificationMode Integer iColumn Returns Integer Integer iMode If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComAlignment of iColumn to iMode Function_Return iMode End_Function // ColumnJustificationMode { Visibility=Public MethodType=Property } // Set the tooltip for a column // Syntax: // Set HeaderToolTip item iColumn to "Some Header tooltip text" Procedure Set HeaderToolTip Integer iColumn String sToolTip If (not(IsComObjectCreated(Self))) Procedure_Return If (iColumn > 0) Set ComToolTip of iColumn to sToolTip End_Procedure // Set HeaderToolTip { MethodType=Property } // Get the tooltip of a particular header item. // Syntax: // Get HeaderToolTip to sString Function HeaderToolTip Integer iColumn Returns String String sToolTip If (not(IsComObjectCreated(Self))) Function_Return "" If (iColumn > 0) Set ComToolTip of iColumn 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 item iColumn 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 iColumn Integer iStyle Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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 Integer iColumn Returns Integer Integer iStyle Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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. ColumnCapsLockState. // Returns a handle to the ItemEditOptions object (VDF-side) if // it was successfull in connecting, for the passed column number // If unsuccessfull it Returns 0. Function IsColumnEditOptionsObjectConnected 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 // IsColumnEditOptionsObjectConnected { MethodType=Property } // Helper function for item properties. // Returns a handle to the ItemEditOptions object (VDF-side) if // it was successfull in connecting, to the passed item number. // If unsuccessfull it Returns 0. Function IsItemEditOptionsObjectConnected Integer iItem Returns Handle Variant vItemEditOptions Handle hoItemEditOptions If (not(IsComObjectCreated(Self))) Function_Return 0 Move (NullComObject()) to vItemEditOptions Get ComEditOptions of iItem 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 // IsItemEditOptionsObjectConnected // Determines if all text entered to this column from the keyboard will be // converted to upper Case. // Syntax: // Set ColumnCapsLockState item iColumn 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 Integer iColumn Boolean bState Handle hoItemEditOptions Integer iStyle If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle item iColumn to RC_CapsLock End Else Begin // Hmm, will it work to 'remove' the Capslock state from the style?? Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle item iColumn 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 item iColumn to True/False Procedure Set ColumnWordbreakState Integer iColumn Boolean bState Handle hoItemEditOptions Integer iStyle If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle item iColumn to RC_WordBreak End Else Begin // Hmm, will it work to 'remove' the Wordbreak state from the style?? Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle item iColumn 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 item iColumn to True/False // Note: It will also set the justification mode to Right. Procedure Set ColumnNumericState Integer iColumn Boolean bState Handle hoItemEditOptions Integer iStyle If (not(IsComObjectCreated(Self))) Procedure_Return If (bState = True) Begin Set ColumnEditControlstyle item iColumn to RC_Numeric Set ColumnJustificationMode item iColumn to OLExtpAlignmentRight End Else Begin // Hmm, will it work to 'remove' the Numeric state from the style?? Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions > 0) Begin Get ComSelectTextOnEdit of hoItemEditOptions to iStyle Set ColumnEditControlstyle item iColumn to (iStyle - RC_Numeric) Set ColumnJustificationMode item iColumn to OLExtpAlignmentLeft // Default justification mode. End End End_Procedure // Set ColumnNumericState // To set if column items should be checkboxes. // Syntax: // Set ColumnCheckboxState item iColumn to True/False // Note: There is no setting in CodeJock to set a whole column to checkbox state. // However, there is a item property that can be set. So when the column is // created it will be marked with a tag value of 2 to indicate that it is // a checkbox column. When items/cells are added to a column, a check will // be performed to see if the columns tag value=2, in case the item will be // set accordingly. Procedure Set ColumnCheckboxState Integer iColumn Boolean bState Handle hoItemEditOptions Integer iStyle If (not(IsComObjectCreated(Self))) Procedure_Return Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions Set ColumnEditControlstyle item iColumn to RC_Read_Only // We will use the Tag value of the column to indicate that it is a checkbox column. Set ComTag of iColumn to 2 End_Procedure // Set ColumnCheckboxState // See procedure Set ColumnCheckboxState for an explanation. Function ColumnCheckboxState Integer iColumn Returns Boolean Integer iTagValue If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag of iColumn to iTagValue Function_Return (If(iTagValue=2, True, False)) End_Function // ColumnCheckboxState // To set if column items should behave like buttons // Syntax: // Set ColumnButtonState item iColumn to True/False // Note: There is no setting in CodeJock for setting a column to contains push-buttons. // When a column is created it will be marked with a tag value of 1 to indicate // that it is a pushbutton column. When items/cells are added to a column, a check will // be performed to see if the columns tag value=1, in case the item will be // set accordingly. Procedure Set ColumnButtonState Integer iColumn Boolean bState Handle hoItemEditOptions Integer iStyle If (not(IsComObjectCreated(Self))) Procedure_Return Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions Set ColumnEditControlstyle item iColumn to RC_Read_Only // We will use the Tag value of the column to indicate that it is a checkbox column. Set ComTag of iColumn to 1 End_Procedure // Set ColumnButtonState // See procedure Set ColumnButtonState for an explanation. Function ColumnButtonState Integer iColumn Returns Boolean Integer iTagValue If (not(IsComObjectCreated(Self))) Function_Return False Get ComTag of iColumn to iTagValue Function_Return (If(iTagValue=1, True, False)) End_Function // ColumnButtonState { 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 item iColumn to True/False Procedure Set pbColumnSelectTextOnEdit Integer iColumn Boolean bState Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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 Integer iColumn Returns Boolean Handle hoItemEditOptions Boolean bState Get IsColumnEditOptionsObjectConnected 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 item iColumn 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 Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComAutoSize of iColumn to bState End_Procedure // Set ColumnAutoSize // See: Procedure Set ColumnAutoSize for an explanation. Function ColumnAutoSize Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComAutoSize of iColumn 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 item iColumn to bState Procedure Set ColumnEntryState Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return If (iColumn < 0) Procedure_Return Set ComEditable of iColumn to bState End_Procedure // Set ColumnEntryState { MethodType=Property } // See: Set ColumnEntryState for an explanation. Function ColumnEntryState Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iColumn < 0) Function_Return False Get ComEditable of iColumn 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 item iColumn to True/False Procedure Set ColumnShadowState Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ColumnEntryState item iColumn to (not(bState )) Set ComTag of iColumn 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 Integer iColumn Returns Boolean Integer iValue If (not(IsComObjectCreated(Self))) Function_Return False If (iColumn < 0) Function_Return False Get ComTag of iColumn 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 item iColumn to True/False // Note: The combo-button will be drawn inside the item/cell if the // grid level property pbDrawComboButtonInsideCell is true (the default). Procedure Set ColumnComboState Integer iColumn Boolean bState Handle hoItemEditOptions hoInPlaceButton Variant vOptions vInPlaceButton Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions < 1) Procedure_Return Get phoInplaceButton to hoInplaceButton If (bState = True) Begin Send ComAddComboButton of hoItemEditOptions Get ComGetInplaceButton of hoItemEditOptions 0 to vInPlaceButton Set pvComObject of hoInplaceButton to vInPlaceButton Set ComInsideCellButton of hoInplaceButton to (pbDrawComboButtonInsideCell(Self)) 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 item iColumn to True/False Procedure Set ColumnComboEntryState Integer iColumn Boolean bState Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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 item iColumn to True/False Procedure Set ColumnPromptMode Integer iColumn Boolean bState Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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 iColumn Integer iLength Handle hoItemEditOptions Get IsColumnEditOptionsObjectConnected 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 item iItem 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 Integer hColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComSortable of hColumn to bState End_Procedure // Set pbColumnSortable { MethodType=Property } // See: Procedure Set pbColumnSortable for an explanation. Function pbColumnSortable Integer hColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False Get ComSortable of hColumn 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 item iItem 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 Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return Set ComVisible of iColumn to bState End_Procedure // Set pbColumnVisible { MethodType=Property } // See procedure Set pbColumnVisible for an explanation. Function pbColumnVisible Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iColumn > 0) Get ComVisible of iColumn 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 item iColumn 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 Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return If (iColumn > 0) Set ComShowInFieldChooser of iColumn to bState End_Procedure // Set pbShowColumnInFieldChooser { MethodType=Property } // See procedure Set pbShowColumnInFieldChooser for an explanation. Function pbShowColumnInFieldChooser Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iColumn > 0) Get ComShowInFieldChooser of iColumn to bState Function_Return bState End_Function // pbShowColumnInFieldChooser { 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 Integer iColumn Boolean bState If (not(IsComObjectCreated(Self))) Procedure_Return If (iColumn > 0) Set ComGroupable of iColumn to bState End_Procedure // Set pbColumnGroupable { MethodType=Property } // See procedure Set pbColumnGroupable for an explanation. Function pbColumnGroupable Integer iColumn Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iColumn > 0) Get ComGroupable of iColumn to bState Function_Return bState End_Function // pbColumnGroupable // This is the Index of the column given when added to the ReportControl's collection // of columns. The ColumnItemIndex starts at 0 and increments by 1 for each column in the // ReportControl. The ColumnItemIndex will not change when the columns are moved (dragged and // dropped to another location). // The ColumnItemIndex is used to Find and return a reference to a column. Since the Index of // the column might change frequently, the ColumnItemIndex is used when the column needs to be // accessed. Procedure Set ColumnItemIndex Integer hColumn Integer iValue If (not(IsComObjectCreated(Self))) Function_Return 0 Set ComItemIndex of hColumn to iValue End_Procedure // ColumnItemIndex // See procedure Set ColumnItemIndex for an explanation. Function ColumnItemIndex Integer hColumn Returns Integer Integer iValue If (not(IsComObjectCreated(Self))) Function_Return 0 Get ComItemIndex of hColumn to iValue Function_Return iValue End_Function // ColumnItemIndex // *** cComIReportRecordItemEditOptions and the ConstraintEdit property // *** Specifies whether data not declared in the list of constraints can be entered into the edit box. // ComItem iItem of a hoRecord gives the vItem // 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 Move (NullComObject()) to vColumn If (not(IsComObjectCreated(Self))) Function_Return vColumn Get ComFind of (phoColumnCollection(Self)) iIndex to vColumn Function_Return vColumn End_Function // ColumnFind // Helper function for e.g. AddComboConstraintValue. // Returns a handle to the ConstraintsCollection object (VDF-side) it // it was successfull in connecting. // If unsuccessfull it Returns 0. Function IsConstraintsCollectionConnected Integer iColumn Returns Handle Variant vConstraintsCollection Handle hoItemEditOptions hoConstraintsCollection If (not(IsComObjectCreated(Self))) Function_Return 0 Get IsColumnEditOptionsObjectConnected iColumn to hoItemEditOptions If (hoItemEditOptions < 1) Function_Return 0 Move (NullComObject()) to vConstraintsCollection Get ComConstraints of hoItemEditOptions to vConstraintsCollection If (IsNullComObject(vConstraintsCollection)) Function_Return 0 Get phoConstraintsCollection to hoConstraintsCollection Set pvComObject of hoConstraintsCollection to vConstraintsCollection Function_Return hoConstraintsCollection End_Function // IsConstraintsCollectionConnected // To fill the combos for the passed column with values. // Adds a constraint to the column's ConstraintsCollection. // Syntax: // Note: The ColumnComboState needs to be true for values to show. Procedure AddComboConstraintValue Integer iColumn String sValue Integer iCount Handle hoConstraintsCollection Get IsConstraintsCollectionConnected iColumn to hoConstraintsCollection If (hoConstraintsCollection < 1) Procedure_Return Get ComCount of hoConstraintsCollection to iCount Send ComAdd of hoConstraintsCollection sValue iCount End_Procedure // AddComboConstraintValue // Private helper message for the ColumnComboListObject procedure. Procedure Private.FillComboListObject Integer iItem String sValue String sDescVal Integer iTable RowID riRowId Handle hColum Boolean bDescVal Get Private.pbDescriptionValue to bDescVal If (bDescVal = False) Begin Send AddComboConstraintValue (phoCurrentColumn(Self)) sValue End Else Begin Send AddComboConstraintValue (phoCurrentColumn(Self)) sDescVal End End_Procedure // Private.FillComboList // To connect a VDF list object with a column's combobox. The list will be // used to fill the comboboxes for the passed column number. // It will work to connect any of these four class objects: // 1. ValidationTable // 2. DescriptionValidationTable // 3. FileValidationTable // 4. CodeValidationTable // // Syntax: Set ColumnComboListObject item iColumn to hoListObject True/False // Pass False as bDescVal to get the Data_Value of the validation table, or // pass True as bDescVal to get the Description_Value of the validation table. // Note: The ColumnComboState needs to be true for values to show. Procedure Set ColumnComboListObject Overloaded Integer iColumn Handle hoList Boolean bDescVal String sListValue Integer iItems i If (hoList < 1) Procedure_Return Set Private.pbDescriptionValue to bDescVal Send Request_Fill_From_List of hoList (Self) msg_Private.FillComboListObject End_Procedure // Set ColumnComboListObject // We overload the ColumnComboListObject procedure to allow a syntax without passing the // boolean parameter. // Else we would have received a runtime error about a missing parameter. Procedure Set ColumnComboListObject Overloaded Integer iColumn Handle hoList String sListValue Integer iItems i If (hoList < 1) Procedure_Return Set Private.pbDescriptionValue to False Send Request_Fill_From_List of hoList (Self) msg_Private.FillComboListObject End_Procedure // Set ColumnComboListObject // *** Item Properties: *** { Visibility=Public MethodType=Property } // To set the value of an individual item/cell. // Syntax: // Set Value item iItem to "Some text" // Note: // We need to set two value here. The ComValue is the value to sort on // when the column header is clicked. The ComCaption is the value that is // passed to the OnClick event. This can be used to figure out which item/cell // was acted upon. Procedure Set Value Integer iItem String sValue Boolean bIsButton If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Begin Set ComValue of iItem to sValue Get pbIsButton item iItem to bIsButton // We need to set ComCaption for buttons in the OnClick procedure. // We do _not_ need it for other items/cells because if // we did, when a value is edited, it will look like it // never was edited when leaving the item because the item // will then display the ComCaption value, and not the // newly changed value (ComValue)! // So to keep the changes visible in the item/cell, do not set the caption, // for normal items. Do it for item buttons only. If (bIsButton = True) Set ComCaption of iItem to sValue End End_Procedure // Set Value { MethodType=Property } // Syntax: // Get Value item iItem to sString Function Value Integer iItem Returns String String sValue If (not(IsComObjectCreated(Self))) Function_Return "" If (iItem > 0) Get ComValue of iItem to sValue Function_Return sValue End_Function // Value { Visibility=Public MethodType=Property } // To set an item/cell text to bold. Procedure Set pbBold Integer iItem Boolean bState If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Set ComBold of iItem to bState End_Procedure // Set pbBold { MethodType=Property } // To get if an item/cell text is bold or not. Function pbBold Integer iItem Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iItem > 0) Get ComBold of iItem to bState Function_Return bState End_Function // pbBold { Visibility=Public MethodType=Property } // To set an item/cell text to bold. // Note: This is the same as using the pbBold property. // To set an item to BoldFace set the Weight to > 400. // This is put here for legacy purposes. Procedure Set FontWeight Integer iItem Integer iWeight Boolean bState If (Not(IsComObjectCreated(Self))) Procedure_Return Move (If(iWeight <=400, False, True)) to bState If (iItem > 0) Set ComBold of iItem to bState End_Procedure // Set FontWeight // To get if an item/cell text is bold or not. // Returns: // Integer. If a value of 700 is returned the fontweight is bold. // Else if a value of 400 is returned the fontweight is not bold. Function FontWeight Integer iItem Returns Integer Integer iWeight Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iItem > 0) Get ComBold of iItem to bState Function_Return (If(bState = True, 700, 400)) End_Function // FontWeight { Visibility=Public MethodType=Property } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Set the background color for an item/cell. // Syntax: Set ItemColor item iItem to iColor // Constants: // clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, // clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Note: You can also use the VDF RGB function to specify a color. Procedure Set ItemColor Integer iItem Integer iColor If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Set ComBackColor of iItem to iColor End_Procedure // Set ItemColor { MethodType=Property } // Get the background color of an item/cell. // Syntax: Get ItemColor item iItem to Integer Function ItemColor Integer iItem Returns Integer Integer iColor If (not(IsComObjectCreated(Self))) Function_Return 0 If (iItem > 0) Get ComBackColor of iItem to iColor Function_Return iColor End_Function // ItemColor { Visibility=Public MethodType=Property } { EnumList="clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Set the text or foreground color for an item/cell. // Syntax: Set ItemTextColor item iItem to iColor // Constants: // clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, // clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Note: You can also use the VDF RGB function to specify a color. Procedure Set ItemTextColor Integer iItem Integer iColor If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Set ComForeColor of iItem to iColor End_Procedure // Set ItemTextColor { MethodType=Property } // Get the text or foreground color of an item/cell. // Syntax: Get ItemTextColor item iItem to Integer Function ItemTextColor Integer iItem Returns Integer Integer iColor If (not(IsComObjectCreated(Self))) Function_Return 0 If (iItem > 0) Get ComForeColor of iItem to iColor Function_Return iColor End_Function // ItemTextColor { Visibility=Public MethodType=Property } // To set an icon for a item/cell in the grid. // Syntax: Set Icon item iItem to RC_ButtonNormal // Params: // iItem is the item number // iIcon is the icon number in an ImageList Procedure Set Icon Integer iItem Integer iIcon If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Set ComIcon of iItem to iIcon End_Procedure // Set Icon { MethodType=Property } // To Get an icon for a item/cell in the grid. // Syntax: Get Icon item iItem to iIconNumber Function Icon Integer iItem Returns Integer Integer iIcon Move -1 to iIcon If (not(IsComObjectCreated(Self))) Function_Return 0 If (iItem > 0) Get ComIcon of iItem to iIcon Function_Return iIcon End_Function // Icon { Visibility=Public MethodType=Property } // Set the tooltip for an item/cell // Set ToolTip item iItem to "Item tooltip text" Procedure Set ToolTip Integer iItem String sToolTip If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem > 0) Set ComToolTip of iItem to sToolTip End_Procedure // Set ToolTip { MethodType=Property } // Get the tooltip for an item/cell Function ToolTip Integer iItem Returns String String sToolTip If (not(IsComObjectCreated(Self))) Function_Return "" If (iItem > 0) Get ComToolTip of iItem to sToolTip Function_Return sToolTip End_Function // ToolTip { Visibility=Public MethodType=Property } // Determines if an item/cell can be edited. // 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 EntryState item iItem to True/FALSE Procedure Set EntryState Integer iItem Boolean bState Boolean bIsButton Handle hoItemEditOptions If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem < 0) Procedure_Return Get pbIsButton item iItem to bIsButton If (bIsButton = True) Move False to bState // Never allow a button to be edited. (Just makes sense). Set ComEditable of iItem to bState // Specifies whether an Edit control is used for the item. Get IsItemEditOptionsObjectConnected iItem to hoItemEditOptions If (hoItemEditOptions > 0) ; Set ComAllowEdit of iItem to bState End_Procedure // Set EntryState { MethodType=Property } // Syntax: Get EntryState item iItem to bState Function EntryState Integer iItem Returns Boolean Boolean bIsButton bState Handle hoItemEditOptions If (not(IsComObjectCreated(Self))) Function_Return False If (iItem < 0) Function_Return False Get IsItemEditOptionsObjectConnected iItem to hoItemEditOptions If (hoItemEditOptions > 0) ; Get ComAllowEdit of iItem to bState Function_Return bState End_Function // EntryState { MethodType=Property } // To set the ItemShadowState for a single item/cell. // Syntax: Set ItemShadowState item iItem to True/FALSE // Note: This means that the item/cell won't be focusable, and the color is changed. Procedure Set ItemShadowState Integer iItem Boolean bState Boolean bIsButton Integer iBackColor iForeColor If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem < 0) Procedure_Return Set ComFocusable of iItem to (not(bState)) If (bState = True) Begin Get piColumnShadowStateColor to iBackColor if (iBackColor = clDefault) Move -1 to iBackColor // Use the default Report Control color Get piColumnShadowStateTextColor to iForeColor End Else Begin Get Color to iBackColor Get TextColor to iForeColor End Set ComBackColor of iItem to iBackColor Set ComForeColor of iItem to iForeColor End_Procedure // Set ItemShadowState { MethodType=Property } // To get the ItemShadowState for a single item/cell. // Syntax: Get ItemShadowState item iItem to bState Function ItemShadowState Integer iItem Returns Boolean Boolean bIsButton bState If (not(IsComObjectCreated(Self))) Function_Return False If (iItem < 0) Function_Return False Get ComFocusable of iItem to bState Function_Return bState End_Function // ItemShadowState // We need to augment this VDF function from Shadow_Mixin here, // because it normally queries the ItemShadowState. And it will // do so with a bad timing, when COM object hasn't been paged (created). Function Object_Shadow_State returns integer Function_Return 0 End_Function // Object_Shadow_State // Procedure for testing various CodeJock settings. Procedure Set Extra_State Integer iItem Integer iState Handle hoItemEditOptions Variant vOptions If (not(IsComObjectCreated(Self))) Procedure_Return // Set ComEditable of iItem to True Get phoItemEditOptions to hoItemEditOptions Send ComCreateEditOptions of iItem Get ComEditOptions of iItem to vOptions Set pvComObject of hoItemEditOptions to vOptions // Set ComAllowEdit of hoItemEditOptions to True // Shouldn't be necessary. Send ComAddComboButton of hoItemEditOptions End_Procedure // Set Extra_State { Visibility=Public MethodType=Property } // Should an item/cell be treated as a button? // Syntax: // Set pbIsButton item iItem to True/False // Note: The enum_list's RC_ButtonNormal and RC_ButtonPressed // icons will be used to display the button in an item/cell. // Syntax: Set pbIsButton item iItem to True/FALSE // // If a ReportRecordItem does not have a CheckBox, then setting the ComChecked // property has no effect. However, we can still set this property for our own usage, // namely to keep track of that this is a button item/cell. Procedure Set pbIsButton Integer iItem Boolean bState Integer iBackColor iForeColor If (Not(IsComObjectCreated(Self))) Procedure_Return If (iItem < 0) Procedure_Return Set ComHasCheckbox of iItem to False // We never want it to look like a checkbox! Set ComChecked of iItem to bState // We do want to use the ComChecked state to indicate if a button. Set ComEditable of iItem to (not(bState)) // Also needed, else the text will 'flash' when pressed. Get piButtonBackColor to iBackColor If (iBackColor = clDefault) Move -1 to iBackColor // -1 means; Let the Report Control use its default color. Get piButtonForeColor to iForeColor If (iForeColor = clDefault) Move -1 to iForeColor Set ComBackColor of iItem to iBackColor Set ComForeColor of iItem to iForeColor Set Icon of iItem to RC_ButtonNormal // *** TODO: Make into property? End_Procedure // Set pbIsButton { MethodType=Property } // Is the item/cell a button? Function pbIsButton Integer iItem Returns Boolean Boolean bState bCheckbox Move False to bState If (not(IsComObjectCreated(Self))) Function_Return bState If (iItem < 0) Function_Return bState Get ComHasCheckbox of iItem to bCheckbox If (bCheckbox = False) Get ComChecked of iItem to bState Function_Return bState End_Function // pbIsButton { MethodType=Property } // Allows any item to become a checkbox-type item. // Syntax: // Set CheckboxItemState item iItem to True/False Procedure Set CheckboxItemState Integer iItem Boolean bState Handle hoEditOptions hItem Integer iColumn If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem < 0) Procedure_Return Set ComHasCheckbox of iItem to bState // Get ItemProxyObjectFromItemNumber iItem to hItem // Get IsItemEditOptionsObjectConnected hItem to hoEditOptions // This will disallow editing of the checkbox label. // Send ComCreateEditOptions of hItem // If (hoEditOptions > 0) ; // Set ComAllowEdit of hItem to False End_Procedure // Set CheckboxItemState { MethodType=Property } // Is the item/cell a checkbox? // Syntax: // Get CheckboxItemState item iItem to bState Function CheckboxItemState Integer iItem Returns Boolean Boolean bState If (not(IsComObjectCreated(Self))) Function_Return False If (iItem < 0) Function_Return False Get ComHasCheckbox of iItem to bState Function_Return bState End_Function // CheckboxItemState { MethodType=Property } // Reflects whether this item/cell is checked. // Syntax: // Set CheckedState item iItem to True/False Procedure Set CheckedState Integer iItem Boolean bState Boolean bCheckbox If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem < 0) Procedure_Return Get CheckboxItemState of iItem to bCheckbox If (bCheckbox = False) Procedure_Return Set ComChecked of iItem to bState End_Procedure // Set CheckedState { MethodType=Property } // Is the item/cell checked? // Syntax: // Get CheckedState item iItem to bState Function CheckedState Integer iItem Returns Boolean Boolean bState bCheckbox If (not(IsComObjectCreated(Self))) Function_Return False If (iItem < 0) Function_Return False Get CheckboxItemState of iItem to bCheckbox If (bCheckbox = False) Function_Return False Get ComChecked of iItem to bState Function_Return bState End_Function // CheckedState { Visibility=Public MethodType=Property } // Syntax: // Set AuxValue item iItem to sValue // You may use it to store any value you might wish to have associated with the item. Procedure Set AuxValue Integer iItem String sValue If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem >= 0) Set ComTag of iItem to sValue End_Procedure // Set AuxValue // Same as Set AuxValue Procedure Set Aux_Value Integer iItem String sValue Set AuxValue item iItem to sValue End_Procedure // Set Aux_Value { MethodType=Property } // Syntax: // Get AuxValue item iItem to sValue Function AuxValue Integer iItem Returns String String sValue sRow Variant vRecord If (not(IsComObjectCreated(Self))) Function_Return "" If (iItem >= 0) Get ComTag of iItem to sValue Function_Return sValue End_Function // AuxValue // Same as AuxValue. Function Aux_Value Integer iItem Returns String String sValue Get AuxValue item iItem to sValue Function_Return sValue End_Function // Aux_Value { Visibility=Public MethodType=Property } // Syntax: // Set psGroupCaption item iItem to sValue // You may this to replace the group caption (column label) to some other text Procedure Set psGroupCaption Integer iItem String sValue If (not(IsComObjectCreated(Self))) Procedure_Return If (iItem >= 0) Set ComGroupCaption of iItem to sValue End_Procedure // Set AuxValue { MethodType=Property } // Syntax: // See: Procedure Set psGroupCaption for an explanation. Function psGroupCaption Integer iItem Returns String String sValue If (not(IsComObjectCreated(Self))) Function_Return "" If (iItem >= 0) Get ComGroupCaption of iItem to sValue Function_Return sValue End_Function // psGroupCaption // *** Other General Grid Messages *** { MethodType=Property } // Returns the total number of columns created for the grid. 1 based. Function ColCount Returns Integer Handle hoColumnCollection Integer iRetval Move 0 to iRetval If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoColumnCollection to hoColumnCollection If (hoColumnCollection > 0) Get ComCount of hoColumnCollection to iRetval Function_Return iRetval End_Function // ColCount // Note: Same as ColCount Function Col_Count Returns Integer Function_Return (ColCount(Self)) End_Function // Col_Count // Note: Same as ColCount Function piColumns Returns Integer Function_Return (ColCount(Self)) End_Function // piColumns // Note: Same as ColCount Function Column_Count Returns Integer Function_Return (ColCount(Self)) End_Function // Column_Count // Note: Same as piColumns Function ColumnCount Returns Integer Function_Return (ColCount(Self)) End_Function // ColumnCount { Visibility=Public MethodType=Property InitialValue= clAqua DesignTime=True PropertyType=Color Category=Appearance } { EnumList="clBtnFace, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // Sets the color of the selected item/cell. // Syntax: // Set CurrentCellColor to RGBColor // Constants: // clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow // Default: clAqua // * TODO: The OnComBeforeDrawRow event has been augmented to set the current cell color. // * However, it paints the whole row // * So for now it doesn't work to set the CurrentCellColor. Procedure Set CurrentCellColor Integer iColor Set Private.CurrentRowColor to iColor // To be able to get function value. End_Procedure // CurrentCellColor { MethodType=Property } // See: Procedure Set CurrentCellColor for an explanation. Function CurrentCellColor Returns Integer Function_Return (Private.CurrentCellColor(Self)) End_Function // CurrentCellColor { Visibility=Public MethodType=Property DesignTime=False} { EnumList="clNone,clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // The forground or text color of the currently 'active' cell/item. // Syntax: // Set CurrentCellTextColor to RGBColor // * For now it doesn't work to set the CurrentCellColor. Procedure Set CurrentCellTextColor Integer iColor Set Private.CurrentCellTextColor to iColor End_Procedure // CurrentCellTextColor { MethodType=Property } // See: Procedure Set CurrentCellTextColor for an explanation. Function CurrentCellTextColor Returns Integer Integer iColor Get Private.CurrentCellTextColor to iColor Function_Return iColor End_Function // CurrentCellTextColor { MethodType=Property } // *** Record versus Row explanation *** // // When should I use Record and when should I use Row? // // A Record is a bunch of data stored by the Report control. Some data pieces (items) // could be quite large, so Record objects do not "run" across the memory. Its main // responsibility is to maintain the data inside. Not all of each record needs to be // visibly displayed. // // Row is a piece of the visual interface. It processes record drawing, user mouse and // keyboard events. Rows could be rebuilt frequently inside the Report control depending // on currently specified Grouping, Sorting, Hiding and other options. Each regular row // has an associated Record. But there are other kinds of rows - for example Group Rows. // They implement another specific behavior. // // So If you'd like simply access the data inside the Report control -- you should work // with Records. // // // Returns the total number of Rows (or Records, it's the same) created for the grid. // One based. Cannot be set. Function RowCount Returns Integer Integer iRows Handle hoRecordCollection Move 0 to iRows If (not(IsComObjectCreated(Self))) Function_Return iRows Get phoRecordCollection to hoRecordCollection If (hoRecordCollection > 0) Get ComCount of hoRecordCollection to iRows Function_Return iRows End_Function // RowCount // Same as RowCount. Function Row_Count Returns Integer Function_Return (RowCount(Self)) End_Function // Row_Count // Same as RowCount. Function piRows Returns Integer Function_Return (RowCount(Self)) End_Function // piRows // Same as RowCount. Function piRecords Returns Integer Function_Return (RowCount(Self)) End_Function // piRecords { MethodType=Property } // Returns the total number of items/cells created for the grid. 1 based. // Cannot be set. Function ItemCount Returns Integer Integer iRows iCols iCol If (not(IsComObjectCreated(Self))) Function_Return 0 Function_Return (Private.ItemCount(Self)) End_Function // ItemCount // Cannot be set. Same as ItemCount. Function Item_Count Returns Integer Function_Return (ItemCount(Self)) End_Function // Item_Count // Cannot be set. Same as ItemCount. Function piCells Returns Integer Function_Return (ItemCount(Self)) End_Function // piCells // *** TODO: // This isn't finished. It has been put here so we don't forget to // reduce the ItemCount when an item/cell is deleted. Procedure DeleteItem Integer iItem Integer iItems If (pbDeleteAllowed(Self) = False) Procedure_Return Get ItemCount to iItems Set Private.ItemCount to (iItems -1) // *** Do other stuff here: End_Procedure // DeleteItem // Same as DeleteItem. Procedure Delete_Item Integer iItem Send DeleteItem iItem End_Procedure // Delete_Item { MethodType=Property } // Returns the current item/cell as an zero based integer (first item/cell = 0) // Returns -1 if the grid is empty. // *** TODO: Currently there is no way to Set the CurrentItem. Function CurrentItem Returns Integer Integer iRow iCol iCols iCurrentItem Move -1 to iCurrentItem If (not(IsComObjectCreated(Self))) Function_Return iCurrentItem Get CurrentRow to iRow // Zero based Get CurrentCol to iCol // Zero based Get ColCount to iCols // One based Move ((iRow * iCols) + (iCol + 1)) to iCurrentItem If (iCurrentItem < 0) Move -1 to iCurrentItem // This means the grid is empty. Else Decrement iCurrentItem Function_Return iCurrentItem End_Function // CurrentItem // Same as Current_Item. Function Current_Item Returns Integer Integer iRetval Get CurrentItem to iRetval Function_Return iRetval End_Function // Current_Item { Visibility=Public } // To move the focus to a particular row. // Syntax: // Set CurrentRow to iInteger Procedure Set CurrentRow Integer iRow Variant vRow Handle hRows Integer iRows If (not(IsComObjectCreated(Self))) Procedure_Return Get phoRowCollection to hRows If (hRows < 1) Procedure_Return Get RowCount to iRows // This result is 1-based. If (iRow > iRows) Move iRows to iRow // Don't allow more than the last row... Get ComRow of hRows iRow to vRow Set ComFocusedRow to vRow End_Procedure // Set CurrentRow // Same as Set CurrentRow. Procedure Set Current_Row Integer iRow Set CurrentRow to iRow End_Procedure // Set CurrentRow { MethodType=Property } // To get the row number of the currently focused row. // Returns: // The row Number as an zero based Integer, or -1 If unsuccessfull. // Note: This is not the same as getting the current record, see // function CurrentRecord for that. This is the visual // row that is displayd on screen. // A row can change a lot, depending if it is grouped or not. // But a record is always at 'the same place'. Function CurrentRow Returns Integer Integer iRow Variant vRow vRecord Handle hRow hRecord Boolean bGrouped If (not(IsComObjectCreated(Self))) Function_Return -1 Move -1 to iRow Move (NullComObject()) to vRow Get ComFocusedRow to vRow If (not(IsNullComObject(vRow))) Begin Get phoCurrentRow to hRow Set pvComObject of hRow to vRow Get ComIndex of hRow to iRow End Function_Return iRow End_Function // CurrentRow // Same as function CurrentRow. Function Current_Row Returns Integer Function_Return (CurrentRow(Self)) End_Function // Current_Row { MethodType=Property } // To get the record number of the currently focused row. // Returns: // The record Number as an zero based Integer, or -1 If unsuccessfull. // Note: This is the current record, which may or may not be the same // as the current row. It will be the same iff (if and only if) // no sorting, grouping or copy/cut/paste has been used. Function CurrentRecord Returns Integer Integer iRow iRecord Variant vRow vRecord Handle hRow hRecord Boolean bGrouped If (not(IsComObjectCreated(Self))) Function_Return -1 Move -1 to iRecord Move (NullComObject()) to vRow Get ComFocusedRow to vRow If (not(IsNullComObject(vRow))) Begin Get phoCurrentRow to hRow Set pvComObject of hRow to vRow Move (NullComObject()) to vRecord Get ComRecord of hRow to vRecord If (not(IsNullComObject(vRecord))) Begin Get phoCurrentRecord to hRecord Set pvComObject of hRecord to vRecord Get ComIndex of hRecord to iRecord End End Function_Return iRecord End_Function // CurrentRecord // Same as function CurrentRecord. Function Current_Record Returns Integer Function_Return (CurrentRecord(Self)) End_Function // Current_Record { Visibility=Public } // To move the focus to a particular column. Zero based. // Syntax: // Set CurrentCol to iInteger Procedure Set CurrentCol Integer iCol Variant vCol Handle hCols Integer iCols If (not(IsComObjectCreated(Self))) Procedure_Return Get phoColumnCollection to hCols If (hCols < 1) Procedure_Return Get ColumnCount to iCols // The result is 1-based. If (iCol > iCols) Move iCols to iCol // Don't allow more than the last column... Else If (iCol < 0) Move 0 to iCol Get ComColumn of hCols iCol to vCol Set ComFocusedColumn to vCol End_Procedure // Set CurrentCol // Same as Set CurrentCol. Procedure Set Current_Col Integer iCol Set CurrentCol to iCol End_Procedure // Set Current_Col { MethodType=Property } // Return the row number of the currently focused row. // Returns: // The column number as a zero based Integer, or -1 If unsuccessfull. // The ItemIndex is the Index of the column given when added to the ReportControl's // collection of columns. The ComItemIndex starts at 0 and increments by 1 for each column // in the ReportControl. The ComItemIndex will not change when the columns are moved // (dragged and dropped to another location). Function CurrentCol Returns Integer Integer iCol Variant vCol Handle hCols hCol If (not(IsComObjectCreated(Self))) Function_Return -1 Get phoColumnCollection to hCols If (hCols < 1 or iCol < 0) Function_Return -1 Move -1 to iCol Move (NullComObject()) to vCol Get ComFocusedColumn to vCol If (not(IsNullComObject(vCol))) Begin Get phoCurrentColumn to hCol Set pvComObject of hCol to vCol Get ComItemIndex of hCol to iCol End Function_Return iCol End_Function // CurrentCol // Same as function CurrentCol. Function Current_Col Returns Integer Function_Return (CurrentCol(Self)) End_Function // Current_Col // *** Translation functions: *** // // Here are a number of functions for translating between a // column,row and item number and the corresponding COM object and back. // COM objects are always of type Variant. // The number (row or column) is always an integer. // // The VDF proxy object corresponding to the COM object handle returned, must be // set with the 'Set pvComObject of oVDFProxyObjectName to vComObject' syntax, // _before_ any properties of the proxy object can be manipulated. // Note: These proxy objects already exist and also handles to those objects via // property handles. E.g. phoColumnCollection, phoRecordCollecion, phoRecordItem // Also note that some of these functions automatically connects the COM object to the // VDF proxy object. // // // // // - Use this function to get a Column COM object handle from a column number. // Syntax: // Get ColumnComObjectFromColumnIndex iColumn to vColumnComObject // Returns: // A handle to the COM object for the iColumn as a variant. // Returns a NULL variant if unsuccessfull. // Note: // The iColumn passed _must_ be the ItemIndex for the column, which is the // default index of the column. Since the Index of the column might change // frequently, the ItemIndex is used when the column needs to be accessed. Function ColumnComObjectFromColumnNumber Integer iColumn Returns Variant Variant vColumn Handle hCols Move (NullComObject()) to vColumn If (not(IsComObjectCreated(Self))) Function_Return vColumn Get phoColumnCollection to hCols If (hCols < 1 or iColumn < 0) Function_Return vColumn Get ComFind of hCols iColumn to vColumn Function_Return vColumn End_Function // ColumnComObjectFromColumnNumber // Use this function to connect a Column COM object with a VDF proxy object // for the passed Column number. Remember that Column numbers are zero based. // Syntax: // Get ColumnProxyObjectFromColumnNumber iColumn to hColumn // Returns: // A handle to the VDF proxy object for the passed column number. // It will automatically connect the proxy object with the ComObject. // Note: // Returns a Handle=0 if unsuccessfull. Function ColumnProxyObjectFromColumnNumber Integer iColumn Returns Handle Variant vColumn Handle hColumn Get ColumnComObjectFromColumnNumber iColumn to vColumn Get phoCurrentColumn to hColumn Set pvComObject of hColumn to vColumn If ((IsNullComObject(vColumn))) Move 0 to hColumn Function_Return hColumn End_Function // ColumnProxyObjectFromColumnNumber // This is the reciprocal function of ColumnComObjectFromColumnNumber. // Syntax: // Get ColumnNumberFromColumnComObject vColumn to iColumn // Returns: // An integer which is the column item number for the passed COM object handle. // The column number returned is zero based. // Returns -1 if unsuccessfull. // Note: // It is the ItemIndex that is returned, not Index. See ColumnComObjectFromColumnNumber // function for an explanation. Function ColumnNumberFromColumnComObject Variant vColumn Returns Integer Integer iColumn Handle hCols Move -1 to iColumn If (not(IsComObjectCreated(Self))) Function_Return iColumn Get phoColumnCollection to hCols If (hCols < 1 or (IsNullComObject(vColumn))) Function_Return iColumn Get ComItemIndex of hCols vColumn to iColumn Function_Return iColumn End_Function // ColumnNumberFromColumnComObject // To get the column number of the passed item number. // Syntax: // Get ColumnNumberFromItemNumber iItem to iColumn Function ColumnNumberFromItemNumber Integer iItem Returns Integer Integer iCols iCol Get ColCount to iCols // One based. Move (Mod(iItem, iCols)) to iCol Function_Return iCol End_Function // ColumnNumberFromItemNumber { MethodType=Property } // To get a Record COM object handle from a record item number. // Syntax: // Get RecordComObjectFromRecordNumber iRecord to vRecordComObject // Returns: // A handle to the COM object for the passed iRecord item as a variant. // Returns a NULL variant if unsuccessfull. Function RecordComObjectFromRecordNumber Integer iRecord Returns Variant Variant vRecord Handle hRecords Move (NullComObject()) to vRecord Get phoRecordCollection to hRecords If (not(IsComObjectCreated(Self))) Function_Return vRecord If (hRecords < 1 or iRecord < 0) Function_Return vRecord Get ComRecord of hRecords iRecord to vRecord Function_Return vRecord End_Function // RecordComObjectFromRecordNumber // Returns: // A handle to the VDF proxy object for the passed iRecord number. // The VDF Record object will automatically be connected to the Com Object. // Note: // Returns a Handle=0 if unsuccessfull. Function RecordProxyObjectFromRecordNumber Integer iRecord Returns Handle Variant vRecord Handle hRecord Get RecordComObjectFromRecordNumber iRecord to vRecord Get phoCurrentRecord to hRecord Set pvComObject of hRecord to vRecord If ((IsNullComObject(vRecord))) Move 0 to hRecord Function_Return hRecord End_Function // RecordProxyObjectFromRecordNumber // This is the reciprocal function of RecordComObjectFromRecordNumber. // Syntax: // Get RecordNumberFromRecordComObject vRecordComObject to iRecord // Returns: // An integer which is the record number for the passed COM object handle. // The record number returned is zero based. // Returns -1 if unsuccessfull. Function RecordNumberFromRecordComObject Variant vRecord Returns Integer Integer iRecord Handle hRecords Move -1 to iRecord If (not(IsComObjectCreated(Self))) Function_Return iRecord Get phoRecordCollection to hRecords If (hRecords < 1 or (IsNullComObject(vRecord))) Function_Return iRecord Get ComIndex of hRecords vRecord to iRecord Function_Return iRecord End_Function // RecordNumberFromRecordComObject { MethodType=Property } // To get a Row COM object handle from a record Number. // Syntax: // Get RowComObjectFromRecordNumber iRecord to vRowComObject // Returns: // A handle to the COM object for the iRecord as a variant. // Returns a NULL variant if unsuccessfull. // Note: A row and a record may be the same, but not always. // If Grouping, Sorting, Hiding is used or a row has been moved the two // will _not_ be the same. Function RowComObjectFromRecordNumber Integer iRecord Returns Variant Variant vRecord vRow Handle hRows Move (NullComObject()) to vRecord If (not(IsComObjectCreated(Self))) Function_Return vRecord Get phoRowCollection to hRows If (hRows < 1 or iRecord < 0) Function_Return vRecord Get RecordComObjectFromRecordNumber iRecord to vRecord If (IsNullComObject(vRecord)) Function_Return vRecord Move (NullComObject()) to vRow // Finds row corresponded with the specified record. Get ComFindRow of hRows vRecord to vRow Function_Return vRow End_Function // RowComObjectFromRecordNumber // * Do we need the reciprocal version of RowComObjectFromRecordNumber??? { MethodType=Property } // To get a Row COM object handle from a row Number. // Syntax: // Get RowComObjectFromRowNumber iRow to vRowComObject // Returns: // A handle to the COM object for the iRow as a variant. // Returns a NULL variant if unsuccessfull. // Note: Because rows can e.g. be grouped, the object isn't necessary // what you want (or in the place you think it is). Function RowComObjectFromRowNumber Integer iRow Returns Variant Variant vRow Handle hRows Move (NullComObject()) to vRow If (not(IsComObjectCreated(Self))) Function_Return vRow Get phoRowCollection to hRows If (hRows < 1 or iRow < 0) Function_Return vRow Get ComRow of hRows iRow to vRow Function_Return vRow End_Function // RowComObjectFromRowNumber // Returns: // A handle to the VDF proxy object for the passed iRow number. // The VDF Row object will automatically be connected to the Com Object. // Note: // Returns a Handle=0 if unsuccessfull. Function RowProxyObjectFromRowNumber Integer iRow Returns Handle Variant vRow Handle hRow Get RowComObjectFromRowNumber iRow to vRow Get phoCurrentRecord to hRow Set pvComObject of hRow to vRow If ((IsNullComObject(vRow))) Move 0 to hRow Function_Return hRow End_Function // RowProxyObjectFromRowNumber // To get the row number of the passed item number. // Syntax: // Get RowNumberFromItemNumber iItem to iRow Function RowNumberFromItemNumber Integer iItem Returns Integer Integer iCols iRow Get ColCount to iCols // One based. Move (iItem / iCols) to iRow Function_Return iRow End_Function // RowNumberFromItemNumber { MethodType=Property } // To get an Item COM object handle from an item Number. // Syntax: // Get ItemComObjectFromItemNumber iItem to vItemComObject // Returns: // A handle to the COM object for the iItem as a variant. // Returns a NULL variant if unsuccessfull. Function ItemComObjectFromItemNumber Integer iItem Returns Variant Variant vRecord vItem vRow Handle hRecords hRecord hRows hRow Integer iRow iCol Move (NullComObject()) to vItem If (not(IsComObjectCreated(Self))) Function_Return vItem Get phoRecordCollection to hRecords If (hRecords < 1 or iItem < 0) Function_Return vItem Get phoRowCollection to hRows If (hRows < 1 or iItem < 0) Function_Return vItem Get RowNumberFromItemNumber iItem to iRow // Get the corresponding row number. Zero based. Move (NullComObject()) to vRecord Get ComRecord of hRecords iRow to vRecord // Get the row COM object's handle. If (IsNullComObject(vRecord)) Function_Return vItem Get phoCurrentRecord to hRecord Set pvComObject of hRecord to vRecord Get ColumnNumberFromItemNumber iItem to iCol // Get the corresponding column number. Zero based. Get ComItem of hRecord iCol to vItem // Gets an item from the collection by its index. Function_Return vItem End_Function // ItemComObjectFromItemNumber // Returns: // A handle to the VDF proxy object for the passed iItem number. // The VDF Item object will be automatically connected to the Com Object. // Note: // Returns a Handle=0 if unsuccessfull. Function ItemProxyObjectFromItemNumber Integer iItem Returns Handle Variant vItem Handle hItem Get ItemComObjectFromItemNumber iItem to vItem Get phoCurrentItem to hItem Set pvComObject of hItem to vItem If ((IsNullComObject(vItem))) Move 0 to hItem Function_Return hItem End_Function // ItemProxyObjectFromItemNumber // This is the reciprocal function of ItemNumberFromItemComObject. // Syntax: // Get ItemNumberFromItemComObject vItemComObject to iItem // Returns: // An integer which is the item number for the passed COM object handle. // The item number returned is zero based. // Returns -1 if unsuccessfull. Function ItemNumberFromItemComObject Variant vItem Returns Integer Integer iItem iRow iCol iCols iCurrentItem Handle hItem hRecord Variant vRecord Move -1 to iItem If (not(IsComObjectCreated(Self))) Function_Return iItem If (IsNullComObject(vItem)) Function_Return iItem Get phoCurrentItem to hItem // Handle to the VDF proxy item object. Set pvComObject of hItem to vItem // Connect proxy with COM object. Get ComIndex of hItem to iCol // Get the index which is = the column number. Get ComRecord of hItem to vRecord // Collection of items for an item. Get phoCurrentRecord to hRecord Set pvComObject of hRecord to vRecord Get RecordNumberFromRecordComObject vRecord to iRow Get ColCount to iCols Move ((iRow * iCols) + (iCol + 1)) to iItem Function_Return iItem End_Function // ItemNumberFromItemComObject // Syntax: // Get ItemNumberFromItemProxyObject hItem to iItem // Returns: // An integer which is the item number for the passed VDF Proxy object handle. // The item number returned is zero based. // Returns -1 if unsuccessfull. // Note: The pvComObject of the VDF proxy object passed (hItem) must // have been Set prior using this function. Function ItemNumberFromItemProxyObject Handle hItem Returns Integer Integer iItem Variant vItem Move -1 to iItem If (not(IsComObjectCreated(Self))) Function_Return iItem If (IsNullComObject(vItem)) Function_Return iItem Get pvComObject of hItem to vItem Get ItemNumberFromItemComObject vItem to iItem Function_Return iItem End_Function // ItemNumberFromItemProxyObject // ItemProxyObjectFromRowAndColumn: // Returns a record item proxy object from the passed row & column. // Returns 0 if record item was not found. Function ItemProxyObjectFromRowAndColumn Variant vRow Variant vColumn Returns Variant Variant vItem Handle hoItem Get ItemComObjectFromRowAndColumn vRow vColumn to vItem Get phoCurrentItem to hoItem Set pvComObject of hoItem to vItem If ((IsNullComObject(vItem))) Move 0 to hoItem Function_Return hoItem End_Function // ItemProxyObjectFromRowAndColumn // ItemComObjectFromRowAndColumn: // Returns a record item COM object from the passed row & column. // Returns null if record item was not found. Function ItemComObjectFromRowAndColumn Variant vRow Variant vColumn Returns Variant Variant vRecord vItem Handle hoRecord hoRow hoColumn Integer iCol If (not(IsComObjectCreated(Self))) Function_Return (NullComObject()) If (IsNullComObject(vRow) or IsNullComObject(vColumn)) Function_Return (NullComObject()) // Get the column index.... Get phoCurrentColumn to hoColumn Set pvComObject of hoColumn to vColumn Get ComIndex of hoColumn to iCol // Get the record of the passed row.... Get phoCurrentRow to hoRow Set pvComObject of hoRow to vRow Get ComRecord of hoRow to vRecord Get phoCurrentRecord to hoRecord Set pvComObject of hoRecord to vRecord // Get the iColumn'th item from this record.... Get ComItem of hoRecord iCol to vItem Function_Return vItem End_Function // ItemComObjectFromRowAndColumn // The EditItem method is used to set focus to a specific row and column combination so that // that item can be edited. // Syntax: // Send EditItem iItem Procedure EditItem Integer iItem Integer iRow iCol Get RowNumberFromItemNumber iItem to iRow Get ColumnNumberFromItemNumber iItem to iCol Send EditItemEx iRow iCol End_Procedure // EditItem // Helper procedure for message EditItem. Or it can be used stand alone. // Syntax: // Send EditItemEx iRow iCol // Note: The item that will be edited is the item where the specified Row and Column // intersect. The EditItem method will allow the item to be edited without making the // item editable. // If the item to be edited is not currently in the grid view, the rows will scroll // until the item is visible in the grid view. Procedure EditItemEx Integer iRow Integer iCol Variant vRow vCol Get RecordComObjectFromRecordNumber iRow to vRow Get ColumnComObjectFromColumnNumber iCol to vCol Send ComEditItem vRow vCol End_Procedure // EditItemEx { Visibility=Public } // Deletes all data from the grid. It will not touch the columns. Procedure DeleteData Handle hRecordCollection hoRowCollection Variant vNull Handle hRecord If (Not(IsComObjectCreated(Self))) Procedure_Return Get phoRecordCollection to hRecordCollection If (hRecordCollection < 1) Procedure_Return Send ComDeleteAll of hRecordCollection Send InitPrivateProperties // We must set the phoCurrentRecord object to null; i.e. detach the VDF proxy // object from the COM side. Else the AddItem message wont work. Get phoCurrentRecord to hRecord Move (NullComObject()) to vNull Set pvComObject of hRecord to vNull Send Populate // This is needed to refresh the grid. End_Procedure // DeleteData // Same as DeleteData. Procedure Delete_Data Send DeleteData End_Procedure // Delete_Data { Visibility=Public } // Removes all columns from the ReportControls collection of columns. // Note: This will only delete the columns, the data stored in the Records // will remain unchanged. Procedure RemoveColumns Handle hColumnCollection If (not(IsComObjectCreated(Self))) Procedure_Return Get phoColumnCollection to hColumnCollection If (hColumnCollection < 1) Procedure_Return Send ComDeleteAll of hColumnCollection Send InitPrivateProperties Send Populate // This is needed to refresh the grid. End_Procedure // RemoveColumns // Same as the Remove_Columns message. Procedure DeleteColumns Send RemoveColumns End_Procedure // DeleteColumns { Visibility=Public } // Deletes all icons from the internal icon manager list that has been added with // the AddIcon message. Procedure RemoveIcons Handle hImageManager If (not(IsComObjectCreated(Self))) Procedure_Return Get phoImageManager to hImageManager If (hImageManager < 1) Procedure_Return Send ComRemoveAll of hImageManager Send Populate // This is needed to refresh the grid. End_Procedure // RemoveIcons // Same as the Remove_Icons message. Procedure DeleteIcons Send RemoveIcons End_Procedure // DeleteIcons // Same as the Remove_Icons message. Procedure Remove_Icons Send RemoveIcons End_Procedure // Remove_Icons { Visibility=Public } // To remove _one_ icon from the internal icon manager list that has been added with // an AddIcon message. Procedure RemoveIcon Integer iID Handle hImageManager If (not(IsComObjectCreated(Self))) Procedure_Return Get phoImageManager to hImageManager If (hImageManager < 1) Procedure_Return Send ComRemoveIcon of hImageManager iId Send Populate // This is needed to refresh the grid. End_Procedure // RemoveIcon // Same as the Remove_Icon message. Procedure Remove_Icon Integer iID Send RemoveIcon iID End_Procedure // Remove_Icon // Same as the Remove_Icon message. Procedure IconRemove Integer iID Send RemoveIcon iID End_Procedure // IconRemove { Visibility=Public MethodType=Property InitialValue= clDefault DesignTime=True PropertyType=Color } { EnumList="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" } // The IconMaskColor sets the color mask of the icons/bitmaps that will be added // to the icon manager list. // By default, the top left corner of the icon/bitmap is used as the mask color. Use the // IconMaskColor property to specify a new mask color. // Syntax: // Set IconMaskColor to iColor // Default: clDefault // Constants: // clNone, clAqua, clBlack, clBlue, clBtnFace, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow Procedure Set IconMaskColor Integer iColor Handle hImageManager If (not(IsComObjectCreated(Self))) Procedure_Return If (iColor = clNone or iColor = clDefault) Move -1 to iColor Get phoImageManager to hImageManager If (hImageManager < 1) Procedure_Return Set ComMaskColor of hImageManager to iColor End_Procedure // IconMaskColor { MethodType=Property } // The IconMaskColor property gets the color mask of the icons/bitmaps that will be added // to the icon manager list. // Syntax: // Get IconMastColor to iColor Function IconMaskColor Returns Integer Handle hImageManager Integer iColor If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoImageManager to hImageManager If (hImageManager < 1) Function_Return 0 Get ComMaskColor of hImageManager to iColor Function_Return iColor End_Function // IconMaskColor { MethodType=Property } // Determines if the Operating System supports 32-bit Alpha Icons. // Can only be 'get'. Function IconIsAlphaIconsSupported Returns Boolean Handle hImageManager Boolean bState If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoImageManager to hImageManager If (hImageManager < 1) Function_Return 0 Get ComIsAlphaIconsSupported of hImageManager to bState Function_Return bState End_Function // IconIsAlphaIconsSupported { MethodType=Property } // The number of icons in the collection of images (icon manager list). Function IconCount Returns Integer Integer iItems Handle hImageManager If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoImageManager to hImageManager If (hImageManager < 1) Function_Return Get ComCount of hImageManager to iItems Function_Return iItems End_Function // IconCount // Redraws all icons. Procedure IconRefresh Handle hImageManager If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoImageManager to hImageManager If (hImageManager < 1) Function_Return Send ComRefreshAll of hImageManager End_Procedure // IconRefresh Procedure ReDraw Send ComRedraw End_Procedure // ReDraw { Visibility=Public } // Display an about box showing the CodeJock Report Control version. Procedure AboutBox If (Not(IsComObjectCreated(Self))) Procedure_Return Send ComAboutBox End_Procedure // AboutBox { Visibility=Public } // Displays the data put in the items/cells onto the screen. Procedure Populate If (Not(IsComObjectCreated(Self))) Procedure_Return Send ComPopulate End_Procedure // Populate { Visibility=Public } // Display a print preview window. // Pass True to show print preview dialog before displaying. Procedure PrintPreview Boolean bShowPrintDialog If (Not(IsComObjectCreated(Self))) Procedure_Return Send ComPrintPreview bShowPrintDialog End_Procedure // PrintPreview { Visibility=Public } // To Set up printer properties before you use the printer dialog. Procedure ShowPrintPageSetup Boolean bRetval If (not(IsComObjectCreated(Self))) Procedure_Return Get ComShowPrintPageSetup to bRetval End_Procedure // ShowPrintPageSetup { Visibility=Public } // Printing using the default printer dialog. // Prints the grid content to a printer. Procedure PrintReport If (Not(IsComObjectCreated(Self))) Procedure_Return Send ComPrintReport 0 End_Procedure // PrintReport { Visibility=Public } // Prints the grid content to a printer, without // displaying a printer dialog. Procedure PrintReportWithoutDialog If (Not(IsComObjectCreated(Self))) Procedure_Return Send ComPrintReport2 False End_Procedure // PrintReportWithoutDialog { Visibility=Public } // To Delete the current row (row that has the focus). It is called from OnComKeyDown. // It will also make the toolbar Delete button work. // Note: We cannot change the name of this message because it is being used by VDF internally. Procedure Request_Delete Integer iRow If (pbDeleteAllowed(Self) = False) Procedure_Return If (Verify_Delete(Self) <> 0) Procedure_Return Get CurrentRecord to iRow // Rows are zero based. Send DeleteRow iRow // Delete the row from both the record and row collection. End_Procedure // Request_Delete // Same as Request_Delete. Procedure RequestDelete Send Request_Delete End_Procedure // RequestDelete // The Delete message is send from CodeJock's toolbar buttons. // * TODO. This is an intermediate solution. We should instead enable/disable // the cCJDeleteMenuItem class action. But then we must fully support // 'Get DEOInformation (&hoServer) (&bHasRecord) (&bChanged) (&bHasIndex) to bIsDeo' // ...and question is if we should mimic 'data-aware' behaviour in this non-data-aware class?? Procedure Delete Send Request_Delete End_Procedure // Delete { Visibility=Public } // Procedure to delete the passed row number. Is called from Request_Delete. Procedure DeleteRow Integer iRow Send RawDeleteRow iRow Get CurrentRow to iRow Set CurrentRow to (iRow + 1) // Set focus to the row after the one we removed. Send Populate End_Procedure // Delete_Row // Same as DeleteRow. Procedure Delete_Row Integer iRow Send DeleteRow iRow End_Procedure // Delete_Row // Helper procedure for DeleteRow. Does the real delete of the row, but without touching // any visual parts (like moving the focus or making the change seen on screen) Procedure RawDeleteRow Integer iRow Handle hRecords hRows Get phoRecordCollection to hRecords Send ComRemoveAt of hRecords iRow End_Procedure // RawDelete_Row { Visibility=Public } // Inserts a row at the passed index. The passed variant // is a COM object pointer to the record that is to be inserted. Procedure InsertRow Integer iRow Variant vRecord Send RawInsertRow iRow vRecord Send Populate End_Procedure // InsertRow // Helper procedure for Insert_Row. Does the real insert of the row, but without touching // any visual parts (like moving the focus or making the change seen on screen) Procedure RawInsertRow Integer iRow Variant vRecord Handle hRecords Get phoRecordCollection to hRecords Send ComInsertAt of hRecords iRow vRecord End_Procedure // RawInsert_Row // To move the currently selected row up one row. // Press: Ctrl+UpArrow to move the row up one line. // Note: Alt+UpArrow will also work. // * TODO: Does not work properly when ordering of rows has been changed. Procedure MoveRowUp Integer iRecord iRow Handle hRecords Variant vRecord Boolean bAllowed Get pbAllowMoveRow to bAllowed Get CurrentRow to iRow If (bAllowed = False or iRow < 1) Procedure_Return Get CurrentRecord to iRecord Get RecordComObjectFromRecordNumber iRecord to vRecord Get phoRecordCollection to hRecords // Send ComCut Send ComRemoveAt of hRecords iRecord Send ComInsertAt of hRecords (iRow -1) vRecord Set CurrentRow to (iRow -1) // Send ComPaste Send Populate End_Procedure // MoveRowUp // To move the currently selected row down one row. // Press: Ctrl+DownArrow to move the row down one line. // Note: Alt+DownArrow will also work. // * TODO: Does not work properly when ordering of rows has been changed. Procedure MoveRowDown Integer iRow iRows Handle hRecords Variant vRecord Boolean bAllowed Get pbAllowMoveRow to bAllowed If (bAllowed = False) Procedure_Return Get RowCount to iRows Get CurrentRow to iRow If (iRow = iRows) Procedure_Return Get phoRecordCollection to hRecords Get RecordComObjectFromRecordNumber iRow to vRecord Send ComRemoveAt of hRecords iRow Send ComInsertAt of hRecords (iRow +1) vRecord Set CurrentRow to iRow Send Populate End_Procedure // MoveRowDown { Visibility=Public } // *** TODO: There is something wrong when cut/copy/paste is applied to // rows that already has been cut/copied or pasted. Then the // current row seems to point to the totally wrong place, in fact // to the place (I think) where the record originally came from. // // Copies the current row to the 'clipboard'. Procedure Copy Boolean bAllowed Integer iRow Variant vRecord Get CanCopy to bAllowed If (bAllowed = False) Procedure_Return Get CurrentRow to iRow Get RecordComObjectFromRecordNumber iRow to vRecord // Get RowComObjectFromRowNumber iRow to vRow Set Private.ClipboardRecordVariant to vRecord Set Private.ClipboardRecordIndex to iRow End_Procedure // Copy { Visibility=Public } // Cuts the current row to the 'clipboard'. Procedure Cut Boolean bAllowed Integer iRow Variant vRecord Get CanCut to bAllowed If (bAllowed = False) Procedure_Return Get CurrentRow to iRow Send RawCut Set CurrentRow to (iRow +1) // Set it to the row where we were plus one (we just removed a row). Send Populate // Show the result on screen. End_Procedure // Cut // Helper procedure for the Cut message. // This message does not deal with visual stuff. // See Cut for that. Procedure RawCut Integer iRow Variant vRecord vRow Get CurrentRow to iRow Get RecordComObjectFromRecordNumber iRow to vRecord // Get RowComObjectFromRowNumber iRow to vRow Set Private.ClipboardRecordVariant to vRecord Set Private.ClipboardRecordIndex to iRow Send RawDeleteRow iRow End_Procedure // Cut { Visibility=Public } // Pastes a copied or cut row from the 'clipboard'. Procedure Paste Boolean bAllowed Integer iRow Get CanPaste to bAllowed If (bAllowed = False) Procedure_Return Get CurrentRow to iRow Send RawPaste Set CurrentRow to iRow //- 1) Send Populate End_Procedure // Paste // Helper procedure for the Paste message. // This message does not deal with visual stuff. // See Paste for that. Procedure RawPaste Integer iRow Variant vRecord Get CurrentRow to iRow Get Private.ClipboardRecordVariant to vRecord Send RawInsertRow iRow vRecord End_Procedure // RawPaste // *** Other messages *** { Visibility=Public } // Adds an image to the imagelist. // We assume that this is an icon unless the .bmp extension is passed. // Returns True if success // Parameters: // sImage: The name of the Icon or bitmap file without path. // iId: The Id is an arbitrarely integer ID value, but see also Enum_List at top // of this package named RO_xxx, etc. This id is used when you want to use // the icon in a column or item/cell. Function AddImage String sImage Integer iId Returns Integer Boolean bIsIcon If (not(IsComObjectCreated(Self))) Function_Return 0 Move (Pos(".bmp",Lowercase(sImage))=0) to bIsIcon Get AddImageType bIsIcon sImage iId to iId Function_Return iId End_Function // AddImage // Same as the AddImage function. Function AddIcon String sImage Integer iId Returns Integer Get AddImage sImage iId to iId Function_Return iId End_Function // AddImage { Visibility=Public } // Helper function for the AddImage message. Can also be used standalone. // Adds an image to the internal imagelist. Pass if bmp or icon and an image filename. // This will first look for the resource then search for the file in the Bitmap file path. // returns True if success. // // Note: Although eImageType have five constants defined for it; xtpImageNormal, xtpImageDisabled // xtpImageHot, xtpImageChecked and xtpImagePressed, // the only one that works is xtpImageNormal. (Else the image won't be loaded). Function AddImageType Boolean bIsIcon String sImage Integer iId Returns Integer Handle hBitmap hoImageIcons Variant vImageManager Integer iVoid eType eImageType Boolean bOk String sPath If (not(IsComObjectCreated(Self))) Function_Return 0 // If no id passed, autonumber images i the list. If (iId=0) Begin Get piLastImageId to iId Increment iId Set piLastImageId to iId End Move xtpImageNormal to eImageType // This is the only ImageType that works. Move (If(bIsIcon, IMAGE_ICON, IMAGE_BITMAP)) to eType Move (LoadImage(GetModuleHandle(0), sImage, eType, 0, 0, 0)) to hBitmap // The icon/bitmap was not in the EXE resource, get it from the Bitmap folder. If (hBitmap = 0) Begin Get psBitmapPath of (phoWorkspace(ghoApplication)) to sPath Move (sPath + "\" + sImage) to sImage If (sImage <> "") Begin Move (LoadImage(0, sImage, eType, 0, 0, LR_LOADFROMFILE)) to hBitmap End End // The icon/bitmap was in the EXE resource. If (hBitmap <> 0) Begin Get phoImageManager to hoImageIcons If (bIsIcon = True) Send ComAddIcon of hoImageIcons hBitmap iId eImageType Else Send ComLoadBitmap of hoImageIcons hBitmap iId eImageType Move (DeleteObject(hBitmap)) to iVoid End Function_Return (If(hBitmap <> 0, iId, 0)) End_Function // AddImageType { Visibility=Public } // Adds a new column to the grid object (Report Control) // Syntax: // Get AddColumn "Header label" to hColumn // Returns: A handle to the newly created column. // After using this function the returned handle can be used to set the // HeaderIcon, HeaderToolTip, HeaderJustificationMode et.al. for the column. // Note: If you would like to add a header tooltip, width and if the column should be // resizable, all at the same command line, use the AddColumnEx function instead. // The reason for this Function is that it is easy to use if only the header // label needs to be set, and it is in line with the AddRow and AddItem functions Function AddColumn String sHeaderLabel Returns Handle Handle hColumn If (not(IsComObjectCreated(Self))) Function_Return 0 Get AddColumnEx sHeaderLabel "" 0 True to hColumn Function_Return hColumn End_Function // AddColumn // Same as AddColumn, but without the sHeaderlabel parameter. Function Add_Column Overloaded Returns Handle Handle hColumn Get AddColumn to hColumn Function_Return hColumn End_Function // Add_Column { Visibility=Public } // Adds a new column to the grid object (Report Control) // If a ColumnCollection object has _not_ previously been created, it will be // automatically created, because without it a column cannot be created. // Takes four parameters; sHeaderText, sTooltipText, iColumnWidth and if it is allowed to // resize the column width at runtime (True/False). // Returns the handle to the newly created object that can be used to change more // properties for the column. // Syntax: // Get AddColumnEx "Header text" "Tooltip text" iWidth bResizable // 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. Function AddColumnEx String sHeaderText String sToolTip Integer iWidth Boolean bResizable Returns Handle Handle hoColumnCollection hColumn hoPaintManager hoStdFont Variant vColumn vColumns vFont Integer iCol String sTypeface If (not(IsComObjectCreated(Self))) Function_Return 0 If (iWidth < 1) Get piDefaultColWidth to iWidth Get phoColumnCollection to hoColumnCollection If (hoColumnCollection < 1) Begin Error DfErr_Program "The column collection object is missing. Cannot create a column." Function_Return 0 End Move (NullComObject()) to vColumns Get pvComObject of hoColumnCollection to vColumns If (IsNullComObject(vColumns)) Begin Get ComColumns to vColumns Set pvComObject of hoColumnCollection to vColumns End Get ComCount of hoColumnCollection to iCol Get ComAdd of hoColumnCollection iCol sHeaderText iWidth bResizable to vColumn If (IsNullComObject(vColumn)) Begin Error DfErr_Program ("Com Report Component Error. Could not create column number:" * String(iCol)) Function_Return 0 End Get phoCurrentColumn to hColumn Set pvComObject of hColumn to vColumn // Set all property values that we have knowledge of: Set ComToolTip of hColumn to sToolTip // This may be overridden by the ColumnJustificationMode property for a particular column. // It is a grid level property. // ***TEMP *** commented out until the auto edit justification stuff works: // Set ComAlignment of hColumn to (Private.AllColumnJustificationMode(Self)) Set ColumnEntryState item hColumn to True // Set the default for a new column. // We set the header alignment to the HeaderJustificationMode setting which is // a 'global' setting for all header items. After the AddColumn function has been // used the returned handle (hColumn) can be used with the HeaderColumnJustificationMode // property, to change the alignment for a particular header item (Just the header, // not entire column). Note: We only do this if pbUseColumnJustificationModeForHeader= False, else // the ColumnJustificationMode property will get used. If (pbUseColumnJustificationModeForHeader(Self) = False) ; Set ComHeaderAlignment of hColumn to (Private.HeaderJustificationMode(Self)) Set ComAllowColumnRemove of hColumn to (Private.pbAllowColumnRemove(Self)) If (Private.pbAllowColumnRemove(Self) = True) Begin Set ComAllowDrag of hColumn to True // Must also be True; else it won't work to remove column. End Else Begin // Else set it to property value. Set ComAllowDrag of hColumn to (Private.pbAllowColumnReorder(Self)) End Set ComShowInFieldChooser of hColumn to (pbShowAllColumnsInFieldChooser(Self)) // Grid level default. Set pbColumnSelectTextOnEdit item hColumn to True (pbSelectTextOnEdit(Self)) // Grid level default. // Set the font for header and footer: Get phoPaintManager to hoPaintManager Move (NullComObject()) to vFont Get ComCaptionFont of hoPaintManager to vFont If (IsNullComObject(vFont)) Begin Error DfErr_Program "Report Component Error. Could not connect to Font object." Procedure_Return End Get phoStdFont to hoStdFont Set pvComObject of hoStdFont to vFont Set ComName of hoStdFont to (HeaderTypeface(Self)) //JVH - Do not access the private property directly Set ComSize of hoStdFont to (HeaderFontSize(Self)) // ...and footer font: Get ComFooterFont of hColumn to vFont Get phoStdFont to hoStdFont Set pvComObject of hoStdFont to vFont Set ComName of hoStdFont to (FooterTypeface(Self)) //JVH - Do not access the private property directly Set ComSize of hoStdFont to (FooterFontSize(Self)) // ...default to if the grid can group columns Set ComGroupable of hColumn to (pbColumnsGroupable(Self)) // Grid level default. Function_Return hColumn End_Function // AddColumnEx // Creates a new record (and a new row) and returns the handle that is used // to add items/cells for the grid object (Report Control). // Returns: // A handle to the newly created row that is used to add items/cells // to the grid. // Note: You would not normally use this message because it is used automatically // by the AddItem function. Function AddRow Returns Handle Handle hRecordCollection hRecord Variant vRecord vRecords RowID riRowId String sRowId If (not(IsComObjectCreated(Self))) Function_Return 0 Get phoRecordCollection to hRecordCollection If (hRecordCollection < 1) Function_Return 0 Move (NullComObject()) to vRecords Get pvComObject of hRecordCollection to vRecords If (IsNullComObject(vRecords)) Begin Get ComRecords to vRecords Set pvComObject of hRecordCollection to vRecords End Move (NullComObject()) to vRecord // Create one record _and_ a row in the grid; (The row is created automagically). Get ComAdd of hRecordCollection to vRecord If (IsNullComObject(vRecord)) Begin Error DfErr_Program "Com Report Component Error. Could not create a record object." Function_Return 0 End // The cComReportRow class has a ComRecord function but not the other way around! Get phoCurrentRecord to hRecord Set pvComObject of hRecord to vRecord // Connect ActiveX object with VDF object. // Preparation for using rowID's that will be kept in the ComTag // property for each Record, when using grid with data tables. // For this to work the 'global' priRowId property must be set _prior_ // to adding the first item of a row. Get priRowId to riRowId If (not(IsNullRowId(riRowId))) Begin Move (SerializeRowID(riRowId)) to sRowId // We must serialize first, else Runtime error. Set ComTag of hRecord to sRowId End Function_Return hRecord End_Function // AddRow // Same as AddRow. Function Add_Row Returns Handle Handle hRow Get AddRow to hRow Function_Return hRow End_Function // Add_Row // Adds a new item/cell to the grid object (Report Control). // Syntax: // Get Additem "Item value" to hItem // Returns: // A handle to the newly created item/cell. // Note: The returned handle can be used to set a whole range of item properties, // with the syntax: E.g. 'Set pbBold item hItem to True' Function AddItem String sValue Returns Handle Handle hItem hRecord hCol Variant vRecord vNullData vItem Integer iItems iCols iCol Boolean bEditable bCheckbox bButton Move (NullComObject()) to vNullData Get phoCurrentRecord to hRecord Move (NullComObject()) to vRecord Get pvComObject of hRecord to vRecord If (IsNullComObject(vRecord)) Begin Get AddRow to hRecord End Get Private.ItemCount to iItems Move (NullComObject()) to vItem // Adds a single item/cell to the grid. Get ComAddItem of hRecord vNullData to vItem If (IsNullComObject(vItem)) Begin Error DfErr_Program ("Com Report Control Error. Could not create record item (cell):" * String(iItems + 1)) Function_Return 0 End Get phoCurrentItem to hItem // VDF proxy object created at startup. Set pvComObject of hItem to vItem // Link ActiveX object to VDF object. If (hItem > 0) Set ComValue of hItem to (Trim(sValue)) Increment iItems Set Private.ItemCount to iItems // Check how many items has been connected to this record. // The first ReportRecordItem added to the collection has an index of zero. // The index of the Item in the Record corresponds with the // ItemIndex of a Column. // The Item will be displayed in the column that has an ItemIndex that is the // same as the Index of the Record. Get ColCount to iCols // How many columns are there in the grid? Get NumberOfItemsInRecord hRecord to iItems // How many items has been added to the current row? // Set other column specific properties that cannot be set when column is created; Get ColumnNumberFromItemNumber (iItems -1) to iCol // NumberOfItemsInRecord is one based, and columns zero based. Get ColumnProxyObjectFromColumnNumber iCol to hCol If (hCol > 0) Get ComEditable of hCol to bEditable // Is this a shadowed column? If (bEditable = False) Begin Set ItemShadowState item hItem to True End Get ColumnCheckboxState item hCol to bCheckbox If (bCheckbox = True) Begin Set CheckboxItemState item hItem to True End Get ColumnButtonState item hCol to bButton If (bButton = True) Begin Set pbIsButton item hItem to True End If (iItems = iCols) Begin Set pvComObject of hRecord to vNullData // Will create a new record next time function is called. End Function_Return hItem End_Function // AddItem // Same as AddItem. Function Add_Item String sValue Returns Handle Handle hItem Get AddItem sValue to hItem Function_Return hItem End_Function // Add_Item // Helper function for AddItem. // How many items exist in a passed record/row? // Syntax: // Get NumberOfItemsInRecord hRecord to iItems // Note: One based. Function NumberOfItemsInRecord Handle hRecord Returns Integer Integer iItems iCols i Variant vItem Move 0 to iItems Get ColCount to iCols // How many columns are there in the grid? Send Ignore_Error of Error_Info_Object 4399 For i from 0 to (iCols -1) Move (NullComObject()) to vItem Get ComItem of hRecord i to vItem // Generates Error 4399 if not exist. If (IsNullComObject(vItem)) Break // We're done. Increment iItems Loop Send Trap_Error of Error_Info_Object 4399 Function_Return iItems End_Function // NumberOfItemsInRecord // *** Events *** { MethodType=Event } // Predefined event that is fired when a item/cell is hit by mouse or space key. Procedure OnClick String sCaption End_Procedure // OnClick { MethodType=Event } // Params: // iButton 1 = left mouse button // iButton 2 = right mouse button // iButton 3 = third mouse button // iShift = is shift key down // ix = x coordinate clicked // iy = y coordinate clicked Procedure OnComMouseDown Short iButton Short iShift Integer ix Integer iy Handle hoHitTestInfo hItem Variant vHitTestInfo vColumn vRow vItem Integer iRetval iColumn iItemColor iItemTextColor Boolean bIsButton Forward Send OnComMouseDown iButton iShift ix iy Get phoHitTestInfo to hoHitTestInfo Move (NullComObject()) to vHitTestInfo Get ComHitTest ix iy to vHitTestInfo If (IsNullComObject(vHitTestInfo)) Begin Error DfErr_Program "Com Report Component Error. Could not connect to HitTestInfo object." Procedure_Return End Set pvComObject of hoHitTestInfo to vHitTestInfo // Link ActiveX object to VDF object. Get ComHt of hoHitTestInfo to iRetval // Report area that was hit by the mouse. Get ComColumn of hoHitTestInfo to vColumn Get ComRow of hoHitTestInfo to vRow Move (NullComObject()) to vItem Get ComItem of hoHitTestInfo to vItem If (IsNullComObject(vItem)) Procedure_Return // Then we are outside 'active' grid area. Case Begin Case (iRetval = OLExtpHitTestUnknown) // = 0 // Unkown area clicked. Case Break Case (iRetval = OLExtpHitTestHeader) // = 1 // The header has been clicked. Case Break Case (iRetval = OLExtpHitTestGroupBox) // = 2 // A Group box has been clicked Case Break Case (iRetval = OLExtpHitTestReportArea) // = 3 // The report area (items/cells) has been clicked. If (iButton = 1) Begin // Left mouse button pressed. Get phoCurrentItem to hItem Set pvComObject of hItem to vItem // Link ActiveX object to VDF object. Get ComBackColor of hItem to iItemColor Get ComForeColor of hItem to iItemTextColor Set Private.ItemColor to iItemColor Set Private.ItemTextColor to iItemTextColor Get pbIsButton item hItem to bIsButton If (bIsButton = True) Begin Set ComBackColor of hItem to (piButtonDownColor(Self)) Set ComForeColor of hItem to (piButtonDownTextColor(Self)) Set ComIcon of hItem to RC_ButtonPressed End End Case Break Case End End_Procedure // OnComMouseDown { MethodType=Event } // Params: // iButton 1 = left mouse button // iButton 2 = right mouse button // iButton 3 = third mouse button // iShift = is shift key down // ix = x coordinate clicked // iy = y coordinate clicked Procedure OnComMouseUp Short iButton Short iShift Integer ix Integer iy Handle hoHitTestInfo hItem Variant vHitTestInfo vColumn vRow vItem Integer iRetval iColumn iItemColor iItemTextColor Boolean bIsButton String sCaption Forward Send OnComMouseUp iButton iShift ix iy Move False to bIsButton Get phoHitTestInfo to hoHitTestInfo If (hoHitTestInfo < 1) Procedure_Return // Nothing to do. Get ComHt of hoHitTestInfo to iRetval // Report area that was hit by the mouse. Get ComRow of hoHitTestInfo to vRow Get ComColumn of hoHitTestInfo to vColumn Move (NullComObject()) to vItem Get ComItem of hoHitTestInfo to vItem If (IsNullComObject(vItem)) Procedure_Return // Then we are outside 'active' grid area. Case Begin Case (iRetval = OLExtpHitTestUnknown) // = 0 // Unkown area clicked. Case Break Case (iRetval = OLExtpHitTestHeader) // = 1 // The header has been clicked. Case Break Case (iRetval = OLExtpHitTestGroupBox) // = 2 // A Group box has been clicked Case Break Case (iRetval = OLExtpHitTestReportArea) // = 3 // The report area (cells) has been clicked. If (iButton = 1) Begin // Left mouse button pressed. Get phoCurrentItem to hItem Set pvComObject of hItem to vItem // Link ActiveX object to VDF object. Get Private.ItemColor to iItemColor Get Private.ItemTextColor to iItemTextColor // Get Private.CurrentCellColor to iItemColor // Get Private.CurrentCellTextColor to iItemTextColor Get pbIsButton item hItem to bIsButton If (bIsButton = True) Begin Set ComBackColor of hItem to iItemColor Set ComForeColor of hItem to iItemTextColor Set ComIcon of hItem to RC_ButtonNormal Get ComCaption of hItem to sCaption Send ComRedraw End // If (bIsButton = True) Begin End Case Break Case End If (bIsButton = True) Send OnClick sCaption End_Procedure // OnComMouseUp Procedure OnComRequestEdit Variant llRow Variant llColumn Variant llItem Boolean ByRef llCancel If (Private.pbNavigateOutOfEditMode(Self)) Begin Move True to llCancel Set Private.pbNavigateOutOfEditMode to False End End_Procedure // OnComRequestEdit { MethodType=Event } // Handle keyboard navigation duties. Triggered after a key is pressed down but // before it is processed. Procedure OnComPreviewKeyDown Short ByRef iKeyCode Short iShift Boolean ByRef bCancel Handle hoNavigator Boolean bEditMode If (iShift = 0) Begin Get phoNavigator to hoNavigator Get ComEditMode to bEditMode Case Begin Case (iKeyCode = VK_LEFT) If (not(bEditMode)) Begin Send ComMoveLeft to hoNavigator False False Move True to bCancel End Case Break Case (iKeyCode = VK_UP) Send ComMoveUp to hoNavigator False False Move True to bCancel Case Break Case (iKeyCode = VK_RIGHT) If (not(bEditMode)) Begin Send ComMoveRight to hoNavigator False False Move True to bCancel End Case Break Case (iKeyCode = VK_DOWN) Send ComMoveDown to hoNavigator False False Move True to bCancel Case Break Case (iKeyCode = VK_HOME) If (bEditMode = False) Send MoveToFirstColumn Case Break Case (iKeyCode = VK_END) If (bEditMode = False) Send MoveToLastColumn Case Break Case (iKeyCode = VK_RETURN or iKeyCode = VK_F2) // Enter & F2 are programmed to enter Edit Mode in a controlled way. For example we // block editing checkbox items. If not in edit mode thes keys perform their default action. If (not(bEditMode)) Begin Send EditCurrentItem Move True to bCancel End Case Break Case End End End_Procedure // OnComPreviewKeyDown { MethodType=Event } // Do the same thing as the MouseUp and Down does when the space key is pressed. // KeyCode is the ANSI keycode value of the key pressed. // Note: It wont work with the enter key because it is ignored by this event. // Shift is the Shift, Ctrl, Alt or any combination of those pressed along with the actual key. // iShift; // 1 = Shift, 2 = Ctrl, 3 = Shift+Ctrl, 4 = Alt, 5 = Alt+Shift // 6 = Alt+Ctrl, 7 = Shift+Alt+Ctrl Procedure OnComKeyDown Short ByRef iKeyCode Short iShift Variant vFocusedRow vItem Handle hItem Boolean bIsButton bEditMode Integer iItemColor iItemTextColor Forward Send OnComKeyDown iKeyCode iShift Case Begin // Is a button item/cell pressed with the Space-key? Case (iKeyCode = VK_SPACE) Move (NullComObject()) to vItem Get Private.pvCurrentItem to vItem // Set by OnComFocusChanging event. If (IsNullComObject(vItem)) Procedure_Return // Then the grid area does not have focus. Get phoCurrentItem to hItem Set pvComObject of hItem to vItem // Link ActiveX object to VDF object. Get ComBackColor of hItem to iItemColor Get ComForeColor of hItem to iItemTextColor Set Private.ItemColor to iItemColor Set Private.ItemTextColor to iItemTextColor Get pbIsButton item hItem to bIsButton If (bIsButton = True) Begin Set ComBackColor of hItem to (piButtonDownColor(Self)) Set ComForeColor of hItem to (piButtonDownTextColor(Self)) Set ComIcon of hItem to RC_ButtonPressed Send ComRedraw End Case Break Case End End_Procedure // OnComKeyDown { MethodType=Event } // See OnComKeyDown event for explanation. Procedure OnComKeyUp Short ByRef iKeyCode Short iShift Variant vFocusedRow vItem Handle hItem Boolean bIsButton String sCaption Integer iItemColor iItemTextColor Forward Send OnComKeyUp iKeyCode iShift If (iKeyCode = VK_SPACE) Begin Move (NullComObject()) to vItem Get Private.pvCurrentItem to vItem // Set by OnComFocusChanging event. If (IsNullComObject(vItem)) Procedure_Return // Then the grid area does not have focus. Get phoCurrentItem to hItem Set pvComObject of hItem to vItem // Link ActiveX object to VDF object. Get Private.ItemColor to iItemColor Get Private.ItemTextColor to iItemTextColor Get pbIsButton item hItem to bIsButton // Use the internal class function. If (bIsButton = True) Begin Set ComBackColor of hItem to iItemColor Set ComForeColor of hItem to iItemTextColor Set ComIcon of hItem to RC_ButtonNormal Get ComCaption of hItem to sCaption Send ComRedraw Send OnClick sCaption Procedure_Return End // If (bIsButton = True) Begin End // If (iKeyCode = KEY_SPACE) Begin End_Procedure // OnComKeyUp { MethodType=Event } // This event is triggered just before a user makes a selection of a cell. Procedure OnComFocusChanging Variant llNewRow Variant llNewColumn Variant llNewItem Boolean ByRef llCancel Handle hItem Integer iCurrentCell iItemColor iItemTextColor If (not(IsComObjectCreated(Self))) Procedure_Return Forward Send OnComFocusChanging llNewRow llNewColumn llNewItem llCancel Set Private.pvCurrentRow to llNewRow Set Private.pvCurrentColumn to llNewColumn Set Private.pvCurrentItem to llNewItem Get phoCurrentItem to hItem Set pvComObject of hItem to llNewItem //Get CurrentItem to iCurrentCell // Result in: 'Access violation' if grid is zeroed and re-created. End_Procedure // OnComFocusChanging // This only fires if piSetCustomDraw=OLExtpCustomBeforeDrawRow. // This event is used to change the color of the currently selected item/cell. // * It doesn't (yet) work to set the current item, it sets the whole // selected row! Procedure OnComBeforeDrawRow Variant llRow Variant llItem Variant llMetrics Handle hoPaintManager hRow hHitTestInfo hoRecordItemMetrics Boolean bSelected Variant vRow vFont Integer iCurrentCellColor If (not(IsComObjectCreated(Self))) Procedure_Return Procedure_Return // * For now. Get CurrentCellColor to iCurrentCellColor // Class property. If (iCurrentCellColor < 1) Procedure_Return // Then we do not change the selected cell color. Get phoPaintManager to hoPaintManager Get phoHitTestInfo to hHitTestInfo If (hHitTestInfo < 1) Procedure_Return // Nothing to do. Get ComRow of hHitTestInfo to vRow Get phoCurrentRow to hRow Set pvComObject of hRow to vRow If (not(IsNullComObject((vRow)))) Begin Get ComSelected of hRow to bSelected End // This doesn't quite work; so remark for now. // Instead of setting the current item, it sets the selected line... // If (bSelected = True) Set ComHighlightBackColor of hoPaintManager to iCurrentCellColor End_Procedure // OnComBeforeDrawRow // Occurs when a row is clicked by a mouse button or when a row is selected by moving // the Up and Down arrow keys. The onComFocusChanging event occurs right _before_ the selection // has changed. Procedure OnComSelectionChanged Variant vRow Handle hRow //Get ComFocusedRow to vRow End_Procedure // OnComSelectionChanged // Occurs when the value of a ReportRecordItem has changed. // The ComRedraw is needed if an item/cell value is changed and the mouse // is used to navigate to another cell, and the enter key was not pressed prior // doing so. Procedure OnComValueChanged Variant llRow Variant llColumn Variant llItem Send ComRedraw End_Procedure // OnComValueChanged // Occurs after the value of an item has been changed by the user, but before the // new value has been Set to the item. This allows the new value to be checked // and canceled or modified If needed. // // This will be a good candidate to tie together with a data_dictionary when // this class gets to be db-aware. Procedure OnComValueChanging Variant llRow Variant llColumn Variant llItem End_Procedure // OnComValueChanging End_Class // cReportControlGrid