From 468f61296837285d94d2e16b0e1a627dfa5c9195 Mon Sep 17 00:00:00 2001 From: preble Date: Sun, 10 Oct 2010 12:03:50 -0400 Subject: [PATCH] Added close button to properties popup. --- IJInventoryWindowController.m | 2 +- IJItemPropertiesViewController.h | 3 + IJItemPropertiesViewController.m | 7 + ItemPropertiesView.xib | 268 ++++++++++++++++++++----------- 4 files changed, 188 insertions(+), 92 deletions(-) diff --git a/IJInventoryWindowController.m b/IJInventoryWindowController.m index 14e934d..9896dee 100644 --- a/IJInventoryWindowController.m +++ b/IJInventoryWindowController.m @@ -321,7 +321,7 @@ onSide:MAPositionRight atDistance:0]; [propertiesWindow setBackgroundColor:[NSColor controlBackgroundColor]]; - [propertiesWindow setViewMargin:10.0]; + [propertiesWindow setViewMargin:4.0]; [propertiesWindow setAlphaValue:1.0]; [[self window] addChildWindow:propertiesWindow ordered:NSWindowAbove]; } diff --git a/IJItemPropertiesViewController.h b/IJItemPropertiesViewController.h index a182c1f..9a9638e 100644 --- a/IJItemPropertiesViewController.h +++ b/IJItemPropertiesViewController.h @@ -14,4 +14,7 @@ IJInventoryItem *item; } @property (nonatomic, retain) IJInventoryItem *item; + +- (IBAction)closeButton:(id)sender; + @end diff --git a/IJItemPropertiesViewController.m b/IJItemPropertiesViewController.m index 86a3136..49b9403 100644 --- a/IJItemPropertiesViewController.m +++ b/IJItemPropertiesViewController.m @@ -13,4 +13,11 @@ @synthesize item; +- (IBAction)closeButton:(id)sender +{ + [self.view.window.parentWindow makeKeyWindow]; + [self commitEditing]; + self.item = nil; // Hack to prevent this item as coming up as 'lastItem' if they click again. +} + @end diff --git a/ItemPropertiesView.xib b/ItemPropertiesView.xib index 3f88ed0..e653de4 100644 --- a/ItemPropertiesView.xib +++ b/ItemPropertiesView.xib @@ -43,21 +43,45 @@ 268 YES - + 268 - {{74, 11}, {51, 22}} + {{131, 52}, {12, 30}} YES - - -1804468671 - 272630848 - + + 67239424 + 268435456 + Button + LucidaGrande 13 1044 - + + -2042347265 + 129 + + NSImage + NSStopProgressFreestandingTemplate + + + Gw + 200 + 25 + + + + + 268 + {{74, 14}, {51, 22}} + + YES + + -1804468671 + 272630848 + + YES @@ -74,7 +98,7 @@ YES - + -∞ @@ -93,7 +117,7 @@ NaN - + YES @@ -101,7 +125,7 @@ - + 0 0 YES @@ -109,7 +133,7 @@ 1 AAAAAAAAAAAAAAAAAAAAAA - + 3 YES @@ -122,9 +146,9 @@ NO YES - + YES - + 6 System textBackgroundColor @@ -133,28 +157,28 @@ MQA - + 6 System textColor - + 3 MAA - + 268 - {{74, 38}, {51, 22}} + {{74, 41}, {51, 22}} YES - + -1804468671 272630848 - - + + YES @@ -171,7 +195,7 @@ YES - + -∞ @@ -188,10 +212,10 @@ NaN - + - - + + 3 YES @@ -204,25 +228,25 @@ NO YES - + YES - - + + - + 268 - {{3, 13}, {66, 17}} + {{3, 16}, {66, 17}} YES - + 68288064 71304192 Damage: - - - + + + 6 System controlColor @@ -231,32 +255,32 @@ MC42NjY2NjY2NjY3AA - + 6 System controlTextColor - + - + 268 - {{3, 40}, {66, 17}} + {{3, 43}, {66, 17}} YES - + 68288064 71304192 Count: - - - - + + + + - {135, 69} + {145, 78} NSView @@ -275,10 +299,10 @@ value: item.count - + - + value: item.count value @@ -291,10 +315,10 @@ value: item.damage - + - + value: item.damage value @@ -304,6 +328,14 @@ 16 + + + closeButton: + + + + 21 + @@ -337,86 +369,101 @@ YES - - - - + + + + + 3 - + YES - + 4 - - + + 5 - + YES - + 6 - - + + 7 - + YES - + 8 - + YES - + - + 9 - - + + 10 - + YES - + 11 - + YES - + - + 12 - - + + + + + 17 + + + YES + + + + + + 18 + + @@ -434,6 +481,9 @@ 12.IBNumberFormatterBehaviorMetadataKey 12.IBNumberFormatterLocalizesFormatMetadataKey 12.IBPluginDependency + 17.IBPluginDependency + 17.IBViewBoundsToFrameTransform + 18.IBPluginDependency 3.IBPluginDependency 3.IBViewBoundsToFrameTransform 4.IBPluginDependency @@ -449,13 +499,13 @@ YES - {{550, 459}, {135, 69}} + {{550, 450}, {145, 78}} com.apple.InterfaceBuilder.CocoaPlugin {628, 654} {{217, 442}, {480, 272}} com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABCvgAAwrgAAA + P4AAAL+AAABClAAAwjwAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -463,17 +513,22 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABBwAAAwuoAAA + P4AAAL+AAABCogAAwo4AAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABBwAAAwrgAAA + P4AAAL+AAABAQAAAwo4AAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABCvgAAwu4AAA + P4AAAL+AAABAQAAAwjAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABClAAAwpQAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -497,7 +552,7 @@ - 16 + 21 @@ -505,6 +560,17 @@ IJItemPropertiesViewController NSViewController + + closeButton: + id + + + closeButton: + + closeButton: + id + + IBProjectSource IJItemPropertiesViewController.h @@ -524,21 +590,21 @@ NSApplication NSResponder - + IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h @@ -564,6 +630,22 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + NSCell NSObject @@ -575,7 +657,7 @@ NSControl NSView - + IBFrameworkSource AppKit.framework/Headers/NSControl.h @@ -591,7 +673,7 @@ NSMenu NSObject - + IBFrameworkSource AppKit.framework/Headers/NSMenu.h @@ -613,19 +695,19 @@ NSObject - + NSObject - + NSObject - + NSObject - + NSObject @@ -664,7 +746,7 @@ NSObject - + NSObject @@ -710,7 +792,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSView.h @@ -924,7 +1006,7 @@ NSView NSResponder - + NSViewController @@ -960,5 +1042,9 @@ YES InsideJob.xcodeproj 3 + + NSStopProgressFreestandingTemplate + {83, 83} +