diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 9950777..7c37989 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -2,18 +2,24 @@ 1050 - 10F569 - 823 - 1038.29 - 461.00 + 11E52 + 2182 + 1138.47 + 569.00 com.apple.InterfaceBuilder.CocoaPlugin - 823 + 2182 - + YES - - + NSView + NSMenu + NSWindowTemplate + NSMenuItem + NSTextField + NSTextFieldCell + NSCustomView + NSCustomObject YES @@ -1117,7 +1123,7 @@ Window NSWindow - {3.40282e+38, 3.40282e+38} + 256 @@ -1128,6 +1134,8 @@ 268 {{129, 99}, {93, 28}} + + TMSliderControl @@ -1135,6 +1143,7 @@ 268 {{145, 54}, {55, 18}} + TMSliderControlSmall @@ -1142,6 +1151,8 @@ 268 {{78, 103}, {38, 22}} + + YES 67239424 @@ -1159,7 +1170,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -1178,6 +1189,8 @@ 268 {{233, 103}, {34, 22}} + + YES 67239424 @@ -1192,9 +1205,12 @@ {345, 177} + + - {{0, 0}, {1440, 878}} - {3.40282e+38, 3.40282e+38} + {{0, 0}, {1680, 1028}} + {10000000000000, 10000000000000} + YES NSFontManager @@ -1206,6 +1222,22 @@ YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + performMiniaturize: @@ -1246,14 +1278,6 @@ 127 - - - orderFrontStandardAboutPanel: - - - - 142 - performClose: @@ -1502,46 +1526,6 @@ 374 - - - addFontTrait: - - - - 421 - - - - addFontTrait: - - - - 422 - - - - modifyFont: - - - - 423 - - - - orderFrontFontPanel: - - - - 424 - - - - modifyFont: - - - - 425 - raiseBaseline: @@ -1728,43 +1712,43 @@ - terminate: - - + addFontTrait: + + - 449 + 421 - - textColor: onColor - - - - - - textColor: onColor - textColor - onColor - 2 - + + addFontTrait: + + - 461 + 422 - - textColor: offColor - - - - - - textColor: offColor - textColor - offColor - 2 - + + modifyFont: + + - 462 + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 @@ -1776,19 +1760,51 @@ - sliderChanged: + smallSliderChanged: - + - 464 + 467 - smallSliderChanged: + sliderChanged: - + - 467 + 468 + + + + textColor: offColor + + + + + + textColor: offColor + textColor + offColor + 2 + + + 462 + + + + textColor: onColor + + + + + + textColor: onColor + textColor + onColor + 2 + + + 461 @@ -2742,145 +2758,74 @@ YES YES + -1.IBPluginDependency + -2.IBPluginDependency -3.IBPluginDependency 103.IBPluginDependency - 103.ImportedFromIB2 106.IBPluginDependency - 106.ImportedFromIB2 - 106.editorWindowContentRectSynchronizationRect 111.IBPluginDependency - 111.ImportedFromIB2 112.IBPluginDependency - 112.ImportedFromIB2 124.IBPluginDependency - 124.ImportedFromIB2 125.IBPluginDependency - 125.ImportedFromIB2 - 125.editorWindowContentRectSynchronizationRect 126.IBPluginDependency - 126.ImportedFromIB2 129.IBPluginDependency - 129.ImportedFromIB2 130.IBPluginDependency - 130.ImportedFromIB2 - 130.editorWindowContentRectSynchronizationRect 131.IBPluginDependency - 131.ImportedFromIB2 134.IBPluginDependency - 134.ImportedFromIB2 136.IBPluginDependency - 136.ImportedFromIB2 143.IBPluginDependency - 143.ImportedFromIB2 144.IBPluginDependency - 144.ImportedFromIB2 145.IBPluginDependency - 145.ImportedFromIB2 149.IBPluginDependency - 149.ImportedFromIB2 150.IBPluginDependency - 150.ImportedFromIB2 19.IBPluginDependency - 19.ImportedFromIB2 195.IBPluginDependency - 195.ImportedFromIB2 196.IBPluginDependency - 196.ImportedFromIB2 197.IBPluginDependency - 197.ImportedFromIB2 198.IBPluginDependency - 198.ImportedFromIB2 199.IBPluginDependency - 199.ImportedFromIB2 200.IBPluginDependency - 200.ImportedFromIB2 - 200.editorWindowContentRectSynchronizationRect 201.IBPluginDependency - 201.ImportedFromIB2 202.IBPluginDependency - 202.ImportedFromIB2 203.IBPluginDependency - 203.ImportedFromIB2 204.IBPluginDependency - 204.ImportedFromIB2 205.IBPluginDependency - 205.ImportedFromIB2 - 205.editorWindowContentRectSynchronizationRect 206.IBPluginDependency - 206.ImportedFromIB2 207.IBPluginDependency - 207.ImportedFromIB2 208.IBPluginDependency - 208.ImportedFromIB2 209.IBPluginDependency - 209.ImportedFromIB2 210.IBPluginDependency - 210.ImportedFromIB2 211.IBPluginDependency - 211.ImportedFromIB2 212.IBPluginDependency - 212.ImportedFromIB2 - 212.editorWindowContentRectSynchronizationRect 213.IBPluginDependency - 213.ImportedFromIB2 214.IBPluginDependency - 214.ImportedFromIB2 215.IBPluginDependency - 215.ImportedFromIB2 216.IBPluginDependency - 216.ImportedFromIB2 217.IBPluginDependency - 217.ImportedFromIB2 218.IBPluginDependency - 218.ImportedFromIB2 219.IBPluginDependency - 219.ImportedFromIB2 220.IBPluginDependency - 220.ImportedFromIB2 - 220.editorWindowContentRectSynchronizationRect 221.IBPluginDependency - 221.ImportedFromIB2 23.IBPluginDependency - 23.ImportedFromIB2 236.IBPluginDependency - 236.ImportedFromIB2 239.IBPluginDependency - 239.ImportedFromIB2 24.IBPluginDependency - 24.ImportedFromIB2 - 24.editorWindowContentRectSynchronizationRect - 29.IBEditorWindowLastContentRect 29.IBPluginDependency - 29.ImportedFromIB2 - 29.WindowOrigin - 29.editorWindowContentRectSynchronizationRect 295.IBPluginDependency 296.IBPluginDependency - 296.editorWindowContentRectSynchronizationRect 297.IBPluginDependency 298.IBPluginDependency 346.IBPluginDependency - 346.ImportedFromIB2 348.IBPluginDependency - 348.ImportedFromIB2 349.IBPluginDependency - 349.ImportedFromIB2 - 349.editorWindowContentRectSynchronizationRect 350.IBPluginDependency - 350.ImportedFromIB2 351.IBPluginDependency - 351.ImportedFromIB2 354.IBPluginDependency - 354.ImportedFromIB2 - 371.IBEditorWindowLastContentRect 371.IBPluginDependency 371.IBWindowTemplateEditedContentRect 371.NSWindowTemplate.visibleAtLaunch - 371.editorWindowContentRectSynchronizationRect - 371.windowTemplate.maxSize 372.IBPluginDependency 375.IBPluginDependency - 376.IBEditorWindowLastContentRect 376.IBPluginDependency 377.IBPluginDependency 378.IBPluginDependency @@ -2893,7 +2838,6 @@ 385.IBPluginDependency 386.IBPluginDependency 387.IBPluginDependency - 388.IBEditorWindowLastContentRect 388.IBPluginDependency 389.IBPluginDependency 390.IBPluginDependency @@ -2926,190 +2870,101 @@ 417.IBPluginDependency 418.IBPluginDependency 419.IBPluginDependency + 420.IBPluginDependency + 450.IBPluginDependency 451.IBPluginDependency - 451.IBViewBoundsToFrameTransform 452.IBPluginDependency 453.IBPluginDependency 454.IBPluginDependency 455.IBPluginDependency 465.IBPluginDependency 5.IBPluginDependency - 5.ImportedFromIB2 56.IBPluginDependency - 56.ImportedFromIB2 - 57.IBEditorWindowLastContentRect 57.IBPluginDependency - 57.ImportedFromIB2 - 57.editorWindowContentRectSynchronizationRect 58.IBPluginDependency - 58.ImportedFromIB2 72.IBPluginDependency - 72.ImportedFromIB2 73.IBPluginDependency - 73.ImportedFromIB2 74.IBPluginDependency - 74.ImportedFromIB2 75.IBPluginDependency - 75.ImportedFromIB2 77.IBPluginDependency - 77.ImportedFromIB2 78.IBPluginDependency - 78.ImportedFromIB2 79.IBPluginDependency - 79.ImportedFromIB2 80.IBPluginDependency - 80.ImportedFromIB2 81.IBPluginDependency - 81.ImportedFromIB2 - 81.editorWindowContentRectSynchronizationRect 82.IBPluginDependency - 82.ImportedFromIB2 83.IBPluginDependency - 83.ImportedFromIB2 92.IBPluginDependency - 92.ImportedFromIB2 - + YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{596, 852}, {216, 23}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{522, 812}, {146, 23}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{436, 809}, {64, 6}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {275, 83}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{187, 434}, {243, 243}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {167, 43}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {241, 103}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{525, 802}, {197, 73}} - {{384, 285}, {478, 20}} com.apple.InterfaceBuilder.CocoaPlugin - - {74, 862} - {{6, 978}, {478, 20}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {215, 63}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{517, 443}, {345, 177}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{517, 443}, {345, 177}} - {{33, 99}, {480, 360}} - {3.40282e+38, 3.40282e+38} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{437, 242}, {86, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3122,7 +2977,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{523, 2}, {178, 283}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3156,68 +3010,44 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - AUMBAABCxgAAA - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{396, 102}, {242, 183}} com.apple.InterfaceBuilder.CocoaPlugin - - {{23, 794}, {245, 183}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{145, 474}, {199, 203}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES - - YES - + - 467 + 468 @@ -3232,7 +3062,7 @@ sliderChanged: smallSliderChanged: - + YES id id @@ -3245,7 +3075,7 @@ sliderChanged: smallSliderChanged: - + YES sliderChanged: @@ -3264,7 +3094,7 @@ sliderControl smallSliderControl - + YES TMSliderControl TMSliderControlSmall @@ -3277,7 +3107,7 @@ sliderControl smallSliderControl - + YES sliderControl @@ -3291,26 +3121,15 @@ IBProjectSource - AppController.h + ./Classes/AppController.h TMSliderControl NSControl - - target - id - - - target - - target - id - - IBProjectSource - TMSliderControl.h + ./Classes/TMSliderControl.h @@ -3318,600 +3137,7 @@ TMSliderControl IBProjectSource - TMSliderControlSmall.h - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSBrowser - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSBrowser.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSDocument - NSObject - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentScripting.h - - - - NSDocumentController - NSObject - - YES - - YES - clearRecentDocuments: - newDocument: - openDocument: - saveAllDocuments: - - - YES - id - id - id - id - - - - YES - - YES - clearRecentDocuments: - newDocument: - openDocument: - saveAllDocuments: - - - YES - - clearRecentDocuments: - id - - - newDocument: - id - - - openDocument: - id - - - saveAllDocuments: - id - - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentController.h - - - - NSFontManager - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMatrix - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSMatrix.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSMovieView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMovieView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTableView - NSControl - - - - NSText - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSText.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSTextView - NSText - - IBFrameworkSource - AppKit.framework/Headers/NSTextView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h + ./Classes/TMSliderControlSmall.h @@ -3922,16 +3148,11 @@ com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES - ../TMSliderControl.xcodeproj 3 YES @@ -3940,10 +3161,10 @@ NSMenuCheckmark NSMenuMixedState - + YES - {9, 8} - {7, 2} + {11, 11} + {10, 3} diff --git a/OverlayMask@2x.png b/OverlayMask@2x.png new file mode 100644 index 0000000..2014747 Binary files /dev/null and b/OverlayMask@2x.png differ diff --git a/SliderHandle@2x.png b/SliderHandle@2x.png new file mode 100644 index 0000000..72639e3 Binary files /dev/null and b/SliderHandle@2x.png differ diff --git a/SliderHandleDown@2x.png b/SliderHandleDown@2x.png new file mode 100644 index 0000000..26c8891 Binary files /dev/null and b/SliderHandleDown@2x.png differ diff --git a/SliderWell@2x.png b/SliderWell@2x.png new file mode 100644 index 0000000..89001be Binary files /dev/null and b/SliderWell@2x.png differ diff --git a/SmallSliderHandle@2x.png b/SmallSliderHandle@2x.png new file mode 100644 index 0000000..312aac1 Binary files /dev/null and b/SmallSliderHandle@2x.png differ diff --git a/SmallSliderHandleDown@2x.png b/SmallSliderHandleDown@2x.png new file mode 100644 index 0000000..372695b Binary files /dev/null and b/SmallSliderHandleDown@2x.png differ diff --git a/SmallSliderWellOff@2x.png b/SmallSliderWellOff@2x.png new file mode 100644 index 0000000..7abb6a8 Binary files /dev/null and b/SmallSliderWellOff@2x.png differ diff --git a/SmallSliderWellOn@2x.png b/SmallSliderWellOn@2x.png new file mode 100644 index 0000000..debc9fe Binary files /dev/null and b/SmallSliderWellOn@2x.png differ diff --git a/TMSliderControl.h b/TMSliderControl.h index 4615e03..2015771 100644 --- a/TMSliderControl.h +++ b/TMSliderControl.h @@ -8,49 +8,64 @@ #import -typedef enum +typedef NS_ENUM(unsigned int, TMSliderControlState) { kTMSliderControlState_Inactive = 0, kTMSliderControlState_Active = 1 -}TMSliderControlState; +}; @class TMSliderControlHandle; -@interface TMSliderControl : NSControl { - NSImage *sliderWell; - NSImage *overlayMask; - NSImage *sliderHandle; - NSImage *sliderHandleDown; - TMSliderControlHandle *sliderHandleView; +@interface TMSliderControl : NSView { // drawing - NSRect handleControlRect; - NSRect handleControlRectOn; - NSRect handleControlRectOff; - NSPoint mouseDownPosition; + CGRect handleControlRectOn; + CGRect handleControlRectOff; + CGPoint mouseDownPosition; // state - TMSliderControlState controlState; BOOL hasDragged; - BOOL state; + + id observedObjectForState; + NSString *observedKeyPathForState; - id target; - SEL action; + id observedObjectForEnabled; + NSString *observedKeyPathForEnabled; } +- (void)updateUI; + // events - (void)mouseDown:(NSEvent*)theEvent; - (void)mouseDragged:(NSEvent*)theEvent; - (void)mouseUp:(NSEvent*)theEvent; -- (BOOL)state; -- (void)setState:(BOOL)newState; +- (IBAction)moveLeft:(id)sender; +- (IBAction)moveRight:(id)sender; + +- (void)layoutHandle; +@property (nonatomic, readonly) CGFloat disabledOpacity; + +@property (nonatomic, strong) CALayer *sliderWell; +@property (nonatomic, strong) CALayer *overlayMask; +@property (nonatomic, strong) NSImage *sliderHandleImage; +@property (nonatomic, strong) NSImage *sliderHandleDownImage; +@property (nonatomic, strong) CALayer *sliderHandle; + +@property (nonatomic, assign) BOOL enabled; +@property (nonatomic, assign) BOOL state; +@property (nonatomic, unsafe_unretained) id target; +@property (nonatomic, assign) SEL action; + +@property (nonatomic, strong) id observedObjectForState; +@property (nonatomic, copy) NSString *observedKeyPathForState; + +@property (nonatomic, strong) id observedObjectForEnabled; +@property (nonatomic, copy) NSString *observedKeyPathForEnabled; -- (void)setTarget:(id)anObject; -- (id)target; -- (void)setAction:(SEL)aSelector; -- (SEL)action; +@property (nonatomic, strong) NSString *purposeDescription; +@property (nonatomic, strong) NSString *accessibilityText; @end diff --git a/TMSliderControl.m b/TMSliderControl.m index f5d3084..42608cd 100644 --- a/TMSliderControl.m +++ b/TMSliderControl.m @@ -7,248 +7,357 @@ // #import "TMSliderControl.h" +#import -/* - * Basic NSImageView subclass for handle - */ +static void *StateObservationContext = (void *)2091; +static void *EnabledObservationContext = (void *)2092; -@interface TMSliderControlHandle : NSImageView { -} -@end -@implementation TMSliderControlHandle -- (void)mouseDown:(NSEvent *)theEvent { [[self superview] mouseDown:theEvent]; } -- (void)mouseDragged:(NSEvent*)theEvent { [[self superview] mouseDragged:theEvent]; } -- (void)mouseUp:(NSEvent*)theEvent { [[self superview] mouseUp:theEvent]; } -@end +@implementation TMSliderControl -/* - * Private control methods - */ +//bindings support +@synthesize observedObjectForState; +@synthesize observedKeyPathForState; +@synthesize observedObjectForEnabled; +@synthesize observedKeyPathForEnabled; -@interface TMSliderControl (Private) -- (void)drawBacking; -- (void)drawOverlay; -- (void)drawHandle; -@end -@implementation TMSliderControl (Private) ++ (void)initialize +{ + if (self != [TMSliderControl class]) + return; + + [NSObject exposeBinding:@"state"]; + [NSObject exposeBinding:@"enabled"]; +} -- (void)drawBacking +- (Class)valueClassForBinding:(NSString *)binding { - [sliderWell drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; + // both require numbers + return [NSNumber class]; } -- (void)drawOverlay ++ (NSImage*)sliderWellOn { - [overlayMask drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; + return [NSImage imageNamed:@"SliderWell"]; } -- (void)drawHandle ++ (NSImage*)sliderWellOff { - NSImage *sliderImage; - if (controlState == kTMSliderControlState_Active) - { - sliderImage = sliderHandleDown; - } - else - { - sliderImage = sliderHandle; - } - [sliderHandleView setImage: sliderImage]; + return [NSImage imageNamed:@"SliderWell"]; } -- (void)layoutHandle ++ (NSImage*)sliderHandleImage { - handleControlRectOff = NSMakeRect(-2,1, 44, 27); - handleControlRectOn = NSMakeRect([self bounds].size.width - 42,1, 44, 27); - handleControlRect = handleControlRectOff; + return [NSImage imageNamed:@"SliderHandle"]; } -@end ++ (NSImage*)sliderHandleDownImage +{ + return [NSImage imageNamed:@"SliderHandleDown"]; +} -@implementation TMSliderControl ++ (NSImage*)overlayMask +{ + return [NSImage imageNamed:@"OverlayMask"]; +} -- (id)initWithFrame:(NSRect)frame { - self = [super initWithFrame:frame]; - if (self) { +- (instancetype)initWithFrame:(NSRect)frame { + if ((self = [super initWithFrame:frame])) { // Initialization code here. - sliderWell = [[NSImage imageNamed:@"SliderWell"] retain]; - overlayMask = [[NSImage imageNamed:@"OverlayMask"] retain]; - sliderHandle = [[NSImage imageNamed:@"SliderHandle"] retain]; - sliderHandleDown = [[NSImage imageNamed:@"SliderHandleDown"] retain]; [self layoutHandle]; - sliderHandleView = [[TMSliderControlHandle alloc] initWithFrame: handleControlRectOff]; - [sliderHandleView setWantsLayer: YES]; - [self addSubview: sliderHandleView]; - state = NO; - //[self setWantsLayer:YES]; + + self.state = kTMSliderControlState_Inactive; + self.enabled = YES; + + self.sliderHandleImage = [[self class] sliderHandleImage]; + self.sliderHandleDownImage = [[self class] sliderHandleDownImage]; + + [self setLayer:[CALayer layer]]; + [self setWantsLayer:YES]; + + CALayer *mask = [CALayer layer]; + mask.frame = self.bounds; + mask.contents = [[self class] sliderWellOff]; + + self.sliderWell = [CALayer layer]; + _sliderWell.frame = self.bounds; + _sliderWell.contents = [[self class] sliderWellOff]; + _sliderWell.mask = mask; + [self.layer addSublayer:_sliderWell]; + + self.sliderHandle = [CALayer layer]; + _sliderHandle.frame = handleControlRectOff; + _sliderHandle.contents = _sliderHandleImage; + [_sliderWell addSublayer:_sliderHandle]; + + self.overlayMask = [CALayer layer]; + _overlayMask.frame = self.bounds; + _overlayMask.contents = [[self class] overlayMask]; + [self.layer addSublayer:_overlayMask]; } return self; } - (void)dealloc +{ + [self unbind:@"state"]; + [self unbind:@"enabled"]; + + + +} + +- (void)updateUI { - [sliderWell release]; - [overlayMask release]; - [sliderHandle release]; - [sliderHandleDown release]; - [sliderHandleView release]; - [super dealloc]; + CGFloat newXPosition = (self.state == kTMSliderControlState_Active ? CGRectGetMidX(handleControlRectOn) : CGRectGetMidX(handleControlRectOff)); + + CGPoint sliderPosition = _sliderHandle.position; + sliderPosition.x = newXPosition; + + _sliderHandle.position = sliderPosition; + self.layer.opacity = (float)(self.enabled ? 1.0f : [self disabledOpacity]); } -- (void)awakeFromNib +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - [self setWantsLayer:YES]; + if(context == StateObservationContext) + { + NSNumber *value = [observedObjectForState valueForKey:observedKeyPathForState]; + if(value) + [self setValue:value forKey:@"state"]; + } + if(context == EnabledObservationContext) + { + NSNumber *value = [observedObjectForEnabled valueForKey:observedKeyPathForEnabled]; + if(value) + [self setValue:value forKey:@"enabled"]; + } + [self updateUI]; } -- (void)drawRect:(NSRect)rect { - [self drawBacking]; - [self drawHandle]; - [self drawOverlay]; +- (CGFloat)minimumMovement +{ + return 10.0f; } - (BOOL)acceptsFirstResponder { - return YES; + return [NSApp isFullKeyboardAccessEnabled]; +} + +- (BOOL)canBecomeKeyView +{ + return [NSApp isFullKeyboardAccessEnabled]; +} + +- (NSRect)focusRingMaskBounds +{ + return [self bounds]; +} + +- (void)drawFocusRingMask +{ + [self.layer renderInContext:[[NSGraphicsContext currentContext] graphicsPort]]; } - (void)mouseDown:(NSEvent*)theEvent { - NSPoint mousePoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - hasDragged = NO; - // down on the position control rect - if(NSPointInRect(mousePoint,handleControlRect)) - { - controlState = kTMSliderControlState_Active; - mouseDownPosition = NSMakePoint(mousePoint.x - handleControlRect.origin.x, 0); - [self setNeedsDisplay:YES]; - } + if(self.enabled) + { + CGPoint mousePoint = NSPointToCGPoint([self convertPoint:[theEvent locationInWindow] fromView:nil]); + hasDragged = NO; + // down on the position control rect + if(CGRectContainsPoint(_sliderHandle.frame, mousePoint)) + { + mouseDownPosition = CGPointMake(mousePoint.x - _sliderHandle.position.x, 0); + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + _sliderHandle.contents = _sliderHandleDownImage; + [CATransaction commit]; + } + } } - (void)mouseDragged:(NSEvent*)theEvent { - NSPoint mousePoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - hasDragged = YES; - - // dragging the position control rect - if(controlState == kTMSliderControlState_Active) + if(self.enabled) { + NSPoint mousePoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + hasDragged = YES; + // center the rect around the mouse point - float newXPosition = mousePoint.x - mouseDownPosition.x; + CGFloat newXPosition = mousePoint.x - mouseDownPosition.x; // clamp the position . - if (newXPosition < handleControlRectOff.origin.x) - newXPosition = handleControlRectOff.origin.x; - if (newXPosition > handleControlRectOn.origin.x) - newXPosition = handleControlRectOn.origin.x; + if (newXPosition < CGRectGetMidX(handleControlRectOff)) + newXPosition = CGRectGetMidX(handleControlRectOff); + if (newXPosition > CGRectGetMidX(handleControlRectOn)) + newXPosition = CGRectGetMidX(handleControlRectOn); - handleControlRect.origin.x = newXPosition; - [sliderHandleView setFrame: handleControlRect]; - [self setNeedsDisplay:YES]; + CGPoint sliderPosition = _sliderHandle.position; + sliderPosition.x = newXPosition; + + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + _sliderHandle.position = sliderPosition; + [CATransaction commit]; } } - (void)mouseUp:(NSEvent*)theEvent { - float minimumMovement = 10.0; - if(controlState != kTMSliderControlState_Inactive) - { - // switch the state to inactive and redraw - controlState = kTMSliderControlState_Inactive; - if (!hasDragged) - { - // if they never dragged, but clicked/released in place on the handle, flip it over. - [self setState:![self state]]; - } - else if (state == NSOffState) + if(self.enabled) + { + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + _sliderHandle.contents = _sliderHandleImage; + [CATransaction commit]; + + CGFloat minimumMovement = [self minimumMovement]; + if(hasDragged && _state != kTMSliderControlState_Inactive) { - if (handleControlRect.origin.x > minimumMovement) + if (_sliderHandle.frame.origin.x < [self bounds].size.width - _sliderHandle.frame.size.width - minimumMovement) { // moved it enough to set it - [self setState: NSOnState]; - } + self.state = kTMSliderControlState_Inactive; + if (observedObjectForState) + { + [observedObjectForState setValue: @(_state) + forKeyPath: observedKeyPathForState]; + } + } else { // put it back where it was. - [self setState: NSOffState]; + self.state = kTMSliderControlState_Active; + if (observedObjectForState) + { + [observedObjectForState setValue: @(_state) + forKeyPath: observedKeyPathForState]; + } } } else { - if (handleControlRect.origin.x < [self bounds].size.width - handleControlRect.size.width - minimumMovement) + self.state = !self.state; + if (observedObjectForState) { - // moved it enough to set it - [self setState: NSOffState]; - } - else - { - // put it back where it was. - [self setState: NSOnState]; + [observedObjectForState setValue: @(_state) + forKeyPath: observedKeyPathForState]; } } + [self updateUI]; - } - else - { - [self setState:![self state]]; + if(_target && [_target respondsToSelector:_action]) + [_target performSelector:_action withObject:self]; + hasDragged = NO; } } +- (void)layoutHandle +{ + handleControlRectOff = CGRectMake(-2,1, 44, 27); + handleControlRectOn = CGRectMake([self bounds].size.width - handleControlRectOff.size.width + 2,1, 44, 27); +} + +- (IBAction)moveLeft:(id)sender +{ + self.state = NO; +} + +- (IBAction)moveRight:(id)sender +{ + self.state = YES; +} -- (BOOL)state +- (CGFloat)disabledOpacity { - return state; + return 0.25; } -- (void)setState:(NSInteger)newState +- (void)drawRect:(NSRect)dirtyRect { - [super setState:newState]; - if ([self state] == NSOffState) + [super drawRect:[self bounds]]; +} + +#pragma mark Bindings Support + +- (void)bind:(NSString *)binding toObject:(id)observable withKeyPath:(NSString *)keyPath options:(NSDictionary *)options +{ + if([binding isEqualToString:@"state"]) { - handleControlRect = handleControlRectOff; + [observable addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:StateObservationContext]; + + [self setObservedObjectForState:observable]; + [self setObservedKeyPathForState:keyPath]; } - else + else if ([binding isEqualToString:@"enabled"]) { - handleControlRect = handleControlRectOn; + [observable addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:EnabledObservationContext]; + + [self setObservedObjectForEnabled:observable]; + [self setObservedKeyPathForEnabled:keyPath]; } - - if ([sliderHandleView window]) + + [super bind:binding toObject:observable withKeyPath:keyPath options:options]; + [self updateUI]; +} + +- (void)unbind:bindingName +{ + if ([bindingName isEqualToString:@"state"]) { - // It's in a window, we can use CoreAnimation - [NSAnimationContext beginGrouping]; - [[NSAnimationContext currentContext] setDuration: 0.15]; - [[sliderHandleView animator] setFrameOrigin: handleControlRect.origin]; - [NSAnimationContext endGrouping]; - } - else { - // It's not in a window, just set it. - [sliderHandleView setFrameOrigin:handleControlRect.origin]; + [observedObjectForState removeObserver:self + forKeyPath:observedKeyPathForState]; + [self setObservedObjectForState:nil]; + [self setObservedKeyPathForState:nil]; + } + if ([bindingName isEqualToString:@"enabled"]) + { + [observedObjectForEnabled removeObserver:self + forKeyPath:observedKeyPathForEnabled]; + [self setObservedObjectForEnabled:nil]; + [self setObservedKeyPathForEnabled:nil]; } - - [self sendAction:[self action] to:[self target]]; - [self setNeedsDisplay: YES]; + [super unbind:bindingName]; + [self updateUI]; } +#pragma mark - -- (void)setTarget:(id)anObject +- (void)setState:(BOOL)state { - target = anObject; + if (_state != state) + { + _state = state; + NSAccessibilityPostNotification(self, NSAccessibilityValueChangedNotification); + } } -- (id)target + +#pragma mark - Accessibility + +- (id)accessibilityValue { - return target; + return [NSNumber numberWithBool:self.state]; } -- (void)setAction:(SEL)aSelector + +- (id)accessibilityLabel { - action = aSelector; + if (self.accessibilityText) { + return self.accessibilityText; + } + + return NSLocalizedStringWithDefaultValue(@"LOCALIZED_SWITCH_LABEL", @"Localizable", [NSBundle mainBundle], @"switch", @"switch label when no accessibility text is set");; } -- (SEL)action + +- (BOOL)accessibilityPerformPress { - return action; + self.state = !self.state; + [self updateUI]; + return YES; } - @end diff --git a/TMSliderControl.xcodeproj/project.pbxproj b/TMSliderControl.xcodeproj/project.pbxproj index 892adad..be9ffcc 100644 --- a/TMSliderControl.xcodeproj/project.pbxproj +++ b/TMSliderControl.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; - 5F8F327712BE9303009B2446 /* TMSliderControlSmall.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F8F327612BE9303009B2446 /* TMSliderControlSmall.m */; }; 5F8F327D12BE951C009B2446 /* SmallSliderHandle.png in Resources */ = {isa = PBXBuildFile; fileRef = 5F8F327912BE951C009B2446 /* SmallSliderHandle.png */; }; 5F8F327E12BE951C009B2446 /* SmallSliderHandleDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 5F8F327A12BE951C009B2446 /* SmallSliderHandleDown.png */; }; 5F8F327F12BE951C009B2446 /* SmallSliderWellOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 5F8F327B12BE951C009B2446 /* SmallSliderWellOff.png */; }; @@ -22,6 +21,16 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 938A6C0F154F47A6007FC919 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 938A6C0E154F47A6007FC919 /* QuartzCore.framework */; }; + 938A6C10154F48A0007FC919 /* TMSliderControlSmall.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F8F327612BE9303009B2446 /* TMSliderControlSmall.m */; }; + 93F216EE15E5BB7500343EB1 /* OverlayMask@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216E615E5BB7500343EB1 /* OverlayMask@2x.png */; }; + 93F216EF15E5BB7500343EB1 /* SliderHandle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216E715E5BB7500343EB1 /* SliderHandle@2x.png */; }; + 93F216F015E5BB7500343EB1 /* SliderHandleDown@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216E815E5BB7500343EB1 /* SliderHandleDown@2x.png */; }; + 93F216F115E5BB7500343EB1 /* SliderWell@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216E915E5BB7500343EB1 /* SliderWell@2x.png */; }; + 93F216F215E5BB7500343EB1 /* SmallSliderHandle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216EA15E5BB7500343EB1 /* SmallSliderHandle@2x.png */; }; + 93F216F315E5BB7500343EB1 /* SmallSliderHandleDown@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216EB15E5BB7500343EB1 /* SmallSliderHandleDown@2x.png */; }; + 93F216F415E5BB7500343EB1 /* SmallSliderWellOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216EC15E5BB7500343EB1 /* SmallSliderWellOff@2x.png */; }; + 93F216F515E5BB7500343EB1 /* SmallSliderWellOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93F216ED15E5BB7500343EB1 /* SmallSliderWellOn@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -49,6 +58,15 @@ 5F9409290F3656C900317331 /* OverlayMask.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = OverlayMask.png; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* TMSliderControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TMSliderControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 938A6C0E154F47A6007FC919 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = ../../../../../../../System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; + 93F216E615E5BB7500343EB1 /* OverlayMask@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "OverlayMask@2x.png"; sourceTree = ""; }; + 93F216E715E5BB7500343EB1 /* SliderHandle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SliderHandle@2x.png"; sourceTree = ""; }; + 93F216E815E5BB7500343EB1 /* SliderHandleDown@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SliderHandleDown@2x.png"; sourceTree = ""; }; + 93F216E915E5BB7500343EB1 /* SliderWell@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SliderWell@2x.png"; sourceTree = ""; }; + 93F216EA15E5BB7500343EB1 /* SmallSliderHandle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SmallSliderHandle@2x.png"; sourceTree = ""; }; + 93F216EB15E5BB7500343EB1 /* SmallSliderHandleDown@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SmallSliderHandleDown@2x.png"; sourceTree = ""; }; + 93F216EC15E5BB7500343EB1 /* SmallSliderWellOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SmallSliderWellOff@2x.png"; sourceTree = ""; }; + 93F216ED15E5BB7500343EB1 /* SmallSliderWellOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SmallSliderWellOn@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +74,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 938A6C0F154F47A6007FC919 /* QuartzCore.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -105,6 +124,7 @@ 29B97314FDCFA39411CA2CEA /* TMSliderControl */ = { isa = PBXGroup; children = ( + 938A6C0E154F47A6007FC919 /* QuartzCore.framework */, 19C28FACFE9D520D11CA2CBB /* Products */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, @@ -127,13 +147,21 @@ isa = PBXGroup; children = ( 5F8F327912BE951C009B2446 /* SmallSliderHandle.png */, + 93F216EA15E5BB7500343EB1 /* SmallSliderHandle@2x.png */, 5F8F327A12BE951C009B2446 /* SmallSliderHandleDown.png */, + 93F216EB15E5BB7500343EB1 /* SmallSliderHandleDown@2x.png */, 5F8F327B12BE951C009B2446 /* SmallSliderWellOff.png */, + 93F216EC15E5BB7500343EB1 /* SmallSliderWellOff@2x.png */, 5F8F327C12BE951C009B2446 /* SmallSliderWellOn.png */, + 93F216ED15E5BB7500343EB1 /* SmallSliderWellOn@2x.png */, 5F9409230F3656C900317331 /* SliderWell.png */, + 93F216E915E5BB7500343EB1 /* SliderWell@2x.png */, 5F9409240F3656C900317331 /* SliderHandleDown.png */, + 93F216E815E5BB7500343EB1 /* SliderHandleDown@2x.png */, 5F9409250F3656C900317331 /* SliderHandle.png */, + 93F216E715E5BB7500343EB1 /* SliderHandle@2x.png */, 5F9409290F3656C900317331 /* OverlayMask.png */, + 93F216E615E5BB7500343EB1 /* OverlayMask@2x.png */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, @@ -210,6 +238,14 @@ 5F8F327E12BE951C009B2446 /* SmallSliderHandleDown.png in Resources */, 5F8F327F12BE951C009B2446 /* SmallSliderWellOff.png in Resources */, 5F8F328012BE951C009B2446 /* SmallSliderWellOn.png in Resources */, + 93F216EE15E5BB7500343EB1 /* OverlayMask@2x.png in Resources */, + 93F216EF15E5BB7500343EB1 /* SliderHandle@2x.png in Resources */, + 93F216F015E5BB7500343EB1 /* SliderHandleDown@2x.png in Resources */, + 93F216F115E5BB7500343EB1 /* SliderWell@2x.png in Resources */, + 93F216F215E5BB7500343EB1 /* SmallSliderHandle@2x.png in Resources */, + 93F216F315E5BB7500343EB1 /* SmallSliderHandleDown@2x.png in Resources */, + 93F216F415E5BB7500343EB1 /* SmallSliderWellOff@2x.png in Resources */, + 93F216F515E5BB7500343EB1 /* SmallSliderWellOn@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -223,7 +259,7 @@ 8D11072D0486CEB800E47090 /* main.m in Sources */, 5F9409190F36563700317331 /* TMSliderControl.m in Sources */, 5F9409200F36566000317331 /* AppController.m in Sources */, - 5F8F327712BE9303009B2446 /* TMSliderControlSmall.m in Sources */, + 938A6C10154F48A0007FC919 /* TMSliderControlSmall.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -283,26 +319,28 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.5; + SDKROOT = ""; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; PREBINDING = NO; - SDKROOT = macosx10.5; + SDKROOT = ""; }; name = Release; }; diff --git a/TMSliderControlSmall.m b/TMSliderControlSmall.m index 150e295..1f1f822 100644 --- a/TMSliderControlSmall.m +++ b/TMSliderControlSmall.m @@ -8,79 +8,57 @@ #import "TMSliderControlSmall.h" -@interface TMSliderControlSmall (Private) -- (void)drawBacking; -- (void)drawHandle; -@end - -@implementation TMSliderControlSmall (Private) +@implementation TMSliderControlSmall -- (void)drawBacking ++ (NSImage*)sliderWellOn { - [sliderWellOff drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; - CGFloat percentOn = (handleControlRect.origin.x - handleControlRectOff.origin.x) / (handleControlRectOn.origin.x - handleControlRectOff.origin.x); - [sliderWellOn drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:percentOn]; + return [NSImage imageNamed:@"SmallSliderWellOn"]; } ++ (NSImage*)sliderWellOff +{ + return [NSImage imageNamed:@"SmallSliderWellOff"]; +} -- (void)drawHandle ++ (NSImage*)sliderHandleImage { - NSImage *sliderImage; - if (controlState == kTMSliderControlState_Active) - { - sliderImage = sliderHandleDown; - } - else - { - sliderImage = sliderHandle; - } - [sliderHandleView setImage: sliderImage]; + return [NSImage imageNamed:@"SmallSliderHandle"]; } -- (void)layoutHandle ++ (NSImage*)sliderHandleDownImage { - handleControlRectOff = NSMakeRect(0,0, 27, 18); - handleControlRectOn = NSMakeRect([self bounds].size.width - 27, 0, 27, 18); - handleControlRect = handleControlRectOff; + return [NSImage imageNamed:@"SmallSliderHandleDown"]; } -@end ++ (NSImage*)overlayMask +{ + return nil; +} -@implementation TMSliderControlSmall +- (void)updateUI +{ + [super updateUI]; -- (id)initWithFrame:(NSRect)frame { - self = [super initWithFrame:frame]; - if (self) { - // Initialization code here. - sliderWellOn = [[NSImage imageNamed:@"SmallSliderWellOn"] retain]; - sliderWellOff = [[NSImage imageNamed:@"SmallSliderWellOff"] retain]; + sliderWell.contents = (self.state == kTMSliderControlState_Active ? [[self class] sliderWellOn] : [[self class] sliderWellOff]); - [sliderHandle release]; - sliderHandle = [[NSImage imageNamed:@"SmallSliderHandle"] retain]; - [sliderHandleDown release]; - sliderHandleDown = [[NSImage imageNamed:@"SmallSliderHandleDown"] retain]; - [self layoutHandle]; - } - return self; } - (void)dealloc { [sliderWellOn release]; [sliderWellOff release]; - [sliderHandle release]; - [sliderHandleDown release]; [super dealloc]; } -- (void)drawRect:(NSRect)rect { - [self drawBacking]; - [self drawHandle]; -} - - (BOOL)isFlipped { return NO; } +- (void)layoutHandle +{ + handleControlRectOff = CGRectMake(0,0, 27, 18); + handleControlRectOn = CGRectMake([self bounds].size.width - 27, 0, 27, 18); +} + @end