1 |
+ |
|
2 |
|
{ |
3 |
|
/*************************************************************************** |
4 |
|
DBControlGrid.pas |
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; |
307 |
|
Container := TBitmap.Create; |
308 |
|
try |
309 |
|
Container.SetSize(Control.Width,Control.Height); |
310 |
+ |
Container.Canvas.Brush.Color := control.Color; |
311 |
+ |
Container.Canvas.FillRect(0,0,Control.Width,Control.Height); |
312 |
|
Control.PaintTo(Container.Canvas,0,0); |
313 |
|
except |
314 |
|
Container.Free; |
422 |
|
end; |
423 |
|
|
424 |
|
function TRowCache.Add2Cache(RecNo: Longint; Control: TWinControl): TBitmap; |
420 |
– |
var i: integer; |
425 |
|
begin |
426 |
|
Dec(RecNo); {Adust to zero base} |
427 |
|
ExtendCache(RecNo + 1); |
613 |
|
begin |
614 |
|
FCacheRefreshQueued := true; |
615 |
|
Application.QueueAsyncCall(@DoMoveRecord,PtrInt(aRow)); |
616 |
< |
end |
616 |
> |
end; |
617 |
> |
Canvas.FillRect(aRect); |
618 |
|
end |
619 |
|
else |
620 |
|
Canvas.Draw(aRect.Left,aRect.Top,CachedRow) |
667 |
|
var Done: boolean; |
668 |
|
AControl: TControl; |
669 |
|
begin |
670 |
< |
if Visible and assigned(FDrawPanel) and FDrawPanel.Visible and FWeHaveFocus then |
670 |
> |
if Visible and assigned(FDrawPanel) and FDrawPanel.Visible and FWeHaveFocus |
671 |
> |
and (Self.Owner=Screen.ActiveForm) then |
672 |
|
begin |
673 |
|
AControl := ActiveControl; |
674 |
|
if (AControl <> nil) and (AControl is TCustomComboBox) |
1180 |
|
result := dsInactive; |
1181 |
|
end; |
1182 |
|
|
1177 |
– |
var |
1178 |
– |
DataCol: Integer; |
1183 |
|
begin |
1184 |
|
PrepareCanvas(aCol, aRow, aState); |
1185 |
|
|
1290 |
|
procedure TDBControlGrid.KeyDown(var Key: Word; Shift: TShiftState); |
1291 |
|
type |
1292 |
|
TOperation=(opMoveBy,opCancel,opAppend,opInsert,opDelete); |
1289 |
– |
var |
1290 |
– |
DeltaCol,DeltaRow: Integer; |
1293 |
|
|
1294 |
|
procedure DoOnKeyDown; |
1295 |
|
begin |
1691 |
|
FDataLink.Free; |
1692 |
|
end; |
1693 |
|
if assigned(FRowCache) then FRowCache.Free; |
1694 |
+ |
if not (csDesigning in ComponentState) then |
1695 |
+ |
Application.RemoveOnKeyDownBeforeHandler( @KeyDownHandler ); |
1696 |
+ |
Application.RemoveAsyncCalls(self); |
1697 |
|
inherited Destroy; |
1698 |
|
end; |
1699 |
|
|