๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by JD Thu, 17 Apr 2003 16:23
How does windows determine TopRow after scroll
#16965
Author: JD
Date: Thu, 17 Apr 2003 16:23
40 lines
2526 bytes
I'm working with a StringGrid and I have replaced it's
WindowProc to recieve notice of when the vertical ScrollBar's
thumb is being dragged.

The goal is to determine what the new TopRow will be should the
thumb be released at it's current position. This potentially new
TopRow value is used to display key info from the Cell[x][TopRow]
in a small popup as the user drags the thumb.

The problem is that the ScrollBars min/max do not numerically
matchup to the StringGrid properties. Here's some actual values:

                 ScrollBar Min =   0
                 ScrollBar Max = 127
                 StringGrid->RowCount  = 109
                 StringGrid->FixedRows =   1
                 StringGrid->VisibleRowCount = 32

How this translates is that there are 128 ScrollBar positions but
there are only 77 corresponding TopRows.

I have a process working that takes the current ScrollBar pos
and calculates what the TopRow would be without missing any
TopRows in between. In fact, I have 3 different calculations
that perform this task but no matter what I try, I can't sync it
to how windows determines what the TopRow will be.

The reason is that while every TopRow will have a corresponding
ScrollBar pos, many of them will also have another corresponding
ScrollBar pos. In these cases, windows and I don't always agree
which TopRow the current ScrollBar positions should represent.

I need to know how windows determines what the resulting TopRow
will be once the thumb has been released and unfortunately I'm
not good enough to trace into it - it's all greek to me :o(

Could someone please help me out here?

~ JD
Re: How does windows determine TopRow after scroll
#16966
Author: Remy Lebeau (TeamB)
Date: Thu, 17 Apr 2003 18:10
17 lines
1567 bytes
"JD" <nospam@nospam.com> wrote in message
news:3e9ed4f2$1@newsgroups.borland.com...

> I need to know how windows determines what the
> resulting TopRow will be once the thumb has been
> released and unfortunately I'm not good enough to
> trace into it - it's all greek to me :o(

Windows is not the one in control of that.  The TStringGrid itself is
handling all of that internally.  It tells Windows what the scroll range
should be, and then Windows tells the grid what the new scroll position is.
Everythig else is internal to the grid.  Windows has no concept of what the
actual contents of the grid really is.


Gambit
Re: How does windows determine TopRow after scroll
#16969
Author: Asger J๏ฟฝrgensen
Date: Thu, 17 Apr 2003 19:12
6 lines
1000 bytes
Hi JD

 You can see how BCB do it in grid.pas arround line 2870

Best regards
Asger
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads