Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Aqua slider behavior



Okay, so now I want to exactly mimic the behavior of sliders in Aqua:
click on the track (or even outside the track (no partcode is returned),
but within the control's bounds, including the tickmarks) and the thumb
should immediately place itself under the mouse.

I have it working, but I miss one last piece of the puzzle: the width of
the slider thumb. It is not defined (height is, but not width).

Here's what I'm doing:

//always reset the thumb at 0, 0
thumbOffset.h = clickPt.h - themeTrackInfo.bounds.left;
thumbOffset.v = clickPt.v - themeTrackInfo.bounds.top;
themeTrackInfo.value = 0;

GetThemeTrackThumbPositionFromOffset( &sprite->themeTrackInfo,
thumbOffset,
&relativePosition );

GetThemeTrackLiveValue( &sprite->themeTrackInfo,
relativePosition,
&myValue );

themeTrackInfo.value = myValue;

This works, but there's one issue: the thumb aligns with its left side
(horizontal slider) to the mouse position, not the center. Any ideas?

Thanks.

W!d
_______________________________________________
hit-developers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/hit-developers
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.