Article View: borland.public.cppbuilder.nativeapi
Article #16965How does windows determine TopRow after scroll
From: JD
Date: Thu, 17 Apr 2003 16:23
Date: Thu, 17 Apr 2003 16:23
40 lines
2526 bytes
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
Technical Details
Message-ID:
<3e9ed4f2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,1fd97e40ea13ee79,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-17 09:32:02 PST From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: How does windows determine TopRow after scroll Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 172.159.30.44 172.159.30.44 NNTP-Posting-Host: 207.105.83.65 Message-ID: <3e9ed4f2$1@newsgroups.borland.com> Date: 17 Apr 2003 09:23:14 -0700 X-Trace: newsgroups.borland.com 1050596594 207.105.83.65 (17 Apr 2003 09:23:14 -0700) Lines: 41 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail