project_files/HedgewarsMobile/Classes/ExtraCategories.m
changeset 6711 76e96101a84f
parent 6700 e04da46ee43c
child 6832 fae8fd118da9
equal deleted inserted replaced
6709:018539298042 6711:76e96101a84f
    94 
    94 
    95 @end
    95 @end
    96 
    96 
    97 
    97 
    98 #pragma mark -
    98 #pragma mark -
       
    99 @implementation UIButton (quickStyle)
       
   100 
       
   101 -(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title {
       
   102     [self initWithFrame:frame];
       
   103     [self setTitle:title forState:UIControlStateNormal];
       
   104     [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
       
   105     [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
       
   106     self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
       
   107     self.backgroundColor = [UIColor blackColorTransparent];
       
   108 
       
   109     [self.layer setBorderWidth:1];
       
   110     [self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]];
       
   111     [self.layer setCornerRadius:9.0f];
       
   112     [self.layer setMasksToBounds:YES];
       
   113 
       
   114     return self;
       
   115 }
       
   116 
       
   117 @end
       
   118 
       
   119 
       
   120 #pragma mark -
    99 @implementation UILabel (quickStyle)
   121 @implementation UILabel (quickStyle)
   100 
   122 
   101 -(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title {
   123 -(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title {
   102     return [self initWithFrame:frame
   124     return [self initWithFrame:frame
   103                       andTitle:title
   125                       andTitle:title
   104                withBorderWidth:1.5f
   126                withBorderWidth:1.5f
   105                withBorderColor:[UIColor darkYellowColor]
   127                withBorderColor:[UIColor darkYellowColor]
   106            withBackgroundColor:[UIColor darkBlueColor]];
   128            withBackgroundColor:[UIColor darkBlueColor]];
   107 }
   129 }
   108 
   130 
   109 -(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth {
   131 -(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth {
   110     return [self initWithFrame:frame
   132     return [self initWithFrame:frame
   111                       andTitle:title
   133                       andTitle:title
   112                withBorderWidth:borderWidth
   134                withBorderWidth:borderWidth
   113                withBorderColor:[UIColor darkYellowColor]
   135                withBorderColor:[UIColor darkYellowColor]
   114            withBackgroundColor:[UIColor darkBlueColorTransparent]];
   136            withBackgroundColor:[UIColor darkBlueColorTransparent]];
   115 }
   137 }
   116 
   138 
   117 -(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title  withBorderWidth:(CGFloat) borderWidth
   139 -(id) initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth
   118           withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor{
   140           withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor {
   119     UILabel *theLabel = [self initWithFrame:frame];
   141     UILabel *theLabel = [self initWithFrame:frame];
   120     theLabel.backgroundColor = backColor;
   142     theLabel.backgroundColor = backColor;
   121 
   143 
   122     if (title != nil) {
   144     if (title != nil) {
   123         theLabel.text = title;
   145         theLabel.text = title;