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

Comparing ibx/trunk/ibcontrols/DBControlGrid.pas (file contents):
Revision 27 by tony, Tue Apr 14 13:10:23 2015 UTC vs.
Revision 29 by tony, Sat May 9 11:37:49 2015 UTC

# Line 97 | Line 97 | type
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;
# Line 236 | Line 237 | type
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;
# Line 467 | Line 467 | begin
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);
# Line 765 | Line 778 | begin
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;
# Line 782 | Line 796 | begin
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
# Line 1125 | Line 1139 | begin
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
# Line 1559 | Line 1575 | begin
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines