Krypt

Untitled

May 28th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void) rotateUpperPanel: (BOOL) isPortrait
  2. {  
  3.     BOOL gtoolsPurchased = [delegate gtoolsPurchaseFlag];
  4.     BOOL toolspackPurchased = [delegate toolspackPurchaseFlag];
  5.    
  6.     borderView.hidden = isPanelOnTop;
  7.     borderView.frame = CGRectMake(0, 0, isPortrait? 320:480, 1);
  8.     int upButtonHeight = [self heightForButton];
  9.    
  10.     upperPanel.frame = isPanelOnTop ? (isPortrait ? CGRectMake(0, 0, 320, toolBarHeight) : CGRectMake(0, 0, 480, toolBarHeight)) : (isPortrait ? CGRectMake(0, 480 - titleBarHeightPortrait, 320, toolBarHeight) : CGRectMake(0, 320 - titleBarHeightLandscape, 480, toolBarHeight));
  11.    
  12.     [self makeDividerPanel:isPortrait];
  13.    
  14.     int leftShift = 0;
  15.     int btnCount = 0;
  16.     btnMetronome.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  17.     [btnMetronome setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  18.     [btnMetronome setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  19.     [self fixIconView:btnMetronome withNeedTransparent:!gtoolsPurchased];
  20.    
  21.     leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  22.     btnCount++;
  23.     btnFont.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  24.     [btnFont setBackgroundImage:[UIImage imageNamed: [self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  25.     [btnFont setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  26.     [self fixIconView:btnFont withNeedTransparent:!toolspackPurchased];
  27.    
  28.     leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  29.     btnCount++;
  30.     btnPrint.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  31.     [btnPrint setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  32.     [btnPrint setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  33.     [self fixIconView:btnPrint withNeedTransparent:!toolspackPurchased];
  34.    
  35.     leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  36.     btnCount++;
  37.     btnFormating.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  38.     [btnFormating setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  39.     [btnFormating setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  40.     [self fixIconView:btnFormating withNeedTransparent:!toolspackPurchased];
  41.    
  42.     leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  43.     btnCount++;
  44.     btnMusic.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  45.     [btnMusic setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  46.     [btnMusic setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  47.     [self fixIconView:btnMusic withNeedTransparent:NO];
  48.    
  49.     if (hasChords)
  50.     {
  51.         leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  52.         btnCount++;
  53.         btnTranspose.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  54.         [btnTranspose setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  55.         [btnTranspose setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  56.         [self fixIconView:btnTranspose withNeedTransparent:NO];
  57.     }
  58.    
  59.     leftShift += [self widthForButtonWithNumber:btnCount andOrientation:isPortrait] + 1;
  60.     btnCount++;
  61.     btnAutoScroll.frame = CGRectMake(leftShift, 0, [self widthForButtonWithNumber:btnCount andOrientation:isPortrait], upButtonHeight);
  62.     [btnAutoScroll setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:NO]] forState:UIControlStateNormal];
  63.     [btnAutoScroll setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  64.     [self fixIconView:btnAutoScroll withNeedTransparent:NO];
  65.    
  66.     UIImage *buttonbg = [UIImage imageNamed:@"buttonsbg.png"];
  67.    
  68.     btnScroll.frame = CGRectMake(isPortrait ? 267 : 427, isPanelOnTop ? 0 : (isPortrait ? 480 - 39 : 320 - 39), 53, 39);
  69.     [btnScroll setBackgroundColor:[UIColor colorWithPatternImage:buttonbg]];
  70.     [btnScroll setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:isScrollAction]] forState:UIControlStateNormal];
  71.     [btnScroll setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  72.     [self fixIconView:btnScroll withNeedTransparent:NO];
  73.    
  74.     btnFullscreen.frame = CGRectMake(isPortrait ? 212 : 372, isPanelOnTop ? 0 : (isPortrait ? 480 - 39 : 320 - 39), 53, 39);
  75.     [btnFullscreen setBackgroundColor:[UIColor colorWithPatternImage:buttonbg]];
  76.     [btnFullscreen setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:isScrollAction]] forState:UIControlStateNormal];
  77.     [btnFullscreen setBackgroundImage:[UIImage imageNamed:[self imageForButtonWithOrientation:isPortrait andActive:YES]] forState:UIControlStateHighlighted];
  78.     [self fixIconView:btnFullscreen withNeedTransparent:NO];
  79.    
  80.     [self setButtons:isFontAction second:isFormatAction third:isTransposeAction fourth:isScrollAction five:isPrintAction six:isMusicAction];
  81. }
Advertisement
Add Comment
Please, Sign In to add comment