Subject RE: [IBO] New file uploaded to IBObjects
Author Alan McDonald
> > Hopefully you can take a look at this Jason.
> > The OnPaintPanel event of IB_CtrlGrid is practically useless in
> actioning
> > changes to the currently selected row and causes unreliable re-draws to
> > other rows as you scroll.
> > This example uses the latest version of IB_CtrlGrid (with mouse wheel
> > ability) but the same behaviour is visible in previous version
> 4.6 and 4.7
> > Alan
> >
>
> To the best of my digging:
> TIB_CtrlPanel.PaintWindow calls
> PaintPanel( DataLink.BufferRecord );
> for each row in the grid, equivalent to
> TDBCtrlPanel.PaintWindow calling
> PaintPanel(FDataLink.ActiveRecord);
>
> BUT whereas DB:
> function TDataLink.GetActiveRecord: Integer;
> begin
> if DataSource.State = dsSetKey then
> Result := 0 else
> Result := DataSource.DataSet.FActiveRecord - FFirstRecord;
> end;
>
> returns records current in the grid, 0, 1, 2 etc (zero based from
> first grid
> row to RowCount), in IB_Components
>
> function TIB_DataLink.GetActiveRecord: longint;
> begin
> if Assigned( Dataset ) then begin
> Result := Dataset.RowNum;
> end else begin
> Result := 0;
> end;
> end;

sorry - I meant
function TIB_DataLink.GetBufferRecord: longint;
begin
if Assigned( Dataset ) then begin
Result := Dataset.BufferRowNum;
end else begin
Result := 0;
end;
end;

BufferRowNum returns the bottom rownum in the buffer on it's first call.

>
> returns the dataset RowNum but this runs in the order:
> Lastrow in Grid, second, then last again (i.e. for a 3 row grid: 3, 2, 3)
> It's not zero based and it returns the last row first and never
> the first in
> the first instance (draw of the grid). When you scroll to or select the
> second row, the calls are 1, 3, 3 and finally 1,2,3 for the last
> of a 3 row
> grid. Move the cursor up again and you get 1, 3, 3 and 3, 2, 3 at the top.
> Alan
>
> > > Hello,
> > >
> > > This email message is a notification to let you know that
> > > a file has been uploaded to the Files area of the IBObjects
> > > group.
> > >
> > > File : /CtrlGridBugs.zip
> > > Uploaded by : metaalan <alan@...>
> > > Description : IB_CtrlGrid bugs in returning RowNum (index) of row.
> > >
> > > You can access this file at the URL:
> > > http://groups.yahoo.com/group/IBObjects/files/CtrlGridBugs.zip
> > >
> > > To learn more about file sharing for your group, please visit:
> > > http://help.yahoo.com/help/us/groups/files
> > >
> > > Regards,
> > >
> > > metaalan <alan@...>