View Issue Details

IDProjectCategoryView StatusLast Update
0019233LazarusLCLpublic2011-06-08 14:49
ReporterMatthieu GIROUXAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.30Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0019233: Need Datalink or ActiveRecord to be visible in DBGrid descedant
DescriptionI had to delete for FPC the code which upgrade dbgrid to control using in columns.
You can download Extended components to see dracell using activerecord of datalink.
I can participate to lazarus to upgrade dbgrid to use controls un columns.
The next code can not work with the initial lazarus, because activerecord is not accessible.
PaintTo also does not work.

From http://code.google.com/p/extended/downloads/list
Additional Informationprocedure TFWDBGrid.DrawCell(aCol, aRow: {$IFDEF FPC}Integer{$ELSE}Longint{$ENDIF}; aRect: TRect;
  aState: TGridDrawState);
var OldActive : Integer;
    FBackground: TColor;
begin
  if ( ACol > 0 )
  and ( ARow >= {$IFDEF FPC}1{$ELSE}IndicatorOffset{$ENDIF} )
  and assigned (( TFWGridColumn ( Columns [ ACol - 1 ])).SomeEdit ) Then
   with ( TFWGridColumn ( Columns [ ACol - 1 ])).SomeEdit do
     Begin
       {$IFDEF FPC}
       PrepareCanvas(aCol, aRow, aState);
       if Assigned(OnGetCellProps) and not (gdSelected in aState) then
       begin
         FBackground:=Canvas.Brush.Color;
         OnGetCellProps(Self, GetFieldFromGridColumn(aCol), Canvas.Font, FBackground);
         Canvas.Brush.Color:=FBackground;
       end;
       {$ELSE}
       Canvas.Brush.Color := Color;
       {$ENDIF}
       Self.Canvas.FillRect(aRect);
       OldActive := Datalink.ActiveRecord;
       Datalink.ActiveRecord := ARow {$IFDEF FPC}-1{$ELSE}-IndicatorOffset{$ENDIF};
       Width := aRect.Right - aRect.Left;
       Height := ARect.Bottom - aRect.Top;
       ControlState := ControlState + [csPaintCopy];
       PaintTo(Self.Canvas.Handle,aRect.Left,aRect.Top);
       ControlState := ControlState - [csPaintCopy];
       Datalink.ActiveRecord := OldActive;
     end
    Else
      inherited DrawCell(aCol, aRow, aRect, aState);
end;
Tagsdatalink, dbgrid
Fixed in Revision30902
LazTarget0.99.0
WidgetsetGTK 2
Attached Files

Activities

Jesus Reyes

2011-05-25 22:01

developer   ~0048592

Made Datalink property protected.

Matthieu GIROUX

2011-06-08 14:49

reporter   ~0048960

Thank you !

The lazarus components are growing and growing...

Issue History

Date Modified Username Field Change
2011-04-26 09:52 Matthieu GIROUX New Issue
2011-04-26 09:52 Matthieu GIROUX Widgetset => GTK 2
2011-05-13 18:05 Matthieu GIROUX Tag Attached: datalink
2011-05-13 18:05 Matthieu GIROUX Tag Attached: dbgrid
2011-05-25 22:01 Jesus Reyes Fixed in Revision => 30902
2011-05-25 22:01 Jesus Reyes LazTarget => 0.99.0
2011-05-25 22:01 Jesus Reyes Status new => resolved
2011-05-25 22:01 Jesus Reyes Fixed in Version => 0.9.31 (SVN)
2011-05-25 22:01 Jesus Reyes Resolution open => fixed
2011-05-25 22:01 Jesus Reyes Assigned To => Jesus Reyes
2011-05-25 22:01 Jesus Reyes Note Added: 0048592
2011-05-25 22:01 Jesus Reyes Target Version => 0.99.0
2011-06-08 14:49 Matthieu GIROUX Note Added: 0048960