📄 labelbutton.m
字号:
#import <CoreFoundation/CoreFoundation.h>#import <Foundation/Foundation.h>#import <UIKit/CDStructures.h>#import <UIKit/UIWindow.h>#import <UIKit/UIView-Hierarchy.h>#import <UIKit/UIHardware.h>#import <UIKit/UIKit.h>#import <UIKit/UIApplication.h>#import <UIKit/UITextView.h>#import <UIKit/UIView.h>#import <UIKit/UIKeyboard.h>#import <UIKit/UIBox.h>#import <Celestial/AVItem.h>#import <Celestial/AVController.h>#import <Celestial/AVQueue.h>
#import <WebCore/WebFontCache.h>
#import <math.h>
#import "TtrApp.h"
#import "LabelButton.h"
@implementation LabelButton
- (id) initWithText: (NSString *) text rect: (struct CGRect)rect triggerWord: (NSString *)trig fontSize: (int)size app: (TtrApp*)appl { app = appl; triggerWord = trig; [super initWithFrame: rect]; rect.origin.x = rect.origin.y = 0; lab = [[UITextLabel alloc] initWithFrame: rect]; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); float textcomponents[4] = {0, 1, 0, 1}; float backgroundcomponents[4] = {0,0,0,0}; [lab setColor: CGColorCreate( colorSpace, textcomponents)]; [lab setBackgroundColor: CGColorCreate( colorSpace, backgroundcomponents)]; [lab setCentersHorizontally: YES]; [lab setFont: [NSClassFromString(@"WebFontCache") createFontWithFamily: @"Courier New" traits: 2 size: size]]; [lab setText: text]; [self addSubview: lab]; return self;}- (void)mouseUp:(void *)event { [app triggerButton: triggerWord];}
- (BOOL) ignoresMouseEvents {
return NO;
}
@end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -