gwenhywfar 5.10.1
CocoaTabView.m
Go to the documentation of this file.
1//
2// CocoaTabView.m
3//
4//
5// Created by Samuel Strupp on 10.08.10.
6//
7
8#ifdef HAVE_CONFIG_H
9# include <config.h>
10#endif
11
12
13#import "CocoaTabView.h"
14
15
16@implementation CocoaTabView
17
18@synthesize fillX;
19@synthesize fillY;
20
21- (id)initWithFrame:(NSRect)frame {
22 self = [super initWithFrame:frame];
23 if (self) {
24 fillX = NO;
25 fillY = NO;
26 }
27 return self;
28}
29
30-(void) dealloc {
31 [super dealloc];
32}
33
34#pragma mark Protocoll Methods
35
36- (NSSize) minSize {
37 NSArray *tabViewItems = [self tabViewItems];
38 NSSize maxSize = NSZeroSize;
39 for (NSTabViewItem *item in tabViewItems) {
40 NSView *subview = [item view];
41 if ([subview conformsToProtocol:@protocol(CocoaGwenGUIProtocol)]) {
42 NSSize subViewMinSize = [(<CocoaGwenGUIProtocol>)subview minSize];
43 if (subViewMinSize.width > maxSize.width) maxSize.width = subViewMinSize.width;
44 if (subViewMinSize.height > maxSize.height) maxSize.height = subViewMinSize.height;
45 }
46 }
47 if ([self tabViewType] != NSNoTabsNoBorder) {
48 maxSize.width += 22.0;
49 maxSize.height += 40.0;
50 }
51 return maxSize;
52}
53
54- (BOOL) fillX {
55 return fillX;
56}
57
58- (BOOL) fillY {
59 return fillY;
60}
61
62@end