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: Appearance Drawing Questions



>DrawThemeWindowListHeader does not look right. It paints with sprite.
>I want something similar to the ones used in Finder's list view or
>databrowser.
>
> *-------------*-------------*
> |/ Name //////|/ Date //////| <--- I'm talking about these.
> *-------------*-------------*
> | | |
> | Baz.exe | 2001-01 |
> | Qux.dat | 2003-05 |
> | ... | ... |
>
>
>Also DrawThemeWindowHeader does not draw border line. So the window
>with sprite background + a window header is indistinguishable from
>the window with sprite bkgnd.

Takehiko Abe,

Following is some information that I posted on 5/20, when someone asked a
similar question. -- I believe (from memory) that DrawThemeWindowHeader
is intended to draw a "status bar" area that might contain "5 of 10 items
selected" and so on.

-----
Below is some code I use in an LTableView-derived class, to draw the Aqua
column header. (This is adapted from someone else's Carbon-Dev post over
a year ago...sorry, I don't remember who the original poster was.)

// Aqua list header
ThemeButtonDrawInfo drawInfo;
drawInfo.state = this->IsActive() ? kThemeStateActive :
kThemeStateInactive;
drawInfo.value = 0;
drawInfo.adornment = kThemeAdornmentNone;

if ( this->fSortedColumn == inCell.col )
{
drawInfo.value = 1;

if ( this->fSortIsAscending )
drawInfo.adornment |= kThemeAdornmentHeaderButtonSortUp;
}

OSErr err = ::DrawThemeButton( &frameRect, kThemeListHeaderButton,
&drawInfo, NULL, NULL, NULL, 0 );

// Then using DrawThemeTextBox or some other appearance savvy text
drawing
// function, you can draw the text on top of the list header.
//
// Also to draw the list header as selected, ie. the user has just
clicked
// on it and you want to track the click use this:

// drawInfo.state = kThemeStatePressed;
-----

Cheers,

--Dave
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
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.