CocoaTabView.m

Go to the documentation of this file.
00001 //
00002 //  CocoaTabView.m
00003 //  
00004 //
00005 //  Created by Samuel Strupp on 10.08.10.
00006 //
00007 
00008 #ifdef HAVE_CONFIG_H
00009 # include <config.h>
00010 #endif
00011 
00012 
00013 #import "CocoaTabView.h"
00014 
00015 
00016 @implementation CocoaTabView
00017 
00018 @synthesize fillX;
00019 @synthesize fillY;
00020 
00021 - (id)initWithFrame:(NSRect)frame {
00022     self = [super initWithFrame:frame];
00023     if (self) {
00024                 fillX = NO;
00025                 fillY = NO;
00026     }
00027     return self;
00028 }
00029 
00030 -(void) dealloc {
00031         [super dealloc];
00032 }
00033 
00034 #pragma mark Protocoll Methods
00035 
00036 - (NSSize) minSize {
00037         NSArray *tabViewItems = [self tabViewItems];
00038         NSSize maxSize = NSZeroSize;
00039         for (NSTabViewItem *item in tabViewItems) {
00040                 NSView *subview = [item view];
00041                 if ([subview conformsToProtocol:@protocol(CocoaGwenGUIProtocol)]) {
00042                         NSSize subViewMinSize = [(<CocoaGwenGUIProtocol>)subview minSize];
00043                         if (subViewMinSize.width > maxSize.width) maxSize.width = subViewMinSize.width;
00044                         if (subViewMinSize.height > maxSize.height) maxSize.height = subViewMinSize.height;
00045                 }
00046         }
00047         if ([self tabViewType] != NSNoTabsNoBorder) {
00048                 maxSize.width += 22.0;
00049                 maxSize.height += 40.0;
00050         }
00051         return maxSize;
00052 }
00053 
00054 - (BOOL) fillX {
00055         return fillX;
00056 }
00057 
00058 - (BOOL) fillY {
00059         return fillY;
00060 }
00061 
00062 @end