Mailing Lists: Apple Mailing Lists

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

Re: custom slider



On 5/29/06 12:05 PM, silviu stefan didst favor us with:

> They don't work... Maybe i'm not doing it right:

You've decided you need to get part codes when as far as I know there's no
reason to either need them or expect them. You're trying to make this a lot
more complicated than it is, though I don't know why.

> I call GetEventParameter in the kEventControlDraw
> event and than i make a switch after thr part code
> obtained and draw the parts. I've tried for a single
> part at first but still no luck...

I said previously that I wouldn't expect separate calls to a draw handler
for the different parts. Why do you expect that? I would expect to draw the
whole slider -- track, indicator, and tick marks -- in my kEventControlDraw
handler. In most multi-part controls with a modern Aqua look there are no
distinct boundaries between parts as a result of shadows and anti-aliasing.
As such isn't not reasonable IMO to expect to get a kEventControlDraw event
for individual parts. Although there could be exceptions, they would
definitely me exceptions.

It's your slider with your custom appearance. Draw the entire thing in your
kEventControlDraw handler and be done with it. This is very simple. Stop
making it complicated.

Larry

> 
> --- Laurence Harris <email@hidden> wrote:
> 
>> On 5/29/06 11:41 AM, silviu stefan didst favor us
>> with:
>> 
>>> I'm aware that the slider parts must be drawn
>>> separately, but i'm having a hard time in locating
>> the
>>> part codes... Could you tell me where to look for
>>> them?!
>> 
>> I would try these:
>> 
>> From Controls.h:
>> 
>> kControlIndicatorPart         =
>> kAppearancePartIndicator,
>> 
>> From ControlDefinitions.h:
>> 
>> kControlPageUpPart            =
>> kAppearancePartPageUpArea,
>> kControlPageDownPart          =
>> kAppearancePartPageDownArea,
>> 
>> Larry
>> 
>>> 
>>> --- Laurence Harris <email@hidden> wrote:
>>> 
>>>> On 5/29/06 10:12 AM, silviu stefan didst favor us
>>>> with:
>>>> 
>>>>> I'm currently trying your idea. But i still have a problem...
>>>>> 
>>>>> How should i draw in kEventControlDraw event, the indicator part and the
>>>>> track? I assume they must be drawnn separatly. Are there any special codes
>>>>> for these parts?
>>>>> 
>>>> Assumptions are evil.
>>>> 
>>>> I haven't done this with a slider, but I wouldn't assume they have to be
>>>> drawn separately. Well, yes, *you* need to draw them separately, but in the
>>>> same kEventControlDraw event. It wouldn't make sense to get separate events
>>>> for the track and the indicator.
>>>> 
>>>> Don't assume. Just draw it the way you want in the kEventControlDraw.
>>>> 
>>>> Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: custom slider (From: silviu stefan <email@hidden>)



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.