Files
watrbx-game-engine/Installer/BootstrapperMac/Roblox/CustomUIObjects.m
T
2025-09-18 17:55:52 -04:00

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