Skip to content

Commit

Permalink
Changed the name of menu, Fixed the bug of setting startPoint property
Browse files Browse the repository at this point in the history
  • Loading branch information
levey committed Apr 15, 2012
1 parent b445292 commit 4447a06
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 175 deletions.
40 changes: 20 additions & 20 deletions AwesomeMenu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
5C0364A81488A5D4000CE00F /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 5C0364951488A5D4000CE00F /* [email protected] */; };
5C0364A91488A5D4000CE00F /* icon-star.png in Resources */ = {isa = PBXBuildFile; fileRef = 5C0364961488A5D4000CE00F /* icon-star.png */; };
5C0364AA1488A5D4000CE00F /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 5C0364971488A5D4000CE00F /* [email protected] */; };
5C0364AB1488A5D4000CE00F /* QuadCurveMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C03649A1488A5D4000CE00F /* QuadCurveMenu.m */; };
5C0364AC1488A5D4000CE00F /* QuadCurveMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C03649C1488A5D4000CE00F /* QuadCurveMenuItem.m */; };
5C3FF3641486564E0098EE93 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C3FF3631486564E0098EE93 /* UIKit.framework */; };
5C3FF3661486564E0098EE93 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C3FF3651486564E0098EE93 /* Foundation.framework */; };
5C3FF3681486564E0098EE93 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C3FF3671486564E0098EE93 /* CoreGraphics.framework */; };
5C3FF36E1486564E0098EE93 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5C3FF36C1486564E0098EE93 /* InfoPlist.strings */; };
5C3FF3701486564E0098EE93 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C3FF36F1486564E0098EE93 /* main.m */; };
5C3FF3741486564E0098EE93 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C3FF3731486564E0098EE93 /* AppDelegate.m */; };
5C5949CA153ACC510023B034 /* AwesomeMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C5949C7153ACC510023B034 /* AwesomeMenu.m */; };
5C5949CB153ACC510023B034 /* AwesomeMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C5949C9153ACC510023B034 /* AwesomeMenuItem.m */; };
5C93DC61148673F2003029CA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C93DC60148673F2003029CA /* QuartzCore.framework */; };
/* End PBXBuildFile section */

Expand All @@ -47,10 +47,6 @@
5C0364951488A5D4000CE00F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
5C0364961488A5D4000CE00F /* icon-star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-star.png"; sourceTree = "<group>"; };
5C0364971488A5D4000CE00F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
5C0364991488A5D4000CE00F /* QuadCurveMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuadCurveMenu.h; sourceTree = "<group>"; };
5C03649A1488A5D4000CE00F /* QuadCurveMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuadCurveMenu.m; sourceTree = "<group>"; };
5C03649B1488A5D4000CE00F /* QuadCurveMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuadCurveMenuItem.h; sourceTree = "<group>"; };
5C03649C1488A5D4000CE00F /* QuadCurveMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuadCurveMenuItem.m; sourceTree = "<group>"; };
5C3FF35F1486564E0098EE93 /* AwesomeMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AwesomeMenu.app; sourceTree = BUILT_PRODUCTS_DIR; };
5C3FF3631486564E0098EE93 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
5C3FF3651486564E0098EE93 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand All @@ -61,6 +57,10 @@
5C3FF3711486564E0098EE93 /* AwesomeMenu-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AwesomeMenu-Prefix.pch"; sourceTree = "<group>"; };
5C3FF3721486564E0098EE93 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5C3FF3731486564E0098EE93 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
5C5949C6153ACC510023B034 /* AwesomeMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AwesomeMenu.h; sourceTree = "<group>"; };
5C5949C7153ACC510023B034 /* AwesomeMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AwesomeMenu.m; sourceTree = "<group>"; };
5C5949C8153ACC510023B034 /* AwesomeMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AwesomeMenuItem.h; sourceTree = "<group>"; };
5C5949C9153ACC510023B034 /* AwesomeMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AwesomeMenuItem.m; sourceTree = "<group>"; };
5C93DC60148673F2003029CA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -100,17 +100,6 @@
path = Images;
sourceTree = "<group>";
};
5C0364981488A5D4000CE00F /* QuadCurveMenu */ = {
isa = PBXGroup;
children = (
5C0364991488A5D4000CE00F /* QuadCurveMenu.h */,
5C03649A1488A5D4000CE00F /* QuadCurveMenu.m */,
5C03649B1488A5D4000CE00F /* QuadCurveMenuItem.h */,
5C03649C1488A5D4000CE00F /* QuadCurveMenuItem.m */,
);
path = QuadCurveMenu;
sourceTree = "<group>";
};
5C3FF3541486564E0098EE93 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -143,7 +132,7 @@
isa = PBXGroup;
children = (
5C0364891488A5D4000CE00F /* Images */,
5C0364981488A5D4000CE00F /* QuadCurveMenu */,
5C5949C5153ACC510023B034 /* AwesomeMenu */,
5C3FF3721486564E0098EE93 /* AppDelegate.h */,
5C3FF3731486564E0098EE93 /* AppDelegate.m */,
5C3FF36A1486564E0098EE93 /* Supporting Files */,
Expand All @@ -162,6 +151,17 @@
name = "Supporting Files";
sourceTree = "<group>";
};
5C5949C5153ACC510023B034 /* AwesomeMenu */ = {
isa = PBXGroup;
children = (
5C5949C6153ACC510023B034 /* AwesomeMenu.h */,
5C5949C7153ACC510023B034 /* AwesomeMenu.m */,
5C5949C8153ACC510023B034 /* AwesomeMenuItem.h */,
5C5949C9153ACC510023B034 /* AwesomeMenuItem.m */,
);
path = AwesomeMenu;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -239,8 +239,8 @@
files = (
5C3FF3701486564E0098EE93 /* main.m in Sources */,
5C3FF3741486564E0098EE93 /* AppDelegate.m in Sources */,
5C0364AB1488A5D4000CE00F /* QuadCurveMenu.m in Sources */,
5C0364AC1488A5D4000CE00F /* QuadCurveMenuItem.m in Sources */,
5C5949CA153ACC510023B034 /* AwesomeMenu.m in Sources */,
5C5949CB153ACC510023B034 /* AwesomeMenuItem.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
6 changes: 3 additions & 3 deletions AwesomeMenu/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// AwesomeMenu
//
// Created by Levey on 11/30/11.
// Copyright (c) 2011 lunaapp.com. All rights reserved.
// Copyright (c) 2011 Levey & Other Contributors. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "QuadCurveMenu.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, QuadCurveMenuDelegate>
#import "AwesomeMenu.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, AwesomeMenuDelegate>

@property (strong, nonatomic) UIWindow *window;

Expand Down
70 changes: 17 additions & 53 deletions AwesomeMenu/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// AwesomeMenu
//
// Created by Levey on 11/30/11.
// Copyright (c) 2011 lunaapp.com. All rights reserved.
// Copyright (c) 2011 Levey & Other Contributors. All rights reserved.
//

#import "AppDelegate.h"
Expand All @@ -21,48 +21,46 @@ - (void)dealloc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];


UIImage *storyMenuItemImage = [UIImage imageNamed:@"bg-menuitem.png"];
UIImage *storyMenuItemImagePressed = [UIImage imageNamed:@"bg-menuitem-highlighted.png"];

UIImage *starImage = [UIImage imageNamed:@"icon-star.png"];

QuadCurveMenuItem *starMenuItem1 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem1 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem2 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem2 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem3 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem3 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem4 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem4 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem5 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem5 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem6 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem6 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem7 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem7 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem8 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem8 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
QuadCurveMenuItem *starMenuItem9 = [[QuadCurveMenuItem alloc] initWithImage:storyMenuItemImage
AwesomeMenuItem *starMenuItem9 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
Expand All @@ -78,8 +76,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[starMenuItem8 release];
[starMenuItem9 release];

QuadCurveMenu *menu = [[QuadCurveMenu alloc] initWithFrame:self.window.bounds menus:menus];
AwesomeMenu *menu = [[AwesomeMenu alloc] initWithFrame:self.window.bounds menus:menus];
// customize menu
/*
menu.rotateAngle = M_PI/3;
Expand All @@ -98,48 +96,14 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

- (void)quadCurveMenu:(QuadCurveMenu *)menu didSelectIndex:(NSInteger)idx
{
NSLog(@"Select the index : %d",idx);
}

- (void)applicationWillResignActive:(UIApplication *)application
{
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
*/
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
}
/* ⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ */
/* ⬇⬇⬇⬇⬇⬇ GET RESPONSE OF MENU ⬇⬇⬇⬇⬇⬇ */
/* ⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ */

- (void)applicationDidBecomeActive:(UIApplication *)application
- (void)AwesomeMenu:(AwesomeMenu *)menu didSelectIndex:(NSInteger)idx
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}

- (void)applicationWillTerminate:(UIApplication *)application
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackground:.
*/
NSLog(@"Select the index : %d",idx);
}

@end
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
//
// QuadCurveMenu.h
// AwesomeMenu.h
// AwesomeMenu
//
// Created by Levey on 11/30/11.
// Copyright (c) 2011 lunaapp.com. All rights reserved.
// Copyright (c) 2011 Levey & Other Contributors. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "QuadCurveMenuItem.h"
#import "AwesomeMenuItem.h"

@protocol QuadCurveMenuDelegate;
@protocol AwesomeMenuDelegate;


@interface QuadCurveMenu : UIView <QuadCurveMenuItemDelegate>
@interface AwesomeMenu : UIView <AwesomeMenuItemDelegate>
{
NSArray *_menusArray;
int _flag;
NSTimer *_timer;
QuadCurveMenuItem *_addButton;
AwesomeMenuItem *_addButton;

id<QuadCurveMenuDelegate> _delegate;
id<AwesomeMenuDelegate> _delegate;

}
@property (nonatomic, copy) NSArray *menusArray;
@property (nonatomic, getter = isExpanding) BOOL expanding;
@property (nonatomic, assign) id<QuadCurveMenuDelegate> delegate;
@property (nonatomic, assign) id<AwesomeMenuDelegate> delegate;

@property (nonatomic, retain) UIImage *image;
@property (nonatomic, retain) UIImage *highlightedImage;
Expand All @@ -44,6 +44,6 @@
- (id)initWithFrame:(CGRect)frame menus:(NSArray *)aMenusArray;
@end

@protocol QuadCurveMenuDelegate <NSObject>
- (void)quadCurveMenu:(QuadCurveMenu *)menu didSelectIndex:(NSInteger)idx;
@protocol AwesomeMenuDelegate <NSObject>
- (void)AwesomeMenu:(AwesomeMenu *)menu didSelectIndex:(NSInteger)idx;
@end
Loading

0 comments on commit 4447a06

Please sign in to comment.