RxFPC:fix RxDBGrid paint error in design time

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5909 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2017-05-30 07:49:41 +00:00
parent 10a0476010
commit 592426d585

View File

@ -1104,6 +1104,7 @@ type
function DoExecTools:boolean; virtual; function DoExecTools:boolean; virtual;
function DoSetupTools:boolean; virtual; function DoSetupTools:boolean; virtual;
function MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer):boolean; virtual; function MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer):boolean; virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -2216,6 +2217,14 @@ begin
Result:=false; Result:=false;
end; end;
procedure TRxDBGridAbstractTools.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (AComponent = FRxDBGrid) and (Operation = opRemove) then
FRxDBGrid := nil;
end;
procedure TRxDBGridAbstractTools.ExecTools(Sender: TObject); procedure TRxDBGridAbstractTools.ExecTools(Sender: TObject);
begin begin
Execute; Execute;
@ -4482,7 +4491,7 @@ var
P: TBookMark; P: TBookMark;
begin begin
FGroupItemDrawCur:=nil; FGroupItemDrawCur:=nil;
if FGroupItems.Active and DatalinkActive then { if FGroupItems.Active and DatalinkActive then
begin begin
if (ARow>=FixedRows) then if (ARow>=FixedRows) then
@ -4491,7 +4500,7 @@ begin
P:=DataSource.DataSet.Bookmark; P:=DataSource.DataSet.Bookmark;
FGroupItemDrawCur:=FGroupItems.FindGroupItem(P); FGroupItemDrawCur:=FGroupItems.FindGroupItem(P);
end; end;
end; end;}
inherited DrawRow(ARow); inherited DrawRow(ARow);
end; end;
@ -4520,7 +4529,8 @@ var
ABrush: TBrush; ABrush: TBrush;
begin begin
TotalWidth := GCache.ClientWidth; TotalWidth := GCache.ClientWidth;
TotalYOffs := GCache.ClientHeight {- (GetDefaultRowHeight * FFooterOptions.RowCount)}; //TotalYOffs := GCache.ClientHeight {- (GetDefaultRowHeight * FFooterOptions.RowCount)};
TotalYOffs := GCache.ClientRect.Bottom {- (GetDefaultRowHeight * FFooterOptions.RowCount)};
FooterRect := Rect(0, TotalYOffs, TotalWidth, TotalYOffs + GetDefaultRowHeight * FFooterOptions.RowCount); FooterRect := Rect(0, TotalYOffs, TotalWidth, TotalYOffs + GetDefaultRowHeight * FFooterOptions.RowCount);
@ -5157,8 +5167,8 @@ end;
procedure TRxDBGrid.MoveSelection; procedure TRxDBGrid.MoveSelection;
begin begin
inherited MoveSelection; inherited MoveSelection;
if Assigned(FFooterOptions) and FFooterOptions.Active and (FFooterOptions.RowCount > 0) then { if Assigned(FFooterOptions) and FFooterOptions.Active and (FFooterOptions.RowCount > 0) then
DrawFooterRows; DrawFooterRows;}
end; end;
function TRxDBGrid.GetBufferCount: integer; function TRxDBGrid.GetBufferCount: integer;
@ -6170,12 +6180,14 @@ end;
procedure TRxDBGrid.CheckNewCachedSizes(var AGCache: TGridDataCache); procedure TRxDBGrid.CheckNewCachedSizes(var AGCache: TGridDataCache);
begin begin
inherited CheckNewCachedSizes(AGCache); inherited CheckNewCachedSizes(AGCache);
if FFooterOptions.Active then if FFooterOptions.Active then
begin begin
AGCache.ClientHeight:=AGCache.ClientHeight - DefaultRowHeight * FFooterOptions.RowCount; // AGCache.ClientHeight:=AGCache.ClientHeight - DefaultRowHeight * FFooterOptions.RowCount;
AGCache.ScrollHeight:=AGCache.ScrollHeight - DefaultRowHeight * FFooterOptions.RowCount; AGCache.ScrollHeight:=AGCache.ScrollHeight - DefaultRowHeight * FFooterOptions.RowCount;
AGCache.ClientRect.Bottom:=AGCache.ClientRect.Bottom - DefaultRowHeight * FFooterOptions.RowCount; AGCache.ClientRect.Bottom:=AGCache.ClientRect.Bottom - DefaultRowHeight * FFooterOptions.RowCount;
end; end;
end; end;
procedure TRxDBGrid.GetOnCreateLookup; procedure TRxDBGrid.GetOnCreateLookup;