Subject | RE: [IBO] TIB_Grid ThumbTrack Q |
---|---|
Author | Alan McDonald |
Post date | 2002-12-23T05:02:15Z |
Brian is correct here... except that:
you don't need a fetchall to, at some point know, that there are no more
records to pull off the server to fill the grid buffer. It's at this point
that the thumbtrakcing should know that instead of leaving the selected cell
in the centre, it shold trackt ot the bottom.
If anyone uses IBExpert.. they can see that using the Quantum Grids do have
the behaviour I sort of expected from TIB_Grid. When you track down the
grid, the highlighting continues in the centre until all the rows are
retrieved, an EOF is probably recognised and the cell highlighting then
proceeds to the bottom of the grid.
In fact, in the Quantum grids, if you drag the scroll to the bottom of the
grid, it's that behaviour which triggers a fetchall. If you just keep
clicking the down arrow (at the bottom fo the scroll) you only retrieve the
next record into the buffer.
Alan
-----Original Message-----
From: Jason Wharton [mailto:jwharton@...]
Sent: Saturday, 21 December 2002 6:09 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIB_Grid ThumbTrack Q
Correct that the behavior will remain the way it is.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
you don't need a fetchall to, at some point know, that there are no more
records to pull off the server to fill the grid buffer. It's at this point
that the thumbtrakcing should know that instead of leaving the selected cell
in the centre, it shold trackt ot the bottom.
If anyone uses IBExpert.. they can see that using the Quantum Grids do have
the behaviour I sort of expected from TIB_Grid. When you track down the
grid, the highlighting continues in the centre until all the rows are
retrieved, an EOF is probably recognised and the cell highlighting then
proceeds to the bottom of the grid.
In fact, in the Quantum grids, if you drag the scroll to the bottom of the
grid, it's that behaviour which triggers a fetchall. If you just keep
clicking the down arrow (at the bottom fo the scroll) you only retrieve the
next record into the buffer.
Alan
-----Original Message-----
From: Jason Wharton [mailto:jwharton@...]
Sent: Saturday, 21 December 2002 6:09 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIB_Grid ThumbTrack Q
Correct that the behavior will remain the way it is.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "Brian K. Woods" <brian@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, December 20, 2002 11:55 AM
Subject: RE: [IBO] TIB_Grid ThumbTrack Q
> Alan,
> Your problem intrigued me, so I tested it myself. I found the same
> behavior, and started looking for the cause. I found it, however, I'm not
> sure it's something that can ( or even should be ) fixed. I'll let you
and
> Jason decide that. I'm only starting to get familiar with the innards of
> IBO, so someone who knows the code in and out should look at it. I'll
just
> sum up what I figured out...
>
> The problem lies in the min/max range of the scroll bar. Until the
> recordcount is known, the UpdateScrollbar method of the grid falls into
the
> else clause (see below:
>
> if CursorRecordCountValid then
> begin
> [SNIP]
> end
> else
> begin
> file://THE CODE FALLS IN HERE UNTIL THE RECORDCOUNT IS KNOWN
>
> if not BufferHasBof then Dec( SINew.nMin, SINew.nPage div 2 +
1 );
> if not BufferHasEof then Inc( SINew.nMax, SINew.nPage div 2 +
1 );
> end;
>
> These "guess-timated" values of SINew.nMin and nMax are then used at the
> bottom of the
> function to set the scrollbar's parameters with
> SetScrollInfo( Handle, SB_VERT, SINew, True );
>
> To verify that this is the cause, I pumped a dummy table with 500000
single
> field rows (an integer, with vals from 0 to 499999), then pointed an
IB_grid
> at it with thumbtracking enabled. Then I performed your procedure of
> dragging the
> thumb around. If you pay attention to the integer values (the whole
reason
> I used an integer field), every
> time you drag the thumb to the bottom and let go, the grid brings in a new
> set of rows roughly equal to half the
> number of visible grid rows. If you force the query to fetch all 500000
> rows, ( i used a separate button's click event ),
> then, voila! Drag the thumb up and down, let go anywhere, and it behaves
> just like it should from then on. Therefore,
> the problem lies in that the query doesn't know how many actual data rows
> there are until you pull them all, so the scrollbar's min and max vals
> aren't being set correctly, which means that windows can't pass the
correct
> thumbposition to the
> grid in the WMVSCROLL message handler...
>
> I hope this helps you guys figure out a viable solution, since I agree
that
> to a customer, this could be confusing... What you could do in the
interim
> is just force a fetchall up front when using thumbtracking.
>
> Brian
>
> > -----Original Message-----
> > From: Jason Wharton [mailto:jwharton@...]
> > Sent: Thursday, December 19, 2002 1:31 PM
> > To: IBObjects@yahoogroups.com
> > Subject: Re: [IBO] TIB_Grid ThumbTrack Q
> >
> >
> > I don't follow this 100%. Will you please be more descriptive?
> >
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> >
> > -- We may not have it all together --
> > -- But together we have it all --
> >
> >
> > ----- Original Message -----
> > From: "Alan McDonald" <alan@...>
> > To: <IBObjects@yahoogroups.com>
> > Sent: Thursday, December 12, 2002 12:04 AM
> > Subject: [IBO] TIB_Grid ThumbTrack Q
> >
> >
> > > When Thumbtrack is set to True, you can scroll the grid to the first
> > record
> > > by tracking the scroll bar to the top. But tracking the scrollbar to
the
> > > bottm leaves the cente cell of the grid highlighted instead of the
last
> > > record/cell.
> > >
> > > Alan
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/