🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3736

Re: Sizing ListView Column when HScrollPos > 0

#3736
From: Bob Gonder
Date: Sun, 30 Apr 2006 16:37
46 lines
2857 bytes
JD wrote:

>Using client relative v/s screen relative makes no difference
>because the difference between the old position and the new
>position is the same regardless of what variables are used to
>calculate it.

Um, but not if it is using box-relative.
As you move the bar left, the box moves right.

Let's run some numbers.
Listbox is scrolled right to max by 50 pixels.
Seperator bar is at 100 in the client window (150 listbox-relative)
Seperator bar remains stationary.
Left half of table is message info, right half is after application of
message.

Event	box at	mouse at	         Delta   box goes to  mouse at

Click	-50	100 (150r)	0	-50	[150r]
Drag	-50	99 (149r)		1	-49	[148r]
Hold	-49	99 (148r)		1	-48	[147r]
Hold	-48	99 (147r)		1	-47	[146r]
Drag	-47	98 (145r)		2	-45	[143r]
Drag	-45	97 (142r)		3	-42	[139r]
Drag	-42	96 (138r)		4	-38	[134r]
Drag	-38	95 (133r)		5	-33	[128r]
Hold	-33	95 (128r)		5	-28	[123r]

The problem you are trying to solve is the large delta.
You want it to be 0 or 1 in all these instances.
Look at the move in the last line.
If you remember the screen coordinate of 95, you would see 0 movement.
If OTOH, you remember the box-relative 133, and now you see
box-relative 128, you see a movement of 5.

Since you are processing WM_MOUSEMOVE, the mouse coordinates are in
listbox-relative coordinates (the fast-changing ones).
You might try remembering/comparing ClientToScreen(msg point) values.

Or, remember the mouse position _after_ the resize with
GetCurrentPos() and ScreenToClient(),, and compare directly to the
next message.

I'm thinking the first method (ClientToScreen) would work in all
cases, right, left, maxed or not?
Technical Details
Message-ID: <r1k952teeotf811v4gmqj0pj35ut9ki5et@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4453413e$1@newsgroups.borland.com> <3pt652pq4hdn1fn56cpgn1jkps35652csj@4ax.com> <44539d56$1@newsgroups.borland.com> <65k752po16q79kat37qnc6j7tn8a86sr9t@4ax.com> <4454bdd3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6756aa08d2757c32
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Sizing ListView Column when HScrollPos > 0
Date: Sun, 30 Apr 2006 09:37:52 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <r1k952teeotf811v4gmqj0pj35ut9ki5et@4ax.com>
References: <4453413e$1@newsgroups.borland.com> <3pt652pq4hdn1fn56cpgn1jkps35652csj@4ax.com> <44539d56$1@newsgroups.borland.com> <65k752po16q79kat37qnc6j7tn8a86sr9t@4ax.com> <4454bdd3$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.246.200.196
X-Trace: newsgroups.borland.com 1146415071 4.246.200.196 (30 Apr 2006 09:37:51 -0700)
Lines: 48
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail