[info-mcl] Tab views

Octav Popescu octav at cmu.edu
Sun Sep 7 09:19:18 CDT 2008


Octav Popescu wrote:
> Terje Norderhaug wrote:
>> On Sep 6, 2008, at 7:24 PM, Octav Popescu wrote:
>>>>> More important, this is not the standard tab aspect in OS X 10.5.  
>>>>> You can see in the second capture what they look like in one of 
>>>>> the  System Preferences panes. Any chance to make it look that 
>>>>> way? I  don't know if that look is available in Carbon though. 
>>>>> Here's the  HIG page that talks about it:
>>>>>
>>>>> http://developer.apple.com/DOCUMENTATION/UserExperience/Conceptual/ 
>>>>> AppleHIGuidelines/XHIGControls/chapter_19_section_7.html
>>>>>
>>>>
>>>> The style of the tabs can be controlled through the :version  
>>>> attribute of the :HIThemeTabDrawInfo record passed to  
>>>> #_HiThemeDrawTextBox as inDrawInfo. Setting :version to 1 makes 
>>>> the  tabs appear as segmented controls (modern appearance) while  a 
>>>> :version of 0 produces traditional tabs (legacy appearance). The  
>>>> clipping or size of the tab view will have to be changed to make  
>>>> segmented controls fit.
>>>
>>> This does make a change, see test-mpv3. I can move the text to the 
>>> right position, but as you see the text and the tabs don't overlap. 
>>> How can I fix this? It also seems like each button starts with a 
>>> round left side, they're not part of one continuous segmented control.
>>
>> The text and tab aligns in the enclosed demo. Getting the proper 
>> round sides requires upgrading the HIThemeTabDrawInfo to have 
>> additional properties for :kind and :position. The latter can be used 
>> to specify whether the tab is should have a rounded side before 
>> and/or after. -- Terje
>>
>
> This does get the right continuous look for the tab bar, but the text 
> and tab bar still don't align. See attached capture (after I also put 
> the #$kHIThemeOrientationInverted back). I tried it on two different 
> computers, both running 10.5.4, and I got the same result. So 
> something is different in 10.5. Maybe it needs different origins for 
> text and tab rectangles?
>
> Octav

Wait, I just fixed this. :) I put #$kHIThemeOrientationInverted instead 
of #$kHIThemeOrientationNormal in #_HiThemeDrawTab and now they align, 
see test-mpv5. But it seems the text is a little high in the tab. So I 
also changed $kHIThemeTextVerticalFlushCenter to 
$kHIThemeTextVerticalFlushBottom in the :HIThemeTextInfo for 
#_HiThemeDrawTextBox, and it looks better, see test-mpv6.

Now the only thing left is positioning the tab bar correctly. Getting it 
lower is easy, but the HIG says it should also be centered over the 
pane. How can I do that? I don't know the width of the tab bar so I can 
compute a horizontal offset.

Octav
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-mpv5.tiff
Type: image/tiff
Size: 20328 bytes
Desc: not available
URL: <http://clozure.com/pipermail/info-mcl/attachments/20080907/499403a9/attachment.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-mpv6.tiff
Type: image/tiff
Size: 20242 bytes
Desc: not available
URL: <http://clozure.com/pipermail/info-mcl/attachments/20080907/499403a9/attachment-0001.tiff>


More information about the info-mcl mailing list