Browse Source

Menu customer

Marino Faggiana 8 years ago
parent
commit
70ce90e908
1 changed files with 54 additions and 1 deletions
  1. 54 1
      iOSClient/Main/CCMain.m

+ 54 - 1
iOSClient/Main/CCMain.m

@@ -3154,6 +3154,8 @@
     if (app.reSelectMenu.isOpen || app.reMainMenu.isOpen)
         return;
     
+    NSMutableArray *menuArray = [NSMutableArray new];
+    
 #ifndef OPTION_MULTIUSER_DISABLE
     
     if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [CCCoreData countTableAutomaticUploadForAccount:app.activeAccount selector:nil] > 0) {
@@ -3163,7 +3165,7 @@
     }
     
     NSArray *listTableAccount = [CCCoreData getAllTableAccount];
-    NSMutableArray *menuArray = [[NSMutableArray alloc] init];
+   
     
     for (TableAccount *record in listTableAccount) {
      
@@ -3218,6 +3220,57 @@
     
 #if defined(MENU_BRAND_ENABLE) && defined(OPTION_MULTIUSER_DISABLE)
     
+    CCMenuItem *item;
+    
+    item = [CCMenuItem new];
+    item.title = @"Example title ... N. 1";
+    item.image = [UIImage imageNamed:image_notification];
+    item.target = self;
+    [menuArray addObject:item];
+
+    item = [CCMenuItem new];
+    item.title = @"Example title ... N. 2";
+    item.image = [UIImage imageNamed:image_notification];
+    item.target = self;
+    [menuArray addObject:item];
+    
+    item = [CCMenuItem new];
+    item.title = @"Example title ... N. 3";
+    item.image = [UIImage imageNamed:image_notification];
+    item.target = self;
+    [menuArray addObject:item];
+    
+    OptionalConfiguration options;
+    Color textColor, backgroundColor;
+    
+    textColor.R = 0;
+    textColor.G = 0;
+    textColor.B = 0;
+    
+    backgroundColor.R = 1;
+    backgroundColor.G = 1;
+    backgroundColor.B = 1;
+    
+    NSInteger originY = 60;
+    
+    options.arrowSize = 9;
+    options.marginXSpacing = 7;
+    options.marginYSpacing = 10;
+    options.intervalSpacing = 20;
+    options.menuCornerRadius = 6.5;
+    options.maskToBackground = NO;
+    options.shadowOfMenu = YES;
+    options.hasSeperatorLine = YES;
+    options.seperatorLineHasInsets = YES;
+    options.textColor = textColor;
+    options.menuBackgroundColor = backgroundColor;
+    
+    CGRect rect = self.view.frame;
+    rect.origin.y = rect.origin.y + originY;
+    rect.size.height = rect.size.height - originY;
+    
+    [CCMenu setTitleFont:[UIFont systemFontOfSize:12.0]];
+    [CCMenu showMenuInView:self.navigationController.view fromRect:rect menuItems:menuArray withOptions:options];
     
 #endif