Procedure TWPCustomRtfEdit.TableFilterSort(CompareMode:TWPParagraphCompareModes; RowCompare:TWPParagraphListCompareObj; RowFilterMethod:TWPParagraphListCheckFilter; TableCell:TParagraph; Mode:TWPListLoadItemsMode; CompareContext:TObject)
Unit: WPCTRMemo
Class: WPCTRMemo.TWPCustomRtfEdit
Parameters
-
CompareMode:TWPParagraphCompareModes RowCompare:TWPParagraphListCompareObj RowFilterMethod:TWPParagraphListCheckFilter TableCell:TParagraph Mode:TWPListLoadItemsMode CompareContext:TObject
Description
This function sorts the table with the given cell. It passes the column number as CompareParam.If no parameters where passed the method will sort the current column.
In a table all areas with numbers can be sorted with this command:
WPRichText1.TableFilterSort([wpCompareNumbers,wpSortSubElements], WPRichText1.BasisRowCompare,nil,nil,[wpListSubListOnTextInColumn]);
It will take the current column nr as reference cell. If you need to compare one or multiple column rows you can pass a reference to the compare method. Since that can be a method of the current form, it can also read information from the user interface.
This is the default implementation for RowCompare:
function TWPCustomRtfEdit.BasisRowCompare(Item1, Item2: TParagraph; Param : Integer;
mode : TWPParagraphCompareModes; SortData : TObject): Integer;
begin
if (Item1.ParagraphType<>wpIsTableRow) or
(Item2.ParagraphType<>wpIsTableRow) or
(Item1.ColCount
Overloaded Methods
Procedure TWPCustomRtfEdit.TableFilterSort(aTable:TParagraph; CompareMode:TWPParagraphCompareModes; RowCompare:TWPParagraphListCompareObj; RowFilterMethod:TWPParagraphListCheckFilter; Mode:TWPListLoadItemsMode; CompareParam:Integer; CompareContext:TObject; TemplatePar:TParagraph) |