*/
-
#import <Cocoa/Cocoa.h>
@interface MTApplication : NSApplication
* Original Author : Kent Sutherland <ksuther@ithinksw.com>
* Responsibility : Kent Sutherland <ksuther@ithinksw.com>
*
- * Copyright (c) 2002 The iThink Group.
+ * Copyright (c) 2002 iThink Software.
* All Rights Reserved
*
*/
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
-@class MenuTunesView, PreferencesController, StatusWindowController;
+//@class MenuTunesView;
+@class PreferencesController, StatusWindowController;
@interface MenuTunes : NSObject
{
NSStatusItem *statusItem;
NSMenu *menu;
- MenuTunesView *view;
+// MenuTunesView *view;
ComponentInstance asComponent;
//Used in updating the menu automatically
*/
#import "MenuTunes.h"
-#import "MenuTunesView.h"
+// #import "MenuTunesView.h"
#import "PreferencesController.h"
#import "HotKeyCenter.h"
#import "StatusWindowController.h"
}
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
- [statusItem setImage:[NSImage imageNamed:@"menu.tiff"]];
+ [[[statusItem _button] cell] setType:0];
+ [statusItem setImage:[NSImage imageNamed:@"menu"]];
+ [[statusItem _button] setAlternateImage:[NSImage imageNamed:@"selected_image"]];
[statusItem setHighlightMode:YES];
[statusItem setMenu:menu];
[statusItem retain];
- view = [[MenuTunesView alloc] initWithFrame:[[statusItem view] frame]];
- //[statusItem setView:view];
+// view = [[MenuTunesView alloc] initWithFrame:[[statusItem view] frame]];
+// [statusItem setView:view];
}
CloseComponent(asComponent);
[statusItem release];
[menu release];
- [view release];
+// [view release];
[super dealloc];
}
* Responsibility : Kent Sutherland <ksuther@ithinksw.com>
* Contributors : Matt Judy <matt@nibfile.com>
*
- * Copyright (c) 2002 The iThink Group.
+ * Copyright (c) 2002 iThink Software.
* All Rights Reserved
*
*/
{
NSImage *image;
NSImage *altImage;
- NSImage *curImage;
+ BOOL mouseIsPressed;
}
@end
#import "MenuTunesView.h"
+extern NSColor* _NSGetThemePartColorPattern(int, int, int);
+// extern NSColor* _NSGetThemePartColorPattern(int imageID, _NSThemeState state, int color);
@implementation MenuTunesView
{
image = [NSImage imageNamed:@"menu"];
altImage = [NSImage imageNamed:@"selected_image"];
- curImage = image;
+ mouseIsPressed = NO;
}
return self;
}
- (void)drawRect:(NSRect)rect
{
- [curImage compositeToPoint:NSMakePoint(0, 0) operation:NSCompositeSourceOver];
+ NSImage *icon;
+ NSColor *background;
+
+ if ( mouseIsPressed ) {
+ icon = altImage;
+ background = _NSGetThemePartColorPattern(44, 2, 0);
+ } else {
+ icon = image;
+ background = [NSColor clearColor];
+ }
+ [background set];
+ NSRectFill(rect);
+ [icon compositeToPoint:NSMakePoint(((rect.size.width - [icon size].width) / 2), 0)
+ operation:NSCompositeSourceOver];
}
- (void)mouseDown:(NSEvent *)event
{
- curImage = altImage;
+ mouseIsPressed = YES;
[self setNeedsDisplay:YES];
[super mouseDown:event];
}
- (void)mouseUp:(NSEvent *)event
{
- curImage = image;
+ mouseIsPressed = NO;
[self setNeedsDisplay:YES];
[super mouseUp:event];
}
* Original Author : Kent Sutherland <ksuther@ithinksw.com>
* Responsibility : Kent Sutherland <ksuther@ithinksw.com>
*
- * Copyright (c) 2002 The iThink Group.
+ * Copyright (c) 2002 iThink Software.
* All Rights Reserved
*
*/
* Original Author : Kent Sutherland <ksuther@ithinksw.com>
* Responsibility : Kent Sutherland <ksuther@ithinksw.com>
*
- * Copyright (c) 2002 The iThink Group.
+ * Copyright (c) 2002 iThink Software.
* All Rights Reserved
*
*/
* Original Author : Kent Sutherland <ksuther@ithinksw.com>
* Responsibility : Kent Sutherland <ksuther@ithinksw.com>
*
- * Copyright (c) 2002 The iThink Group.
+ * Copyright (c) 2002 iThink Software.
* All Rights Reserved
*
*/