Class TWPColTemplate
Hierarchy
System.TObject | System.Classes.TPersistent | System.Classes.TCollectionItem | WPRTEDefs.TWPCollectionItem | TWPColTemplate
Subclasses
WPCTRTextProducerDB.TWPColTemplateDB
Description for Class TWPCollectionItem
Add Interface support to TCollectionItems - this helps for property editors. Unlike with interface objects the object is NOT destroyed when the interface refcount reaches 0.Properties
Property AllowChar : TWPColTemplateAllowChar
Property CalcMode : TWPColTemplateCalcSum
Property ColNr : Integer
Property Name : string
Property NumberOfDecimals : Integer
Property Options : TWPColTemplateCellOptions
Property ParentColumnTemplates : TWPColumnTemplates
Property Readonly : Boolean
Property ReadonlyHeader : Boolean
Property RowBreak : Boolean
Property RowCountValue : Integer
Property Styles : TWPTemplateStyles
Property Summary : string
Property SumValue : Extended
Property Text : string
Property Title : string
Property UIOptions : TWPColTemplateUIOptions
Property WidthPC : Integer
Methods
Function AddStyle(samplestyle:TWPTextStyle) : TWPTemplateStyle
Function AllowObjectSelection(txtobj:TWPTextObj) : Boolean
Procedure Assign(Source:TPersistent)
Function CalcNumValue(inputvalue:Extended) : Extended
Procedure CalcSum(Group:TWPBlockTemplateGroupObj)
Procedure ChangeApplied(Editor:TObject; par:TParagraph; posinpar:Integer)
Function Changing(Editor:TObject; par:TParagraph; posinpar:Integer) : Boolean
Create(Collection:TCollection)
Procedure GetColText(Group:TWPBlockTemplateGroupObj; aText:string; state:TWPAdapterCellStates)
Procedure GetColTitle(Group:TWPBlockTemplateGroupObj; aText:string; state:TWPAdapterCellStates)
Function GetDisplayName : string
Function GetReadonly : Boolean
Function GetUIOptions : Integer
Procedure InitColText(Group:TWPBlockTemplateGroupObj; Par:TParagraph; state:TWPAdapterCellStates)
Function IsValidChar(Editor:TObject; par:TParagraph; posinpar:Integer; AKey:Char) : Boolean
Function MoveCursor(Editor:TObject; par:TParagraph; posinpar:Integer) : Boolean
Function ProcessFieldText(aText:string) : string
Procedure Reset(Editor:TObject; par:TParagraph)
Procedure SetCollection(Value:TCollection)
Procedure SetColText(Par:TParagraph)
Procedure SetReadonly(Value:Boolean)
Procedure SetUIOptions(x:Integer)
Function UpdateDataCursorPos(Par:TParagraph) : Boolean
Procedure UpdateTemplateCellCallback(aCell:TParagraph; State:TWPAdapterCellStates; Row:Integer)
Events
OnGetImage : TWPColTemplateGetImageEvent= TWPColTemplateGetImageEvent
This event is used to create an image in cells which use the Option wpcoContainImage
OnGetSummary : TWPColTemplateGetTextEvent= TWPColTemplateGetTextEvent
This event is used to read the text for the footer and summary cells. Usually both cannot be combined. Footer are repeated on every page while Summaries are created at the end of the table
OnGetText : TWPColTemplateGetTextEvent= TWPColTemplateGetTextEvent
This event is used to read the text for this data cell
OnGetTitle : TWPColTemplateGetTextEvent= TWPColTemplateGetTextEvent
This event is used to read the text for this label or header cell
OnSetText : TWPColTemplateSetTextEvent= TWPColTemplateSetTextEvent
The event OnSetText is triggered outside of any groups. It can be used to update the text for a field in a database. The relevant record numbers can be retrieved by checking out the name of the ParentRow.Name of the respective table cell which has been passed as parameter "par". For automatic update of the text activate the property "UpdateField" of the TWPColTemplateDB class.
OnUpdateCell : TWPColTemplateUpdateCellEvent= TWPColTemplateUpdateCellEvent
This event is triggered for all template(!) cells after their creation to allow the customization. In this case
wpIsTemplateCell is set in CellMode.
It is also created after the cells were added to the table so it is possible to customize the cells in
a last step. In this case wpIsTemplateCell is not set.
procedure TForm1.WPTableProducerDB1Blocks0Columns0UpdateCell(
Sender: TWPColTemplate; aCell: TParagraph; CellMode: TWPColTemplateCellMode);
begin
if (wpIsHeaderCell in CellMode) and not (wpIsLabelCell in CellMode) then
aCell.SetText('');
end;
if not (wpIsTemplateCell in CellMode) and (aCell.StartWithW('A')) then
begin
WPAT_UseTemplate[WPAT_BGColor] := false;
aCell.ASetColor(WPAT_BGColor, clYellow);
end;