You've already forked lazarus-ccr
RxFPC:RxDBGrid - add new event - OnCalcRowHeight
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5864 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -21,22 +21,16 @@
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="5">
|
||||
<RequiredPackages Count="3">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="UIBLaz"/>
|
||||
<PackageName Value="rxnew"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="fbdemofpc"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<PackageName Value="rxnew"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item5>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
|
@ -7,7 +7,7 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1, uiblaz, rxnew
|
||||
Forms, Unit1, rxnew
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="24"/>
|
||||
<UsageCount Value="26"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
@ -20,23 +20,22 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<TopLine Value="21"/>
|
||||
<CursorPos X="59" Y="47"/>
|
||||
<UsageCount Value="24"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<CursorPos X="32" Y="8"/>
|
||||
<UsageCount Value="26"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="4731"/>
|
||||
<CursorPos X="16" Y="4746"/>
|
||||
<UsageCount Value="12"/>
|
||||
<TopLine Value="851"/>
|
||||
<CursorPos Y="867"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 Y="4709" ID="2"/>
|
||||
<Item1 X="7" Y="4760" ID="3"/>
|
||||
<Item2 Y="3384" ID="1"/>
|
||||
<Item0 Y="4704" ID="2"/>
|
||||
<Item1 X="7" Y="4755" ID="3"/>
|
||||
<Item2 Y="3389" ID="1"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
</Unit2>
|
||||
@ -44,9 +43,9 @@
|
||||
<Filename Value="../../../../../lcl/dbgrids.pas"/>
|
||||
<UnitName Value="DBGrids"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<TopLine Value="1915"/>
|
||||
<CursorPos Y="1934"/>
|
||||
<UsageCount Value="12"/>
|
||||
<TopLine Value="2880"/>
|
||||
<CursorPos Y="2901"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
@ -55,7 +54,7 @@
|
||||
<EditorIndex Value="4"/>
|
||||
<TopLine Value="2482"/>
|
||||
<CursorPos X="3" Y="2484"/>
|
||||
<UsageCount Value="12"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
@ -63,7 +62,7 @@
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="1560"/>
|
||||
<CursorPos X="15" Y="1578"/>
|
||||
<UsageCount Value="12"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
@ -71,150 +70,150 @@
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="199"/>
|
||||
<CursorPos X="3" Y="202"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/dataset.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1284"/>
|
||||
<CursorPos X="3" Y="1287"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="../../../../../lcl/include/wincontrol.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="5739"/>
|
||||
<CursorPos Y="5757"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="../../../../../lcl/include/winapi.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="929"/>
|
||||
<CursorPos Y="949"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit9>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Caret Line="4760" TopLine="4731"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Caret Line="4739" TopLine="4731"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Caret Line="4743" Column="8" TopLine="4731"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Caret Line="4944" Column="12" TopLine="4913"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Caret Line="700" Column="15" TopLine="683"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Caret Line="2768" Column="3" TopLine="2757"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Caret Line="2861" Column="9" TopLine="2861"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Caret Line="824" Column="15" TopLine="791"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Caret Line="5142" Column="57" TopLine="5125"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Caret Line="854" Column="90" TopLine="838"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Caret Line="853" Column="51" TopLine="840"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Caret Line="75" Column="25" TopLine="55"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Caret Line="854" Column="96" TopLine="834"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="30" Column="80" TopLine="13"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="45" TopLine="24"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Caret Line="818" TopLine="800"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Caret Line="3391" Column="3" TopLine="3363"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="30" Column="37" TopLine="28"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="83" Column="3" TopLine="62"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="84" Column="30" TopLine="59"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="83" Column="42" TopLine="34"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="30" Column="38" TopLine="23"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="90" Column="3" TopLine="70"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="62" Column="3" TopLine="50"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="31" Column="15" TopLine="8"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="90" TopLine="68"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4747" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="27" Column="15" TopLine="12"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4749" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="64" TopLine="59"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4750" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="31" Column="15" TopLine="8"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4751" TopLine="4731"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="89" TopLine="64"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
@ -225,8 +224,16 @@
|
||||
<WatchScope Value="wpsLocal"/>
|
||||
<WatchKind Value="wpkWrite"/>
|
||||
<Source Value="../../../rxdb/rxdbgrid.pas"/>
|
||||
<Line Value="5713"/>
|
||||
<Line Value="5708"/>
|
||||
</Item1>
|
||||
</BreakPoints>
|
||||
<Watches Count="2">
|
||||
<Item1>
|
||||
<Expression Value="H1"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Expression Value="H"/>
|
||||
</Item2>
|
||||
</Watches>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
@ -129,6 +129,7 @@ object Form1: TForm1
|
||||
FooterOptions.DrawFullLine = True
|
||||
SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey]
|
||||
SearchOptions.FromStart = False
|
||||
OnCalcRowHeight = RxDBGrid1CalcRowHeight
|
||||
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowQuickFilter]
|
||||
FooterColor = clYellow
|
||||
FooterRowCount = 1
|
||||
@ -140,7 +141,6 @@ object Form1: TForm1
|
||||
GridLineStyle = psSolid
|
||||
DataSource = DataSource1
|
||||
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
|
||||
ParentColor = False
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ unit Unit1;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, fbcustomdataset, uib, rxdbgrid, rxmemds, Forms,
|
||||
Classes, SysUtils, FileUtil, rxdbgrid, rxmemds, Forms,
|
||||
Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, db;
|
||||
|
||||
type
|
||||
@ -24,10 +24,10 @@ type
|
||||
RxMemoryData1NAME: TStringField;
|
||||
procedure CheckBox1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure RxDBGrid1CalcRowHeight(Sender: TRxDBGrid; var ARowHegth: integer);
|
||||
private
|
||||
procedure FillTestDatabase;
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
@ -54,6 +54,13 @@ begin
|
||||
FillTestDatabase;
|
||||
end;
|
||||
|
||||
procedure TForm1.RxDBGrid1CalcRowHeight(Sender: TRxDBGrid;
|
||||
var ARowHegth: integer);
|
||||
begin
|
||||
if RxMemoryData1ID.AsInteger mod 10 = 0 then
|
||||
ARowHegth:=ARowHegth + 1;
|
||||
end;
|
||||
|
||||
procedure TForm1.FillTestDatabase;
|
||||
var
|
||||
F:TextFile;
|
||||
|
@ -72,6 +72,8 @@ type
|
||||
Cell: TGridCoord; Column: TRxColumn; var HintStr: string;
|
||||
var Processed: boolean) of object;
|
||||
|
||||
TRxDBGridCalcRowHeight = procedure(Sender: TRxDBGrid; var ARowHegth:integer) of object;
|
||||
|
||||
//Freeman35 added
|
||||
TOnRxCalcFooterValues = procedure(Sender: TObject; Column: TRxColumn; var AValue : Variant) of object;
|
||||
TOnRxColumnFooterDraw = procedure(Sender: TObject; ABrush: TBrush; AFont : TFont;
|
||||
@ -614,6 +616,7 @@ type
|
||||
FColumnDefValues: TRxDBGridColumnDefValues;
|
||||
|
||||
FFooterOptions: TRxDBGridFooterOptions;
|
||||
FOnCalcRowHeight: TRxDBGridCalcRowHeight;
|
||||
FSearchOptions: TRxDBGridSearchOptions;
|
||||
FSortColumns: TRxDbGridColumnsSortList;
|
||||
FSortingNow:Boolean;
|
||||
@ -805,7 +808,6 @@ type
|
||||
procedure DoEditorShow; override;
|
||||
|
||||
property Editor;
|
||||
//procedure UpdateActive; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -861,6 +863,7 @@ type
|
||||
property KeyStrokes: TRxDBGridKeyStrokes read FKeyStrokes write SetKeyStrokes;
|
||||
property FooterOptions:TRxDBGridFooterOptions read FFooterOptions write SetFooterOptions;
|
||||
property SearchOptions:TRxDBGridSearchOptions read FSearchOptions write SetSearchOptions;
|
||||
property OnCalcRowHeight:TRxDBGridCalcRowHeight read FOnCalcRowHeight write FOnCalcRowHeight;
|
||||
|
||||
//storage
|
||||
property PropertyStorage: TCustomPropertyStorage read GetPropertyStorage write SetPropertyStorage;
|
||||
@ -3336,7 +3339,7 @@ end;
|
||||
|
||||
function TRxDBGrid.UpdateRowsHeight: integer;
|
||||
var
|
||||
i, J, H, H1, H2{, YT, YB}:integer;
|
||||
i, J, H, H1, H2:integer;
|
||||
F:TField;
|
||||
S:string;
|
||||
CurActiveRecord: Integer;
|
||||
@ -3349,7 +3352,7 @@ begin
|
||||
|
||||
CurActiveRecord:=DataLink.ActiveRecord;
|
||||
H2:=0;
|
||||
// YB:=-1;
|
||||
|
||||
for i:=GCache.VisibleGrid.Top to GCache.VisibleGrid.Bottom do
|
||||
begin
|
||||
DataLink.ActiveRecord:=i - FixedRows;
|
||||
@ -3376,22 +3379,14 @@ begin
|
||||
|
||||
if i<RowCount then
|
||||
begin
|
||||
if Assigned(FOnCalcRowHeight) then
|
||||
FOnCalcRowHeight(Self, H);
|
||||
RowHeights[i] := GetDefaultRowHeight * H;
|
||||
H2:=H2 + RowHeights[i];
|
||||
if H2<=ClientHeight then
|
||||
Inc(Result);
|
||||
end;
|
||||
|
||||
{ if DataLink.ActiveRecord = CurActiveRecord then
|
||||
ColRowToOffSet(False,True, I, YT, YB);}
|
||||
end;
|
||||
(*
|
||||
if (YB > -1) and (YB > GCache.VisibleGrid.BottomRight.Y) then
|
||||
begin
|
||||
{ Datalink.mo;
|
||||
GCache.VisibleGrid.Top:=GCache.VisibleGrid.Top + 1;}
|
||||
end;
|
||||
*)
|
||||
DataLink.ActiveRecord:=CurActiveRecord;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user