gwenhywfar 4.0.3
|
00001 // 00002 // CocoaCheckboxButton.m 00003 // 00004 // Created by Samuel Strupp on 12.08.10. 00005 // 00006 00007 #ifdef HAVE_CONFIG_H 00008 # include <config.h> 00009 #endif 00010 00011 00012 #import "CocoaCheckboxButton.h" 00013 00014 #import <Foundation/Foundation.h> 00015 00016 00017 @implementation CocoaCheckboxButton 00018 00019 - (id)initWithFrame:(NSRect)frame { 00020 self = [super initWithFrame:frame]; 00021 if (self) { 00022 [self setBezelStyle:NSRoundedBezelStyle]; 00023 [self setButtonType:NSSwitchButton]; 00024 } 00025 return self; 00026 } 00027 00028 -(void) dealloc { 00029 [super dealloc]; 00030 } 00031 00032 -(void) computeMinWidth { 00033 NSSize size = [self neededTextSize]; 00034 minWidth = size.width + 22.0; 00035 } 00036 00037 /*- (void)drawRect:(NSRect)dirtyRect { 00038 //debug colors 00039 [[NSColor orangeColor] set]; 00040 NSRectFill(dirtyRect); 00041 [super drawRect:dirtyRect]; 00042 }*/ 00043 00044 #pragma mark Protocoll Methods 00045 00046 - (NSSize) minSize { 00047 return NSMakeSize(minWidth, 16.0); 00048 } 00049 00050 @end