You've already forked lazarus-ccr
RxFPC:RxDBGrid - cleanup code
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5866 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<Version Value="10"/>
|
<Version Value="10"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="10">
|
<Units Count="12">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="WordWrapDemo.lpr"/>
|
<Filename Value="WordWrapDemo.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<WindowIndex Value="-1"/>
|
<WindowIndex Value="-1"/>
|
||||||
<TopLine Value="-1"/>
|
<TopLine Value="-1"/>
|
||||||
<CursorPos X="-1" Y="-1"/>
|
<CursorPos X="-1" Y="-1"/>
|
||||||
<UsageCount Value="26"/>
|
<UsageCount Value="31"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
@ -20,49 +20,51 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<TopLine Value="57"/>
|
||||||
<CursorPos X="32" Y="8"/>
|
<CursorPos X="3" Y="63"/>
|
||||||
<UsageCount Value="26"/>
|
<UsageCount Value="31"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<TopLine Value="851"/>
|
<TopLine Value="1174"/>
|
||||||
<CursorPos Y="867"/>
|
<CursorPos X="42" Y="1187"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="16"/>
|
||||||
<Bookmarks Count="3">
|
<Bookmarks Count="4">
|
||||||
<Item0 Y="4704" ID="2"/>
|
<Item0 X="7" Y="4721" ID="3"/>
|
||||||
<Item1 X="7" Y="4755" ID="3"/>
|
<Item1 Y="616" ID="4"/>
|
||||||
<Item2 Y="3389" ID="1"/>
|
<Item2 X="3" Y="4998" ID="1"/>
|
||||||
|
<Item3 X="49" Y="362" ID="2"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="../../../../../lcl/dbgrids.pas"/>
|
<Filename Value="../../../../../lcl/dbgrids.pas"/>
|
||||||
<UnitName Value="DBGrids"/>
|
<UnitName Value="DBGrids"/>
|
||||||
<EditorIndex Value="3"/>
|
<EditorIndex Value="5"/>
|
||||||
<TopLine Value="2880"/>
|
<TopLine Value="2880"/>
|
||||||
<CursorPos Y="2901"/>
|
<CursorPos Y="2901"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="16"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="../../../../../lcl/grids.pas"/>
|
<Filename Value="../../../../../lcl/grids.pas"/>
|
||||||
<UnitName Value="Grids"/>
|
<UnitName Value="Grids"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="6"/>
|
||||||
<TopLine Value="2482"/>
|
<TopLine Value="2482"/>
|
||||||
<CursorPos X="3" Y="2484"/>
|
<CursorPos X="3" Y="2484"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="16"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/db.pas"/>
|
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/db.pas"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="4"/>
|
||||||
<TopLine Value="1560"/>
|
<TopLine Value="1560"/>
|
||||||
<CursorPos X="15" Y="1578"/>
|
<CursorPos X="15" Y="1578"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="16"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
<Unit6>
|
<Unit6>
|
||||||
@ -70,163 +72,170 @@
|
|||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="199"/>
|
<TopLine Value="199"/>
|
||||||
<CursorPos X="3" Y="202"/>
|
<CursorPos X="3" Y="202"/>
|
||||||
<UsageCount Value="9"/>
|
<UsageCount Value="8"/>
|
||||||
</Unit6>
|
</Unit6>
|
||||||
<Unit7>
|
<Unit7>
|
||||||
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/dataset.inc"/>
|
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/dataset.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="1284"/>
|
<TopLine Value="1284"/>
|
||||||
<CursorPos X="3" Y="1287"/>
|
<CursorPos X="3" Y="1287"/>
|
||||||
<UsageCount Value="9"/>
|
<UsageCount Value="8"/>
|
||||||
</Unit7>
|
</Unit7>
|
||||||
<Unit8>
|
<Unit8>
|
||||||
<Filename Value="../../../../../lcl/include/wincontrol.inc"/>
|
<Filename Value="../../../../../lcl/include/wincontrol.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="5739"/>
|
<TopLine Value="5739"/>
|
||||||
<CursorPos Y="5757"/>
|
<CursorPos Y="5757"/>
|
||||||
<UsageCount Value="9"/>
|
<UsageCount Value="8"/>
|
||||||
</Unit8>
|
</Unit8>
|
||||||
<Unit9>
|
<Unit9>
|
||||||
<Filename Value="../../../../../lcl/include/winapi.inc"/>
|
<Filename Value="../../../../../lcl/include/winapi.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="929"/>
|
<TopLine Value="929"/>
|
||||||
<CursorPos Y="949"/>
|
<CursorPos Y="949"/>
|
||||||
<UsageCount Value="9"/>
|
<UsageCount Value="8"/>
|
||||||
</Unit9>
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="/home/install/source/fpcsrc/rtl/objpas/classes/classesh.inc"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<TopLine Value="518"/>
|
||||||
|
<CursorPos X="14" Y="537"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="/home/install/source/fpcsrc/rtl/objpas/classes/collect.inc"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
|
<TopLine Value="289"/>
|
||||||
|
<CursorPos X="3" Y="291"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit11>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="4760" TopLine="4731"/>
|
<Caret Line="503" Column="9" TopLine="484"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="4739" TopLine="4731"/>
|
<Caret Line="1174" Column="17" TopLine="1171"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="4743" Column="8" TopLine="4731"/>
|
<Caret Line="6448" Column="54" TopLine="6435"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="4944" Column="12" TopLine="4913"/>
|
<Caret Line="5032" Column="9" TopLine="5000"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="700" Column="15" TopLine="683"/>
|
<Caret Line="4943" Column="17" TopLine="4928"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="2768" Column="3" TopLine="2757"/>
|
<Caret Line="5053" Column="3" TopLine="5021"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="2861" Column="9" TopLine="2861"/>
|
<Caret Line="5058" TopLine="5024"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="824" Column="15" TopLine="791"/>
|
<Caret Line="5051" Column="35" TopLine="5041"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="5142" Column="57" TopLine="5125"/>
|
<Caret Line="796" Column="15" TopLine="780"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="854" Column="90" TopLine="838"/>
|
<Caret Line="362" Column="49" TopLine="342"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="853" Column="51" TopLine="840"/>
|
<Caret Line="589" TopLine="570"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="75" Column="25" TopLine="55"/>
|
<Caret Line="362" Column="49" TopLine="343"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="854" Column="96" TopLine="834"/>
|
<Caret Line="5042" Column="33" TopLine="5037"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="30" Column="80" TopLine="13"/>
|
<Caret Line="5116" Column="40" TopLine="5038"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="45" TopLine="24"/>
|
<Caret Line="515" Column="48" TopLine="490"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="818" TopLine="800"/>
|
<Caret Line="522" Column="21" TopLine="496"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="3391" Column="3" TopLine="3363"/>
|
<Caret Line="525" Column="76" TopLine="493"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="30" Column="37" TopLine="28"/>
|
<Caret Line="1173" TopLine="1168"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="83" Column="3" TopLine="62"/>
|
<Caret Line="474" Column="49" TopLine="448"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="84" Column="30" TopLine="59"/>
|
<Caret Line="2057" Column="3" TopLine="2055"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="83" Column="42" TopLine="34"/>
|
<Caret Line="535" Column="56" TopLine="509"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="30" Column="38" TopLine="23"/>
|
<Caret Line="1176" Column="3" TopLine="1173"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="90" Column="3" TopLine="70"/>
|
<Caret Line="471" Column="15" TopLine="466"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="62" Column="3" TopLine="50"/>
|
<Caret Line="2063" TopLine="2060"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="31" Column="15" TopLine="8"/>
|
<Caret Line="535" Column="65" TopLine="470"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="90" TopLine="68"/>
|
<Caret Line="530" Column="58" TopLine="528"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="27" Column="15" TopLine="12"/>
|
<Caret Line="1176" Column="3" TopLine="1174"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="64" TopLine="59"/>
|
<Caret Line="471" Column="14" TopLine="453"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="31" Column="15" TopLine="8"/>
|
<Caret Line="2069" TopLine="2066"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="89" TopLine="64"/>
|
<Caret Line="530" Column="14" TopLine="499"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<BreakPoints Count="1">
|
|
||||||
<Item1>
|
|
||||||
<Kind Value="bpkSource"/>
|
|
||||||
<WatchScope Value="wpsLocal"/>
|
|
||||||
<WatchKind Value="wpkWrite"/>
|
|
||||||
<Source Value="../../../rxdb/rxdbgrid.pas"/>
|
|
||||||
<Line Value="5708"/>
|
|
||||||
</Item1>
|
|
||||||
</BreakPoints>
|
|
||||||
<Watches Count="2">
|
<Watches Count="2">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Expression Value="H1"/>
|
<Expression Value="H1"/>
|
||||||
|
@ -54,6 +54,7 @@ type
|
|||||||
TRxColumn = class;
|
TRxColumn = class;
|
||||||
TRxDBGridAbstractTools = class;
|
TRxDBGridAbstractTools = class;
|
||||||
TRxDbGridColumnsEnumerator = class;
|
TRxDbGridColumnsEnumerator = class;
|
||||||
|
TRxColumnFooterItemsEnumerator = class;
|
||||||
|
|
||||||
|
|
||||||
TRxQuickSearchNotifyEvent = procedure(Sender: TObject; Field: TField;
|
TRxQuickSearchNotifyEvent = procedure(Sender: TObject; Field: TField;
|
||||||
@ -358,10 +359,25 @@ type
|
|||||||
procedure Update(Item: TCollectionItem); override;
|
procedure Update(Item: TCollectionItem); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TPersistent);
|
constructor Create(AOwner: TPersistent);
|
||||||
|
function GetEnumerator: TRxColumnFooterItemsEnumerator;
|
||||||
public
|
public
|
||||||
property Items[Index: integer]: TRxColumnFooterItem read GetItem write SetItem; default;
|
property Items[Index: integer]: TRxColumnFooterItem read GetItem write SetItem; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TRxColumnFooterItemsEnumerator }
|
||||||
|
|
||||||
|
TRxColumnFooterItemsEnumerator = class
|
||||||
|
private
|
||||||
|
FList: TRxColumnFooterItems;
|
||||||
|
FPosition: Integer;
|
||||||
|
public
|
||||||
|
constructor Create(AList: TRxColumnFooterItems);
|
||||||
|
function GetCurrent: TRxColumnFooterItem;
|
||||||
|
function MoveNext: Boolean;
|
||||||
|
property Current: TRxColumnFooterItem read GetCurrent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TRxColumnFilter }
|
{ TRxColumnFilter }
|
||||||
|
|
||||||
TRxFilterState = (rxfsAll, rxfsEmpty, rxfsNonEmpty, rxfsFilter{, rxfsTopXXXX});
|
TRxFilterState = (rxfsAll, rxfsEmpty, rxfsNonEmpty, rxfsFilter{, rxfsTopXXXX});
|
||||||
@ -463,6 +479,64 @@ type
|
|||||||
property Items[Index: integer]: TRxColumnEditButton read GetItem write SetItem; default;
|
property Items[Index: integer]: TRxColumnEditButton read GetItem write SetItem; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TColumnGroupItemValue = class
|
||||||
|
FieldName:string;
|
||||||
|
GroupValue:Double;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TColumnGroupItem }
|
||||||
|
|
||||||
|
TColumnGroupItem = class
|
||||||
|
RecordNo:integer;
|
||||||
|
FieldValue:string;
|
||||||
|
RecordCount:integer;
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TColumnGroupItems }
|
||||||
|
|
||||||
|
TColumnGroupItems = class
|
||||||
|
private
|
||||||
|
FActive: boolean;
|
||||||
|
procedure SetActive(AValue: boolean);
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
function FindGroup(ARecordNo:integer):TColumnGroupItem;
|
||||||
|
procedure Clear;
|
||||||
|
procedure UpdateValues;
|
||||||
|
published
|
||||||
|
property Active:boolean read FActive write SetActive;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ TRxColumnGroupParam }
|
||||||
|
|
||||||
|
TRxColumnGroupParam = class(TCollectionItem)
|
||||||
|
private
|
||||||
|
FFileName: string;
|
||||||
|
FValueType: TFooterValueType;
|
||||||
|
published
|
||||||
|
property FileName:string read FFileName write FFileName;
|
||||||
|
property ValueType:TFooterValueType read FValueType write FValueType;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TRxColumnGroupParams }
|
||||||
|
|
||||||
|
TRxColumnGroupParams = class(TOwnedCollection)
|
||||||
|
private
|
||||||
|
function GetItem(Index: integer): TRxColumnGroupParam;
|
||||||
|
procedure SetItem(Index: integer; AValue: TRxColumnGroupParam);
|
||||||
|
protected
|
||||||
|
public
|
||||||
|
function Add: TRxColumnGroupParam;
|
||||||
|
public
|
||||||
|
property Items[Index: integer]: TRxColumnGroupParam read GetItem write SetItem; default;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TRxColumn }
|
{ TRxColumn }
|
||||||
|
|
||||||
TRxColumn = class(TColumn)
|
TRxColumn = class(TColumn)
|
||||||
@ -482,6 +556,8 @@ type
|
|||||||
FSortPosition: integer;
|
FSortPosition: integer;
|
||||||
FWordWrap: boolean;
|
FWordWrap: boolean;
|
||||||
FFooters: TRxColumnFooterItems;
|
FFooters: TRxColumnFooterItems;
|
||||||
|
//Group support
|
||||||
|
FGroupItems:TColumnGroupItems;
|
||||||
function GetConstraints: TRxDBGridCollumnConstraints;
|
function GetConstraints: TRxDBGridCollumnConstraints;
|
||||||
function GetFooter: TRxColumnFooterItem;
|
function GetFooter: TRxColumnFooterItem;
|
||||||
function GetFooters: TRxColumnFooterItems;
|
function GetFooters: TRxColumnFooterItems;
|
||||||
@ -1093,6 +1169,89 @@ type
|
|||||||
procedure EditingDone; override;
|
procedure EditingDone; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TRxColumnGroupParams }
|
||||||
|
|
||||||
|
function TRxColumnGroupParams.GetItem(Index: integer): TRxColumnGroupParam;
|
||||||
|
begin
|
||||||
|
Result:= TRxColumnGroupParam(inherited Items[Index]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRxColumnGroupParams.SetItem(Index: integer;
|
||||||
|
AValue: TRxColumnGroupParam);
|
||||||
|
begin
|
||||||
|
inherited SetItem(Index, AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRxColumnGroupParams.Add: TRxColumnGroupParam;
|
||||||
|
begin
|
||||||
|
Result:=TRxColumnGroupParam.Create(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TRxColumnFooterItemsEnumerator }
|
||||||
|
|
||||||
|
constructor TRxColumnFooterItemsEnumerator.Create(AList: TRxColumnFooterItems);
|
||||||
|
begin
|
||||||
|
FList := AList;
|
||||||
|
FPosition := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRxColumnFooterItemsEnumerator.GetCurrent: TRxColumnFooterItem;
|
||||||
|
begin
|
||||||
|
Result := FList[FPosition];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRxColumnFooterItemsEnumerator.MoveNext: Boolean;
|
||||||
|
begin
|
||||||
|
Inc(FPosition);
|
||||||
|
Result := FPosition < FList.Count;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TColumnGroupItems }
|
||||||
|
|
||||||
|
procedure TColumnGroupItems.SetActive(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FActive=AValue then Exit;
|
||||||
|
FActive:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TColumnGroupItems.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FActive:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TColumnGroupItems.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TColumnGroupItems.FindGroup(ARecordNo: integer): TColumnGroupItem;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TColumnGroupItems.Clear;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TColumnGroupItems.UpdateValues;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TColumnGroupItem }
|
||||||
|
|
||||||
|
constructor TColumnGroupItem.Create;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TColumnGroupItem.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TRxDbGridColumnsEnumerator }
|
{ TRxDbGridColumnsEnumerator }
|
||||||
|
|
||||||
constructor TRxDbGridColumnsEnumerator.Create(AList: TRxDbGridColumns);
|
constructor TRxDbGridColumnsEnumerator.Create(AList: TRxDbGridColumns);
|
||||||
@ -1615,6 +1774,11 @@ begin
|
|||||||
inherited Create(AOwner, TRxColumnFooterItem);
|
inherited Create(AOwner, TRxColumnFooterItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRxColumnFooterItems.GetEnumerator: TRxColumnFooterItemsEnumerator;
|
||||||
|
begin
|
||||||
|
Result:=TRxColumnFooterItemsEnumerator.Create(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TRxDBGridAbstractTools }
|
{ TRxDBGridAbstractTools }
|
||||||
|
|
||||||
procedure TRxDBGridAbstractTools.SetRxDBGrid(AValue: TRxDBGrid);
|
procedure TRxDBGridAbstractTools.SetRxDBGrid(AValue: TRxDBGrid);
|
||||||
@ -4824,60 +4988,54 @@ var
|
|||||||
|
|
||||||
SaveAfterScroll:TDataSetNotifyEvent;
|
SaveAfterScroll:TDataSetNotifyEvent;
|
||||||
SaveBeforeScroll:TDataSetNotifyEvent;
|
SaveBeforeScroll:TDataSetNotifyEvent;
|
||||||
RCol:TRxColumn;
|
C:TRxColumn;
|
||||||
AValue:Variant;
|
AValue:Variant;
|
||||||
|
|
||||||
FCList:TFPList;
|
FCList, FCList2:TFPList;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
|
F: TRxColumnFooterItem;
|
||||||
begin
|
begin
|
||||||
if (not (FFooterOptions.Active and DatalinkActive)) or (Columns.Count = 0) or (gsAddingAutoColumns in GridStatus) then
|
if (not (FFooterOptions.Active and DatalinkActive)) or (Columns.Count = 0) or (gsAddingAutoColumns in GridStatus) then
|
||||||
Exit;
|
Exit;
|
||||||
//Дополнительно проверим - а стоит ли делать пробег по данным - есть ли агрегатные функции
|
|
||||||
if Assigned(OnRxCalcFooterValues)then
|
if Assigned(OnRxCalcFooterValues)then
|
||||||
begin
|
begin
|
||||||
Inc(FInProcessCalc);
|
Inc(FInProcessCalc);
|
||||||
for i := 0 to Columns.Count - 1 do
|
for C in Columns do
|
||||||
begin
|
begin
|
||||||
RCol := TRxColumn(Columns[i]);
|
C.Footer.ResetTestValue;
|
||||||
RCol.Footer.ResetTestValue;
|
|
||||||
AValue:=Null;
|
AValue:=Null;
|
||||||
OnRxCalcFooterValues(Self, RCol, AValue);
|
OnRxCalcFooterValues(Self, C, AValue);
|
||||||
if AValue<>null then RCol.Footer.FTestValue := AValue;
|
if AValue<>null then C.Footer.FTestValue := AValue;
|
||||||
end;
|
end;
|
||||||
Dec(FInProcessCalc);
|
Dec(FInProcessCalc);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
APresent := False;
|
APresent := False;
|
||||||
for i := 0 to Columns.Count - 1 do
|
for C in Columns do
|
||||||
begin
|
begin
|
||||||
APresent := TRxColumn(Columns[i]).Footer.FValueType in
|
APresent := (C.Footer.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin, fvtCount]) or (C.FGroupItems.Active);
|
||||||
[fvtSum, fvtAvg, fvtMax, fvtMin, fvtCount];
|
|
||||||
|
|
||||||
if not APresent then
|
if not APresent then
|
||||||
for j:=0 to TRxColumn(Columns[i]).Footers.Count-1 do
|
for F in C.Footers do
|
||||||
begin
|
begin
|
||||||
APresent:=TRxColumn(Columns[i]).Footers[j].FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin, fvtCount];
|
APresent:=F.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin, fvtCount];
|
||||||
if APresent then
|
if APresent then
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if APresent then
|
|
||||||
break;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not APresent then
|
if not APresent then Exit;
|
||||||
exit;
|
|
||||||
|
|
||||||
|
|
||||||
Inc(FInProcessCalc);
|
Inc(FInProcessCalc);
|
||||||
|
|
||||||
cnt:=0;
|
cnt:=0;
|
||||||
for i := 0 to Columns.Count - 1 do
|
for C in Columns do
|
||||||
begin
|
begin
|
||||||
TRxColumn(Columns[i]).Footer.ResetTestValue;
|
C.Footer.ResetTestValue;
|
||||||
for j:=0 to TRxColumn(Columns[i]).Footers.Count - 1 do
|
for F in C.Footers do F.ResetTestValue;
|
||||||
TRxColumn(Columns[i]).Footers[j].ResetTestValue;
|
C.FGroupItems.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (DataSource.DataSet.RecordCount<=0) then
|
if (DataSource.DataSet.RecordCount<=0) then
|
||||||
@ -4906,24 +5064,27 @@ begin
|
|||||||
SavePos:=DHS.RecNo;
|
SavePos:=DHS.RecNo;
|
||||||
|
|
||||||
FCList:=TFPList.Create;
|
FCList:=TFPList.Create;
|
||||||
for i:=0 to Columns.Count-1 do
|
FCList2:=TFPList.Create;
|
||||||
|
|
||||||
|
for C in Columns do
|
||||||
begin
|
begin
|
||||||
RCol:=TRxColumn(Columns[i]);
|
if (C.Footer.ValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and C.Visible then
|
||||||
if (RCol.Footer.ValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and RCol.Visible then
|
|
||||||
begin
|
begin
|
||||||
FCList.Add(RCol);
|
FCList.Add(C);
|
||||||
RCol.Footer.FField:=DHS.FieldByName(RCol.Footer.FieldName);
|
C.Footer.FField:=DHS.FieldByName(C.Footer.FieldName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
for j:=0 to RCol.Footers.Count - 1 do
|
for F in C.Footers do
|
||||||
begin
|
begin
|
||||||
if (RCol.Footers[j].ValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and RCol.Visible then
|
if (F.ValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and C.Visible then
|
||||||
begin
|
begin
|
||||||
if FCList.IndexOf(RCol) < 0 then
|
if FCList.IndexOf(C) < 0 then
|
||||||
FCList.Add(RCol);
|
FCList.Add(C);
|
||||||
RCol.Footers[j].FField:=DHS.FieldByName(RCol.Footers[j].FieldName);
|
F.FField:=DHS.FieldByName(F.FieldName);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if C.FGroupItems.Active then FCList2.Add(C);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DHS.First;
|
DHS.First;
|
||||||
@ -4931,38 +5092,42 @@ begin
|
|||||||
begin
|
begin
|
||||||
for i:=0 to FCList.Count-1 do
|
for i:=0 to FCList.Count-1 do
|
||||||
begin
|
begin
|
||||||
RCol:=TRxColumn(FCList[i]);
|
C:=TRxColumn(FCList[i]);
|
||||||
if (RCol.FFooter.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and Assigned(RCol.FFooter.FField) then
|
if (C.FFooter.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and Assigned(C.FFooter.FField) then
|
||||||
RCol.FFooter.UpdateTestValueFromVar( RCol.FFooter.FField.AsVariant);
|
C.FFooter.UpdateTestValueFromVar(C.FFooter.FField.AsVariant);
|
||||||
|
|
||||||
for j:=0 to RCol.FFooters.Count-1 do
|
for F in C.FFooters do
|
||||||
begin
|
begin
|
||||||
if (RCol.FFooters[j].FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and Assigned(RCol.FFooters[j].FField) then
|
if (F.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin]) and Assigned(F.FField) then
|
||||||
RCol.FFooters[j].UpdateTestValueFromVar( RCol.FFooters[j].FField.AsVariant)
|
F.UpdateTestValueFromVar( F.FField.AsVariant)
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
for i:=0 to FCList2.Count-1 do
|
||||||
|
TRxColumn(FCList[i]).FGroupItems.UpdateValues;
|
||||||
|
|
||||||
inc(cnt);
|
inc(cnt);
|
||||||
DHS.Next;
|
DHS.Next;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
FCList2.Free;
|
||||||
FCList.Free;
|
FCList.Free;
|
||||||
|
|
||||||
for i:=0 to Columns.Count-1 do
|
for C in Columns do
|
||||||
begin
|
begin
|
||||||
RCol:=TRxColumn(Columns[i]);
|
if C.Footer.ValueType = fvtCount then
|
||||||
if RCol.Footer.ValueType = fvtCount then
|
C.FFooter.FCountRec:=Cnt
|
||||||
RCol.FFooter.FCountRec:=Cnt
|
|
||||||
else
|
else
|
||||||
if RCol.Footer.ValueType = fvtAvg then
|
if C.Footer.ValueType = fvtAvg then
|
||||||
RCol.FFooter.FTestValue:=RCol.FFooter.FTestValue / Cnt;
|
C.FFooter.FTestValue:=C.FFooter.FTestValue / Cnt;
|
||||||
|
|
||||||
for j:=0 to RCol.Footers.Count-1 do
|
for F in C.Footers do
|
||||||
begin
|
begin
|
||||||
if RCol.Footers[j].ValueType = fvtCount then
|
if F.ValueType = fvtCount then
|
||||||
RCol.FFooters[j].FCountRec:=Cnt
|
F.FCountRec:=Cnt
|
||||||
else
|
else
|
||||||
if RCol.Footers[j].ValueType = fvtAvg then
|
if F.ValueType = fvtAvg then
|
||||||
RCol.FFooters[j].FTestValue:=RCol.FFooter.FTestValue / Cnt;
|
F.FTestValue:=F.FTestValue / Cnt;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -5953,10 +6118,12 @@ begin
|
|||||||
FEditButtons:=TRxColumnEditButtons.Create(Self);
|
FEditButtons:=TRxColumnEditButtons.Create(Self);
|
||||||
FOptions:=[coCustomizeVisible, coCustomizeWidth];
|
FOptions:=[coCustomizeVisible, coCustomizeWidth];
|
||||||
FFooters:=TRxColumnFooterItems.Create(Self);
|
FFooters:=TRxColumnFooterItems.Create(Self);
|
||||||
|
FGroupItems:=TColumnGroupItems.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TRxColumn.Destroy;
|
destructor TRxColumn.Destroy;
|
||||||
begin
|
begin
|
||||||
|
FreeAndNil(FGroupItems);
|
||||||
FreeAndNil(FFooters);
|
FreeAndNil(FFooters);
|
||||||
FreeAndNil(FEditButtons);
|
FreeAndNil(FEditButtons);
|
||||||
if FKeyList <> nil then
|
if FKeyList <> nil then
|
||||||
|
Reference in New Issue
Block a user