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; |
420 |
|
end; |
421 |
|
|
422 |
|
function TRowCache.Add2Cache(RecNo: Longint; Control: TWinControl): TBitmap; |
420 |
– |
var i: integer; |
423 |
|
begin |
424 |
|
Dec(RecNo); {Adust to zero base} |
425 |
|
ExtendCache(RecNo + 1); |
611 |
|
begin |
612 |
|
FCacheRefreshQueued := true; |
613 |
|
Application.QueueAsyncCall(@DoMoveRecord,PtrInt(aRow)); |
614 |
< |
end |
614 |
> |
end; |
615 |
> |
Canvas.FillRect(aRect); |
616 |
|
end |
617 |
|
else |
618 |
|
Canvas.Draw(aRect.Left,aRect.Top,CachedRow) |
1177 |
|
result := dsInactive; |
1178 |
|
end; |
1179 |
|
|
1177 |
– |
var |
1178 |
– |
DataCol: Integer; |
1180 |
|
begin |
1181 |
|
PrepareCanvas(aCol, aRow, aState); |
1182 |
|
|
1287 |
|
procedure TDBControlGrid.KeyDown(var Key: Word; Shift: TShiftState); |
1288 |
|
type |
1289 |
|
TOperation=(opMoveBy,opCancel,opAppend,opInsert,opDelete); |
1289 |
– |
var |
1290 |
– |
DeltaCol,DeltaRow: Integer; |
1290 |
|
|
1291 |
|
procedure DoOnKeyDown; |
1292 |
|
begin |