Mike Hearn wrote:
On Tue, 2003-07-29 at 05:19, Duane Clark wrote:
I have done quite a bit of comparison testing with ControlSpy on Wine and Win2K, so these changes should be accurate. Mainly done to fix earthquake (which was completely broken).
Changelog: Fix the size/position of the thumb/channel/tics to match Win.
There's clearly something strange going on here we don't fully understand - this patch breaks Internet Explorer again. See attached screenshot. Builtin after this patch is on the left, native (98) is in the middle, CVS wine is on the right.
Hmm, attached is what that looks like for me. So I don't know why it looks bad to you.
Horizontal trackbars are still OK, though with this patch the thumb is bigger than native 98. I didn't bother with a screenshot of that since it still looks OK.
One part of the code I did not test is the function TRACKBAR_InitializeThumb(), which sets the initial thumb length. My confidence in that part is not very good, since it doesn't make sense to have different calculations for the horizontal and vertical bars. So if someone were to do some simple testing to verify/correct that function, it would be a good thing.
All of the rest of the patch sets the rest of the dimensions of the control based on the length of the thumb and the size of the window, which is how Windows does it. That part I tested extensively, and am very confident is correct.
Duane Clark wrote:
Hmm, attached is what that looks like for me. So I don't know why it looks bad to you.
Oops, sorry. I was using a native control there. I do see the same thing as you.
Duane Clark wrote:
Duane Clark wrote:
Hmm, attached is what that looks like for me. So I don't know why it looks bad to you.
Oops, sorry. I was using a native control there. I do see the same thing as you.
(Sorry about replying to myself several times)
As BiGgUn suggests, in TRACKBAR_InitializeThumb, setting: infoPtr->uThumbLen = 21;
fixes IE. I suspect that is close to correct, other than that it probably should not be a magic number.
As BiGgUn suggests, in TRACKBAR_InitializeThumb, setting: infoPtr->uThumbLen = 21;
In this case 21 is a magic number. In fact, infoPtr->uThumbLen equals SM_CYCAPTION.
Stephan
BiGgUn wrote:
As BiGgUn suggests, in TRACKBAR_InitializeThumb, setting: infoPtr->uThumbLen = 21;
In this case 21 is a magic number. In fact, infoPtr->uThumbLen equals SM_CYCAPTION.
From the Wine include file:
winuser.h:#define SM_CYCAPTION 4
So I don't think we want to use that value.
Duane Clark wrote:
From the Wine include file:
winuser.h:#define SM_CYCAPTION 4
So I don't think we want to use that value.
That's just the value for passing to GetSystemMetrics. The actual value returned will be either:
sysMetrics[SM_CYCAPTION] = 20;
or
sysMetrics[SM_CYCAPTION] = SYSMETRICS_GetRegistryMetric(hkey, "CaptionHeight", 18) + 1; /* for the separator? */
-- Jon Bright Lead Programmer, Silicon Circus Ltd. http://www.siliconcircus.com
Jon Bright wrote:
Duane Clark wrote:
From the Wine include file:
winuser.h:#define SM_CYCAPTION 4
So I don't think we want to use that value.
That's just the value for passing to GetSystemMetrics. The actual value returned will be either:
sysMetrics[SM_CYCAPTION] = 20;
or
sysMetrics[SM_CYCAPTION] = SYSMETRICS_GetRegistryMetric(hkey,
"CaptionHeight", 18) + 1; /* for the separator? */
Hmm... well I wrote a small test case on Windows. For me on WinNT, GetSystemMetrics(SM_CYCAPTION) returns 19 (which is also what Wine returns for me), while the initial trackbar thumb size is 21. On Win2k, GetSystemMetrics(SM_CYCAPTION) returns 20, but the the initial thumb size is still 21. So am I doing something wrong? It does not appear to me that the trackbar thumb size is related to SM_CYCAPTION.
By the way, for me, changing to [Version] "Windows" = "win2k"
still returns 19 for SM_CYCAPTION for me on Wine. I am assuming that should return 20?
Hmm... well I wrote a small test case on Windows. For me on WinNT, GetSystemMetrics(SM_CYCAPTION) returns 19 (which is also what Wine returns for me), while the initial trackbar thumb size is 21. On Win2k, GetSystemMetrics(SM_CYCAPTION) returns 20, but the the initial thumb size is still 21. So am I doing something wrong? It does not appear to me that the trackbar thumb size is related to SM_CYCAPTION.
By the way, for me, changing to [Version] "Windows" = "win2k"
still returns 19 for SM_CYCAPTION for me on Wine. I am assuming that should return 20?
I imagine the result on XP even depends on whether you are using the "new style" or "old style" window title bars.
Maybe not though.
Kelly
winuser.h:#define SM_CYCAPTION 4
Sorry, I was wrong. In the standard Windows Metrics, GetSystemMetrics( SM_CYCAPTION) returns 19. The thumb length equals this value + 2.
infoPtr->uThumblen = GetSystemMetrics( SM_CYCAPTION) + 2;
On a native platform, if you modify this value, thumb length will follow this formula.
But it is not so simple, there are other conditions for computing the initial thumb length.
Stephan