project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
changeset 7244 75197d981acb
parent 7242 ed8bd253408c
child 10108 c68cf030eded
equal deleted inserted replaced
7242:ed8bd253408c 7244:75197d981acb
   220     cell.textLabel.adjustsFontSizeToFitWidth = YES;
   220     cell.textLabel.adjustsFontSizeToFitWidth = YES;
   221     cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
   221     cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
   222     return cell;
   222     return cell;
   223 }
   223 }
   224 
   224 
   225 -(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section {
   225 -(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger) section {
   226     return IS_IPAD() ? 0 : 50;
   226     return IS_IPAD() ? 0 : 50;
   227 }
   227 }
   228 
   228 
   229 -(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section {
   229 -(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger) section {
   230     if (IS_IPAD())
   230     if (IS_IPAD())
   231         return nil;
   231         return nil;
   232     UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 30)];
   232     UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 30)];
   233     theView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
   233     theView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
   234     self.topControl.frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
   234     self.topControl.frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
   235     self.topControl.center = CGPointMake(self.view.frame.size.width/2, 24);
   235     self.topControl.center = CGPointMake(self.view.frame.size.width/2, 24);
   236     [self.topControl addTarget:aTableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
   236     [self.topControl addTarget:aTableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
   237     [theView addSubview:self.topControl];
   237     [theView addSubview:self.topControl];
   238     return [theView autorelease];
   238     return [theView autorelease];
       
   239 }
       
   240 
       
   241 -(CGFloat) tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger) section {
       
   242     return 40;
       
   243 }
       
   244 
       
   245 -(UIView *)tableView:(UITableView *)aTableView viewForFooterInSection:(NSInteger) section {
       
   246     NSInteger height = 40;
       
   247     UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, height)];
       
   248     footer.backgroundColor = [UIColor clearColor];
       
   249     footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
       
   250 
       
   251     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width*80/100, height)];
       
   252     label.center = CGPointMake(aTableView.frame.size.width/2, height/2);
       
   253     label.textAlignment = UITextAlignmentCenter;
       
   254     label.font = [UIFont italicSystemFontOfSize:12];
       
   255     label.textColor = [UIColor whiteColor];
       
   256     label.numberOfLines = 2;
       
   257     label.backgroundColor = [UIColor clearColor];
       
   258     label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
       
   259 
       
   260     label.text = NSLocalizedString(@"Setting a Style might force a particular Scheme or Weapon configuration.",@"");
       
   261 
       
   262     [footer addSubview:label];
       
   263     [label release];
       
   264     return [footer autorelease];
   239 }
   265 }
   240 
   266 
   241 #pragma mark -
   267 #pragma mark -
   242 #pragma mark Table view delegate
   268 #pragma mark Table view delegate
   243 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   269 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {