Permalink
Browse files

MRC

  • Loading branch information...
1 parent a3dc11b commit fc060d8edcd897f805eabbb5b0efaca657b9f2fc @martinh martinh committed Sep 26, 2011
Showing with 26 additions and 40 deletions.
  1. +1 −1 app/PSMMetalTabStyle.m
  2. +15 −9 app/PSMOverflowPopUpButton.m
  3. +2 −7 app/PSMRolloverButton.h
  4. +6 −22 app/PSMRolloverButton.m
  5. +2 −1 app/PSMTabBarControl.m
View
@@ -41,7 +41,7 @@ - (id) init
- (void)dealloc
{
- INFO(@"%p", self);
+ DEBUG_DEALLOC();
[_metalCloseButton release];
[_metalCloseButtonDown release];
[_metalCloseButtonOver release];
@@ -13,16 +13,22 @@ @implementation PSMOverflowPopUpButton
- (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag
{
- self=[super initWithFrame:frameRect pullsDown:YES];
- if (self) {
- [self setBezelStyle:NSRegularSquareBezelStyle];
- [self setBordered:NO];
- [self setTitle:@""];
- [self setPreferredEdge:NSMaxXEdge];
- _PSMTabBarOverflowPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImage"]];
+ if ((self = [super initWithFrame:frameRect pullsDown:YES]) != nil) {
+ [self setBezelStyle:NSRegularSquareBezelStyle];
+ [self setBordered:NO];
+ [self setTitle:@""];
+ [self setPreferredEdge:NSMaxXEdge];
+ _PSMTabBarOverflowPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImage"]];
_PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImagePressed"]];
- }
- return self;
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [_PSMTabBarOverflowPopUpImage release];
+ [_PSMTabBarOverflowDownPopUpImage release];
+ [super dealloc];
}
- (void)drawRect:(NSRect)rect
View
@@ -15,13 +15,8 @@
NSTrackingRectTag _myTrackingRectTag;
}
-// the regular image
-- (void)setUsualImage:(NSImage *)newImage;
-- (NSImage *)usualImage;
-
-// the rollover image
-- (void)setRolloverImage:(NSImage *)newImage;
-- (NSImage *)rolloverImage;
+@property (nonatomic,readwrite,retain) NSImage *rolloverImage;
+@property (nonatomic,readwrite,retain) NSImage *usualImage;
// tracking rect for mouse events
- (void)addTrackingRect;
View
@@ -10,30 +10,14 @@
@implementation PSMRolloverButton
-// the regular image
-- (void)setUsualImage:(NSImage *)newImage
-{
- [newImage retain];
- [_usualImage release];
- _usualImage = newImage;
- [self setImage:_usualImage];
-}
-
-- (NSImage *)usualImage
-{
- return _usualImage;
-}
-
-- (void)setRolloverImage:(NSImage *)newImage
-{
- [newImage retain];
- [_rolloverImage release];
- _rolloverImage = newImage;
-}
+@synthesize rolloverImage = _rolloverImage;
+@synthesize usualImage = _usualImage;
-- (NSImage *)rolloverImage
+- (void)dealloc
{
- return _rolloverImage;
+ [_rolloverImage release];
+ [_usualImage release];
+ [super dealloc];
}
- (void)addTrackingRect
View
@@ -163,7 +163,8 @@ - (id)initWithFrame:(NSRect)frame
- (void)dealloc
{
- INFO(@"dealloc %p", self);
+ DEBUG_DEALLOC();
+
[[NSNotificationCenter defaultCenter] removeObserver:self];
INFO(@"removing remaining cells: %@", _cells);

0 comments on commit fc060d8

Please sign in to comment.