Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How do I get the current theme and bitdepth for SetThemeBackground?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get the current theme and bitdepth for SetThemeBackground?



On Friday, June 29, 2001, at 10:42 AM, Blake Hodgetts wrote:

>> I'd really like a way for an independent control definition to be able
>> to
>> know what theme background it should apply to itself, so that it can
>> draw
>> its own background appropriately in a theme-background window.

>In that case, I think you should be using the SetUpControlBackground API
>(Controls.h)....

AHA!!! Yes, although I haven't tried it yet, this looks like it may be
-exactly- what I want. Thanks very much.


>> Even when I have the correct background, using SetThemeBackground(), I'm
>> having some trouble getting the backgrounds of controls to align
>> particularly. This is especially noticeable with PowerPlant's
>> LRadioButton
>> class; if LRadioButtons are not positioned just so, their backgrounds
>> won't
>> align with the window background.

>This, I believe, is because PowerPlant changes the port origin when
>drawing, which doesn't work with patterned backgrounds. I've heard that
>there's a newer PowerPlant available that doesn't change the origin.

I'm not sure about that, but I -did- find out something about the
alignment of patterns in controls in PowerPlant that might be
useful and interesting to others on this list.

It seems that controls -do- correctly align their backgrounds with
the window background when drawing directly into the window. However,
if the control is drawn into a view within the window (an LView,
LTextBox, LCheckBoxGroupBox, LRadioGroup, or other container), then
the origin of the control's background is based on the containing
view rather than on the window. (Possibly this is the "changing port
origin" you're referring to.) This means that if all of your views
are aligned on 4-pixel boundaries (the minimum required to align
with OS X's lined background themes), all controls within those
views will be aligned regardless of where the controls are placed;
conversely, if the views -aren't- aligned, the controls will look
bad no matter how you adjust them. I haven't found a way to force
a control to use the window port origin rather than the containing
view's origin, but from the description of SetUpControlBackground,
it looks as if that might do it.

Thanks again,

Blake Hodgetts
Sr. SQA Engineer
Symantec Corp.




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.