commit f8a35b0751e874f6a097f1d32be658ae3f3f2f0f Author: Rnhmjoj Date: Mon Jul 22 17:02:52 2013 +0200 Commit iniziale diff --git a/Calcolatrice.xcodeproj/project.pbxproj b/Calcolatrice.xcodeproj/project.pbxproj new file mode 100644 index 0000000..38628c9 --- /dev/null +++ b/Calcolatrice.xcodeproj/project.pbxproj @@ -0,0 +1,313 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + D120194616B5FD98000B45F6 /* Scientifica.m in Sources */ = {isa = PBXBuildFile; fileRef = D120194516B5FD98000B45F6 /* Scientifica.m */; }; + D120194816B5FDDA000B45F6 /* Calcolatrice.xib in Resources */ = {isa = PBXBuildFile; fileRef = D120194116B5FD87000B45F6 /* Calcolatrice.xib */; }; + D19592A416B4A441005B91FA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D19592A316B4A441005B91FA /* Cocoa.framework */; }; + D1B3D70516B57EA900070D03 /* Normale.m in Sources */ = {isa = PBXBuildFile; fileRef = D1B3D70216B57EA900070D03 /* Normale.m */; }; + D1B3D70616B57EA900070D03 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D1B3D70416B57EA900070D03 /* AppDelegate.m */; }; + D1B3D70E16B57EEA00070D03 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D1B3D70D16B57EEA00070D03 /* main.m */; }; + D1E70EC416B6E4D400D2FABB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D1B3D70A16B57EE300070D03 /* InfoPlist.strings */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D120194216B5FD87000B45F6 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = Calcolatrice/it.lproj/Calcolatrice.xib; sourceTree = SOURCE_ROOT; }; + D120194416B5FD98000B45F6 /* Scientifica.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scientifica.h; path = Calcolatrice/Scientifica.h; sourceTree = SOURCE_ROOT; }; + D120194516B5FD98000B45F6 /* Scientifica.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Scientifica.m; path = Calcolatrice/Scientifica.m; sourceTree = SOURCE_ROOT; }; + D120194916B5FE55000B45F6 /* Calcolatrice.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = Calcolatrice.entitlements; path = Calcolatrice/Calcolatrice.entitlements; sourceTree = SOURCE_ROOT; }; + D195929F16B4A441005B91FA /* Calcolatrice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Calcolatrice.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D19592A316B4A441005B91FA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + D19592A616B4A441005B91FA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + D19592A716B4A441005B91FA /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + D19592A816B4A441005B91FA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + D19592C116B4A441005B91FA /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + D1B3D70116B57EA900070D03 /* Normale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Normale.h; path = Calcolatrice/Normale.h; sourceTree = SOURCE_ROOT; }; + D1B3D70216B57EA900070D03 /* Normale.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Normale.m; path = Calcolatrice/Normale.m; sourceTree = SOURCE_ROOT; }; + D1B3D70316B57EA900070D03 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Calcolatrice/AppDelegate.h; sourceTree = SOURCE_ROOT; }; + D1B3D70416B57EA900070D03 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Calcolatrice/AppDelegate.m; sourceTree = SOURCE_ROOT; }; + D1B3D70B16B57EE300070D03 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Calcolatrice/it.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + D1B3D70D16B57EEA00070D03 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Calcolatrice/main.m; sourceTree = SOURCE_ROOT; }; + D1B3D71116B57EFF00070D03 /* Calcolatrice-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Calcolatrice-Prefix.pch"; path = "Calcolatrice/Calcolatrice-Prefix.pch"; sourceTree = SOURCE_ROOT; }; + D1B3D71216B57F5300070D03 /* Calcolatrice-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Calcolatrice-Info.plist"; path = "Calcolatrice/Calcolatrice-Info.plist"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D195929C16B4A441005B91FA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D19592A416B4A441005B91FA /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D195929416B4A441005B91FA = { + isa = PBXGroup; + children = ( + D19592A916B4A441005B91FA /* Calcolatrice */, + D19592A216B4A441005B91FA /* Frameworks */, + D19592A016B4A441005B91FA /* Products */, + ); + sourceTree = ""; + }; + D19592A016B4A441005B91FA /* Products */ = { + isa = PBXGroup; + children = ( + D195929F16B4A441005B91FA /* Calcolatrice.app */, + ); + name = Products; + sourceTree = ""; + }; + D19592A216B4A441005B91FA /* Frameworks */ = { + isa = PBXGroup; + children = ( + D19592A316B4A441005B91FA /* Cocoa.framework */, + D19592C116B4A441005B91FA /* SenTestingKit.framework */, + D19592A516B4A441005B91FA /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + D19592A516B4A441005B91FA /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + D19592A616B4A441005B91FA /* AppKit.framework */, + D19592A716B4A441005B91FA /* CoreData.framework */, + D19592A816B4A441005B91FA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + D19592A916B4A441005B91FA /* Calcolatrice */ = { + isa = PBXGroup; + children = ( + D120194416B5FD98000B45F6 /* Scientifica.h */, + D120194516B5FD98000B45F6 /* Scientifica.m */, + D1B3D70116B57EA900070D03 /* Normale.h */, + D1B3D70216B57EA900070D03 /* Normale.m */, + D1B3D70316B57EA900070D03 /* AppDelegate.h */, + D1B3D70416B57EA900070D03 /* AppDelegate.m */, + D120194116B5FD87000B45F6 /* Calcolatrice.xib */, + D120194916B5FE55000B45F6 /* Calcolatrice.entitlements */, + D19592AA16B4A441005B91FA /* Supporting Files */, + ); + name = Calcolatrice; + path = Somma; + sourceTree = ""; + }; + D19592AA16B4A441005B91FA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D1B3D71216B57F5300070D03 /* Calcolatrice-Info.plist */, + D1B3D71116B57EFF00070D03 /* Calcolatrice-Prefix.pch */, + D1B3D70D16B57EEA00070D03 /* main.m */, + D1B3D70A16B57EE300070D03 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D195929E16B4A441005B91FA /* Calcolatrice */ = { + isa = PBXNativeTarget; + buildConfigurationList = D19592D116B4A441005B91FA /* Build configuration list for PBXNativeTarget "Calcolatrice" */; + buildPhases = ( + D195929B16B4A441005B91FA /* Sources */, + D195929C16B4A441005B91FA /* Frameworks */, + D195929D16B4A441005B91FA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Calcolatrice; + productName = Somma; + productReference = D195929F16B4A441005B91FA /* Calcolatrice.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D195929616B4A441005B91FA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Rnhmjoj; + }; + buildConfigurationList = D195929916B4A441005B91FA /* Build configuration list for PBXProject "Calcolatrice" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + it, + ); + mainGroup = D195929416B4A441005B91FA; + productRefGroup = D19592A016B4A441005B91FA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D195929E16B4A441005B91FA /* Calcolatrice */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D195929D16B4A441005B91FA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D1E70EC416B6E4D400D2FABB /* InfoPlist.strings in Resources */, + D120194816B5FDDA000B45F6 /* Calcolatrice.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D195929B16B4A441005B91FA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D1B3D70516B57EA900070D03 /* Normale.m in Sources */, + D1B3D70616B57EA900070D03 /* AppDelegate.m in Sources */, + D1B3D70E16B57EEA00070D03 /* main.m in Sources */, + D120194616B5FD98000B45F6 /* Scientifica.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D120194116B5FD87000B45F6 /* Calcolatrice.xib */ = { + isa = PBXVariantGroup; + children = ( + D120194216B5FD87000B45F6 /* it */, + ); + name = Calcolatrice.xib; + sourceTree = ""; + }; + D1B3D70A16B57EE300070D03 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + D1B3D70B16B57EE300070D03 /* it */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D19592CF16B4A441005B91FA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + D19592D016B4A441005B91FA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + D19592D216B4A441005B91FA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = Calcolatrice/Calcolatrice.entitlements; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Calcolatrice/Calcolatrice-Prefix.pch"; + INFOPLIST_FILE = "Calcolatrice/Calcolatrice-Info.plist"; + PRODUCT_NAME = Calcolatrice; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + D19592D316B4A441005B91FA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = Calcolatrice/Calcolatrice.entitlements; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Calcolatrice/Calcolatrice-Prefix.pch"; + INFOPLIST_FILE = "Calcolatrice/Calcolatrice-Info.plist"; + PRODUCT_NAME = Calcolatrice; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D195929916B4A441005B91FA /* Build configuration list for PBXProject "Calcolatrice" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19592CF16B4A441005B91FA /* Debug */, + D19592D016B4A441005B91FA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D19592D116B4A441005B91FA /* Build configuration list for PBXNativeTarget "Calcolatrice" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19592D216B4A441005B91FA /* Debug */, + D19592D316B4A441005B91FA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D195929616B4A441005B91FA /* Project object */; +} diff --git a/Calcolatrice.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Calcolatrice.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ba50e0f --- /dev/null +++ b/Calcolatrice.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/UserInterfaceState.xcuserstate b/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a89aef4 Binary files /dev/null and b/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/WorkspaceSettings.xcsettings b/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..28f6741 --- /dev/null +++ b/Calcolatrice.xcodeproj/project.xcworkspace/xcuserdata/Michele.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,22 @@ + + + + + BuildLocationStyle + UseAppPreferences + CustomBuildLocationType + RelativeToDerivedData + DerivedDataLocationStyle + Default + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IssueFilterStyle + ShowActiveSchemeOnly + LiveSourceIssuesEnabled + + SnapshotAutomaticallyBeforeSignificantChanges + + SnapshotLocationStyle + Default + + diff --git a/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/Somma.xcscheme b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/Somma.xcscheme new file mode 100644 index 0000000..b6ebc88 --- /dev/null +++ b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/Somma.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/xcschememanagement.plist b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..4544cd4 --- /dev/null +++ b/Calcolatrice.xcodeproj/xcuserdata/Michele.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + Somma.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + D195929E16B4A441005B91FA + + primary + + + D19592BF16B4A441005B91FA + + primary + + + + + diff --git a/Calcolatrice/.DS_Store b/Calcolatrice/.DS_Store new file mode 100644 index 0000000..67f5269 Binary files /dev/null and b/Calcolatrice/.DS_Store differ diff --git a/Calcolatrice/AppDelegate.h b/Calcolatrice/AppDelegate.h new file mode 100644 index 0000000..a532e72 --- /dev/null +++ b/Calcolatrice/AppDelegate.h @@ -0,0 +1,12 @@ +#import + +@interface AppDelegate : NSObject + +@property (assign) IBOutlet NSWindow *finestra1; +@property (assign) IBOutlet NSWindow *finestra2; + +- (IBAction) scambiaFinestre: (id) sender; +- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (NSApplication *) theApplication; +- (void) applicationDidFinishLaunching: (NSNotification *) aNotification; + +@end diff --git a/Calcolatrice/AppDelegate.m b/Calcolatrice/AppDelegate.m new file mode 100644 index 0000000..4a9a10c --- /dev/null +++ b/Calcolatrice/AppDelegate.m @@ -0,0 +1,30 @@ +#import "AppDelegate.h" + +@implementation AppDelegate + +- (void) applicationDidFinishLaunching: (NSNotification *) aNotification +{ + +} + +- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (NSApplication *) theApplication +{ + return YES; +} + +- (IBAction) scambiaFinestre: (id) sender +{ + switch([sender tag]){ + case 0:{ + [_finestra2 orderOut: self]; + [_finestra1 makeKeyAndOrderFront: self]; + } + case 1:{ + [_finestra1 orderOut: self]; + [_finestra2 makeKeyAndOrderFront: self]; + } + } + + +} +@end diff --git a/Calcolatrice/Calcolatrice-Info.plist b/Calcolatrice/Calcolatrice-Info.plist new file mode 100644 index 0000000..f5b9d40 --- /dev/null +++ b/Calcolatrice/Calcolatrice-Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.Rnhmjoj.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + public.app-category.utilities + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2013 Rnhmjoj. All rights reserved. + NSMainNibFile + Calcolatrice + NSPrincipalClass + NSApplication + + diff --git a/Calcolatrice/Calcolatrice-Prefix.pch b/Calcolatrice/Calcolatrice-Prefix.pch new file mode 100644 index 0000000..08114d1 --- /dev/null +++ b/Calcolatrice/Calcolatrice-Prefix.pch @@ -0,0 +1,3 @@ +#ifdef __OBJC__ + #import +#endif diff --git a/Calcolatrice/Calcolatrice.entitlements b/Calcolatrice/Calcolatrice.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/Calcolatrice/Calcolatrice.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/Calcolatrice/Normale.h b/Calcolatrice/Normale.h new file mode 100644 index 0000000..39a8dde --- /dev/null +++ b/Calcolatrice/Normale.h @@ -0,0 +1,16 @@ +#import + +@interface Normale : NSObject +{ + NSInteger operazioneCorrente; + NSNumber *numero1, *numero2; +} + +@property (retain) IBOutlet NSTextField *casella; + +- (IBAction) calcolaRisultato: (id) sender; +- (IBAction) cancellaCasella: (id) sender; +- (IBAction) inviaCifra: (id) sender; +- (IBAction) inviaOperazione: (id) sender; + +@end diff --git a/Calcolatrice/Normale.m b/Calcolatrice/Normale.m new file mode 100644 index 0000000..74a1210 --- /dev/null +++ b/Calcolatrice/Normale.m @@ -0,0 +1,62 @@ +#import "Normale.h" + +@implementation Normale + +@synthesize casella; + +- (IBAction) calcolaRisultato: (id)sender +{ + NSNumber *risultato; + NSString *risultatoInStringa; + numero2 = @([[casella stringValue] doubleValue]); + [self cancellaCasella:0]; + switch (operazioneCorrente) { + case 1:{ + risultato = @([numero1 doubleValue] / [numero2 doubleValue]); + break; + } + case 2:{ + risultato = @([numero1 doubleValue] * [numero2 doubleValue]); + break; + } + case 3:{ + risultato = @([numero1 doubleValue] - [numero2 doubleValue]); + break; + } + case 4:{ + risultato = @([numero1 doubleValue] + [numero2 doubleValue]); + break; + } + } + if(fmod([risultato doubleValue],1) == 0) + risultatoInStringa = [NSString stringWithFormat:@"%d", [risultato intValue]]; + else + risultatoInStringa = [NSString stringWithFormat:@"%f", [risultato doubleValue]]; + [casella setStringValue: risultatoInStringa]; +} + +- (IBAction) cancellaCasella: (id)sender +{ + [casella setStringValue: @"0"]; +} + +- (IBAction) inviaCifra: (id)sender +{ + if([sender tag] == 10) + [casella setStringValue: [[casella stringValue] stringByAppendingFormat:@"."]]; + else + [casella setStringValue: [[casella stringValue] stringByAppendingFormat:@"%ld", [sender tag]]]; + if([[casella stringValue] characterAtIndex:0] == '0' && isdigit([[casella stringValue] characterAtIndex:1])) + [casella setStringValue: [[casella stringValue] substringFromIndex:1]]; + +} + +- (IBAction) inviaOperazione: (id)sender +{ + numero1 = @([[casella stringValue] doubleValue]); + [casella setStringValue: @"0"]; + [self cancellaCasella:0]; + operazioneCorrente = [sender tag]; +} + +@end diff --git a/Calcolatrice/Scientifica.h b/Calcolatrice/Scientifica.h new file mode 100644 index 0000000..a7f3892 --- /dev/null +++ b/Calcolatrice/Scientifica.h @@ -0,0 +1,10 @@ +#import +#import "Normale.h" + +@interface Scientifica : Normale + +- (IBAction)operazioneScientifica:(id)sender; +- (IBAction)inviaCostante:(id)sender; +- (long) fattoriale: (int) n; + +@end diff --git a/Calcolatrice/Scientifica.m b/Calcolatrice/Scientifica.m new file mode 100644 index 0000000..d50d727 --- /dev/null +++ b/Calcolatrice/Scientifica.m @@ -0,0 +1,127 @@ +#import "Scientifica.h" +#import + +@implementation Scientifica + +@synthesize casella; + +- (IBAction) operazioneScientifica: (id) sender +{ + NSNumber *numero, *risultato; + NSString *risultatoInStringa; + numero = @([[casella stringValue] doubleValue]); + switch([sender tag]){ + case 0:{ + risultato = @(pow([numero doubleValue],2)); + break; + } + case 1:{ + risultato = @(pow([numero doubleValue],3)); + break; + } + case 2:{ + risultato = @(cos([numero doubleValue])); + break; + } + case 3:{ + risultato = @(sin([numero doubleValue])); + break; + } + case 4:{ + risultato = @(tan([numero doubleValue])); + break; + } + case 5:{ + risultato = @(1/[numero doubleValue]); + break; + } + case 6:{ + risultato = @(sqrt([numero doubleValue])); + break; + } + case 7:{ + risultato = @(cbrt([numero doubleValue])); + break; + } + case 8:{ + risultato = @(exp([numero doubleValue])); + break; + } + case 9:{ + risultato = @(log2([numero doubleValue])); + break; + } + case 10:{ + risultato = @(log10([numero doubleValue])); + break; + } + case 11:{ + risultato = @(log([numero doubleValue])); + break; + } + case 12:{ + risultato = @([self fattoriale: [numero doubleValue]]); + break; + } + } + if(fmod([risultato doubleValue],1) == 0) + risultatoInStringa = [NSString stringWithFormat:@"%d", [risultato intValue]]; + else + risultatoInStringa = [NSString stringWithFormat:@"%f", [risultato doubleValue]]; + [casella setStringValue: risultatoInStringa]; +} + +- (IBAction) calcolaRisultato:(id)sender +{ + NSNumber *risultato; + NSString *risultatoInStringa; + numero2 = @([[casella stringValue] doubleValue]); + [self cancellaCasella:0]; + switch (operazioneCorrente) { + case 1:{ + risultato = @([numero1 doubleValue] / [numero2 doubleValue]); + break; + } + case 2:{ + risultato = @([numero1 doubleValue] * [numero2 doubleValue]); + break; + } + case 3:{ + risultato = @([numero1 doubleValue] - [numero2 doubleValue]); + break; + } + case 4:{ + risultato = @([numero1 doubleValue] + [numero2 doubleValue]); + break; + } + case 5:{ + risultato = @(pow([numero1 doubleValue], [numero2 doubleValue])); + break; + } + } + if(fmod([risultato doubleValue],1) == 0) + risultatoInStringa = [NSString stringWithFormat:@"%d", [risultato intValue]]; + else + risultatoInStringa = [NSString stringWithFormat:@"%f", [risultato doubleValue]]; + [casella setStringValue: risultatoInStringa]; + +} + +- (IBAction) inviaCostante: (id) sender +{ + if([sender tag] == 0) + [casella setStringValue: [NSString stringWithFormat:@"%lf", M_PI]]; + else + [casella setStringValue: [NSString stringWithFormat:@"%lf", M_E]]; + +} + +- (long) fattoriale: (int) n +{ + if (n <= 1) + return 1; + else + return n * [self fattoriale: n-1]; +} + +@end diff --git a/Calcolatrice/it.lproj/.DS_Store b/Calcolatrice/it.lproj/.DS_Store new file mode 100644 index 0000000..f735cd0 Binary files /dev/null and b/Calcolatrice/it.lproj/.DS_Store differ diff --git a/Calcolatrice/it.lproj/Calcolatrice.xib b/Calcolatrice/it.lproj/Calcolatrice.xib new file mode 100644 index 0000000..264eb3f --- /dev/null +++ b/Calcolatrice/it.lproj/Calcolatrice.xib @@ -0,0 +1,889 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Calcolatrice/it.lproj/InfoPlist.strings b/Calcolatrice/it.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Calcolatrice/it.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Calcolatrice/main.m b/Calcolatrice/main.m new file mode 100644 index 0000000..f4866fa --- /dev/null +++ b/Calcolatrice/main.m @@ -0,0 +1,6 @@ +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/License.txt b/License.txt new file mode 100644 index 0000000..fd55ebe --- /dev/null +++ b/License.txt @@ -0,0 +1,10 @@ + * Calcolatrice + * + * Calcolatrice standard e scientifica in Obj-c/Cocoa. + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * @author Michele Guerini Rocco aka Rnhmjoj + * @since 2012 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..820731a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +Calcolatrice +============ + +Calcolatrice standard e scientifica in Obj-c/Cocoa +-------------------------------------------------- + +### Informazioni +Una semplice calcolatrice. +Primo tentativo di applicazione in Cocoa.