ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/ibcontrols/DBControlGrid.pas
(Generate patch)

Comparing ibx/trunk/ibcontrols/DBControlGrid.pas (file contents):
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC vs.
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC

# Line 1 | Line 1
1 +  
2   {
3   /***************************************************************************
4                                 DBControlGrid.pas
# Line 67 | Line 68 | uses
68   }
69  
70   type
70  TRowCacheState = (rcEmpty,rcPresent,rcDeleted);
71  TRowDetails = record
72    FState: TRowCacheState;
73    FAlternateColor: boolean;
74    FBitmap: TBitmap;
75  end;
76
71    { TRowCache }
72  
73    TRowCache = class
74    private
75 +    type
76 +      TRowCacheState = (rcEmpty,rcPresent,rcDeleted);
77 +      TRowDetails = record
78 +        FState: TRowCacheState;
79 +        FAlternateColor: boolean;
80 +        FBitmap: TBitmap;
81 +  end;
82 +
83 +  private
84      FAltColorStartNormal: boolean;
85      FHeight: integer;
86      FList: array of TRowDetails;
# Line 304 | Line 307 | begin
307    Container := TBitmap.Create;
308    try
309      Container.SetSize(Control.Width,Control.Height);
310 +    Container.Canvas.Brush.Color := control.Color;
311      Control.PaintTo(Container.Canvas,0,0);
312    except
313      Container.Free;
# Line 417 | Line 421 | begin
421   end;
422  
423   function TRowCache.Add2Cache(RecNo: Longint; Control: TWinControl): TBitmap;
420 var i: integer;
424   begin
425    Dec(RecNo); {Adust to zero base}
426    ExtendCache(RecNo + 1);
# Line 609 | Line 612 | begin
612      begin
613        FCacheRefreshQueued := true;
614        Application.QueueAsyncCall(@DoMoveRecord,PtrInt(aRow));
615 <    end
615 >    end;
616 >    Canvas.FillRect(aRect);
617    end
618    else
619       Canvas.Draw(aRect.Left,aRect.Top,CachedRow)
# Line 662 | Line 666 | procedure TDBControlGrid.KeyDownHandler(
666   var Done: boolean;
667      AControl: TControl;
668   begin
669 <  if Visible and assigned(FDrawPanel) and FDrawPanel.Visible and FWeHaveFocus then
669 >  if Visible and assigned(FDrawPanel) and FDrawPanel.Visible and FWeHaveFocus
670 >    and (Self.Owner=Screen.ActiveForm) then
671    begin
672      AControl := ActiveControl;
673      if (AControl <> nil) and (AControl is TCustomComboBox)
# Line 1174 | Line 1179 | begin
1179      result := dsInactive;
1180   end;
1181  
1177 var
1178  DataCol: Integer;
1182   begin
1183    PrepareCanvas(aCol, aRow, aState);
1184  
# Line 1286 | Line 1289 | end;
1289   procedure TDBControlGrid.KeyDown(var Key: Word; Shift: TShiftState);
1290   type
1291    TOperation=(opMoveBy,opCancel,opAppend,opInsert,opDelete);
1289 var
1290  DeltaCol,DeltaRow: Integer;
1292  
1293    procedure DoOnKeyDown;
1294    begin
# Line 1689 | Line 1690 | begin
1690      FDataLink.Free;
1691    end;
1692    if assigned(FRowCache) then FRowCache.Free;
1693 +  if not (csDesigning in ComponentState) then
1694 +    Application.RemoveOnKeyDownBeforeHandler( @KeyDownHandler );
1695    Application.RemoveAsyncCalls(self);
1696    inherited Destroy;
1697   end;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines