mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
62 lines
1.3 KiB
Objective-C
62 lines
1.3 KiB
Objective-C
#import "CustomUIObjects.h"
|
|
|
|
@implementation SplashScreenPanel
|
|
- (BOOL) canBecomeKeyWindow
|
|
{
|
|
return TRUE;
|
|
}
|
|
@end
|
|
|
|
@implementation CustomImageButton
|
|
|
|
- (void) setImageName:(NSString*)imgName
|
|
{
|
|
buttonImageName = imgName;
|
|
[buttonImageName retain];
|
|
|
|
[self setImage:[NSImage imageNamed:buttonImageName]];
|
|
}
|
|
|
|
- (NSString*) getImageName
|
|
{
|
|
return buttonImageName;
|
|
}
|
|
|
|
- (void)mouseEntered:(NSEvent *)event
|
|
{
|
|
[self setImage:[NSImage imageNamed:[NSString stringWithFormat:@"%@-ON", buttonImageName]]];
|
|
}
|
|
|
|
- (void)mouseExited:(NSEvent *)event
|
|
{
|
|
[self setImage:[NSImage imageNamed:buttonImageName]];
|
|
}
|
|
|
|
- (void)mouseDown:(NSEvent *)event
|
|
{
|
|
[self performClick:event];
|
|
[self setImage:[NSImage imageNamed:buttonImageName]];
|
|
}
|
|
|
|
- (void)mouseUp:(NSEvent *)event
|
|
{
|
|
[super mouseUp:event];
|
|
[self setImage:[NSImage imageNamed:[NSString stringWithFormat:@"%@-ON", buttonImageName]]];
|
|
}
|
|
|
|
- (void)updateTrackingAreas
|
|
{
|
|
[super updateTrackingAreas];
|
|
|
|
if (trackingArea)
|
|
{
|
|
[self removeTrackingArea:trackingArea];
|
|
[trackingArea release];
|
|
}
|
|
|
|
NSTrackingAreaOptions options = NSTrackingInVisibleRect | NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp;
|
|
trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect options:options owner:self userInfo:nil];
|
|
[self addTrackingArea:trackingArea];
|
|
}
|
|
|
|
@end |