97 |
|
procedure ClearCache; |
98 |
|
function Add2Cache(RecNo: Longint; Control: TWinControl): TBitmap; |
99 |
|
function GetRowImage(RecNo, Offset: integer): TBitmap; |
100 |
+ |
procedure InvalidateRowImage(RecNo: integer); |
101 |
|
function IsEmpty(RecNo: integer): boolean; |
102 |
|
procedure MarkAsDeleted(RecNo: integer); |
103 |
|
property AlternateColor[RecNo: integer]: boolean read GetAlternateColor; |
237 |
|
property Color; |
238 |
|
property Constraints; |
239 |
|
property DataSource: TDataSource read GetDataSource write SetDataSource; |
239 |
– |
property DefaultRowHeight; |
240 |
|
property DefaultPositionAtEnd: boolean read FDefaultPositionAtEnd write FDefaultPositionAtEnd; |
241 |
|
property DragCursor; |
242 |
|
property DragMode; |
467 |
|
until false; |
468 |
|
end; |
469 |
|
|
470 |
+ |
procedure TRowCache.InvalidateRowImage(RecNo: integer); |
471 |
+ |
begin |
472 |
+ |
Dec(RecNo); {adjust to zero base} |
473 |
+ |
if (RecNo < 0) or (RecNo >= Length(FList)) then |
474 |
+ |
Exit; |
475 |
+ |
|
476 |
+ |
if FList[RecNo].FState = rcPresent then |
477 |
+ |
begin |
478 |
+ |
FList[RecNo].FBitmap.Free; |
479 |
+ |
FList[RecNo].FState := rcEmpty; |
480 |
+ |
end; |
481 |
+ |
end; |
482 |
+ |
|
483 |
|
function TRowCache.IsEmpty(RecNo: integer): boolean; |
484 |
|
begin |
485 |
|
Dec(RecNo); |
778 |
|
RemoveFreeNotification(FDrawPanel); |
779 |
|
FDrawPanel.RemoveAllHandlersOfObject(self); |
780 |
|
theForm := Parent; |
781 |
< |
while not (theForm is TCustomForm) and (theForm.Parent <> nil) do |
781 |
> |
while not ((theForm is TCustomForm) or (theForm is TCustomFrame)) |
782 |
> |
and (theForm.Parent <> nil) do |
783 |
|
theForm := theForm.Parent; |
784 |
|
FDrawPanel.Parent := theForm; |
785 |
|
end; |
796 |
|
FDrawPanel.Visible := false; |
797 |
|
FRowCache.Height := FDrawPanel.Height; |
798 |
|
FRowCache.Width := FDrawPanel.Width; |
799 |
< |
AddHandlerOnResize(@OnDrawPanelResize); |
799 |
> |
FDrawPanel.AddHandlerOnResize(@OnDrawPanelResize); |
800 |
|
FreeNotification(FDrawPanel); |
801 |
|
end; |
802 |
|
except |
1139 |
|
if aCol < FixedCols then |
1140 |
|
DrawIndicator(Canvas,aRow, aRect,GetDataSetState,false) |
1141 |
|
else |
1142 |
+ |
if FDrawPanel = nil then |
1143 |
+ |
DrawFillRect(Canvas,aRect) else |
1144 |
|
if not FDrawingActiveRecord and FDataLink.Active then |
1145 |
|
DoDrawRow(aRow,aRect,aState); |
1146 |
|
{if we are drawing the active record then this is rendered by the Draw Panel |
1575 |
|
PrevRow := Row; |
1576 |
|
Row := FDrawRow; |
1577 |
|
if not FInCacheRefresh then |
1578 |
+ |
begin |
1579 |
|
FSelectedRow := FDrawRow; |
1580 |
+ |
if FDatalink.DataSet.State <> dsInsert then |
1581 |
+ |
FRowCache.InvalidateRowImage(FSelectedRecNo); |
1582 |
+ |
end; |
1583 |
|
InvalidateRow(PrevRow); |
1584 |
|
SetupDrawPanel(FDrawRow); |
1585 |
|
end; |