gwenhywfar 5.14.1
CocoaCheckboxButton.m
Go to the documentation of this file.
1//
2// CocoaCheckboxButton.m
3//
4// Created by Samuel Strupp on 12.08.10.
5//
6
7#ifdef HAVE_CONFIG_H
8# include <config.h>
9#endif
10
11
13
14#import <Foundation/Foundation.h>
15
16
17@implementation CocoaCheckboxButton
18
19- (id)initWithFrame:(NSRect)frame {
20 self = [super initWithFrame:frame];
21 if (self) {
22 [self setBezelStyle:NSRoundedBezelStyle];
23 [self setButtonType:NSSwitchButton];
24 }
25 return self;
26}
27
28-(void) dealloc {
29 [super dealloc];
30}
31
32-(void) computeMinWidth {
33 NSSize size = [self neededTextSize];
34 minWidth = size.width + 22.0;
35}
36
37/*- (void)drawRect:(NSRect)dirtyRect {
38 //debug colors
39 [[NSColor orangeColor] set];
40 NSRectFill(dirtyRect);
41 [super drawRect:dirtyRect];
42}*/
43
44#pragma mark Protocoll Methods
45
46- (NSSize) minSize {
47 return NSMakeSize(minWidth, 16.0);
48}
49
50@end
CGFloat minWidth
Definition CocoaButton.h:25