From: masakih Date: Wed, 4 May 2016 06:08:02 +0000 (+0900) Subject: 編成支援に速力、射程、艦載機搭載数を追加 X-Git-Tag: 1.6b1~3 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=869790d6590518b329ae7026d96bb90aaebc4164;p=kcd%2FKCD.git 編成支援に速力、射程、艦載機搭載数を追加 --- diff --git a/KCD/HMShipViewController.h b/KCD/HMShipViewController.h index c9417d1c..5f325293 100644 --- a/KCD/HMShipViewController.h +++ b/KCD/HMShipViewController.h @@ -9,19 +9,6 @@ #import @interface HMShipViewController : NSViewController -@property (readonly) NSManagedObjectContext *managedObjectContext; -@property (readonly) NSNumber *standardDeviation; - - -@property (nonatomic, strong) IBOutlet NSArrayController *shipController; -@property (nonatomic, strong) IBOutlet NSScrollView *expTableView; -@property (nonatomic, strong) IBOutlet NSScrollView *powerTableView; -@property (nonatomic, strong) IBOutlet NSScrollView *power2TableView; - - -- (IBAction)changeCategory:(id)sender; - -- (IBAction)changeView:(id)sender; @end diff --git a/KCD/HMShipViewController.m b/KCD/HMShipViewController.m index b40633e0..958944c0 100644 --- a/KCD/HMShipViewController.m +++ b/KCD/HMShipViewController.m @@ -17,11 +17,28 @@ typedef NS_ENUM(NSInteger, ViewType) { kExpView = 0, kPowerView = 1, kPower2View = 2, + kPower3View = 3, }; @interface HMShipViewController () @property (weak) NSView *currentTableView; @property (weak, nonatomic) IBOutlet NSTextField *standardDeviationField; + +@property (readonly) NSManagedObjectContext *managedObjectContext; + +@property (readonly) NSNumber *standardDeviation; + + +@property (nonatomic, strong) IBOutlet NSArrayController *shipController; +@property (nonatomic, strong) IBOutlet NSScrollView *expTableView; +@property (nonatomic, strong) IBOutlet NSScrollView *powerTableView; +@property (nonatomic, strong) IBOutlet NSScrollView *power2TableView; +@property (nonatomic, strong) IBOutlet NSScrollView *power3TableView; + + +- (IBAction)changeCategory:(id)sender; + +- (IBAction)changeView:(id)sender; @end @implementation HMShipViewController @@ -36,7 +53,6 @@ typedef NS_ENUM(NSInteger, ViewType) { { self.currentTableView = self.expTableView; - [self.shipController fetchWithRequest:nil merge:YES error:NULL]; [self.shipController setSortDescriptors:HMStandardDefaults.shipviewSortDescriptors]; [self.shipController addObserver:self @@ -61,6 +77,10 @@ typedef NS_ENUM(NSInteger, ViewType) { selector:@selector(scrollViewDidEndLiveScrollNotification:) name:NSScrollViewDidEndLiveScrollNotification object:self.power2TableView]; + [nc addObserver:self + selector:@selector(scrollViewDidEndLiveScrollNotification:) + name:NSScrollViewDidEndLiveScrollNotification + object:self.power3TableView]; #ifdef DEBUG self.standardDeviationField.hidden = NO; #endif @@ -116,15 +136,24 @@ typedef NS_ENUM(NSInteger, ViewType) { case kPower2View: newSelection = self.power2TableView; break; + case kPower3View: + newSelection = self.power3TableView; + break; } if(!newSelection) return; if([self.currentTableView isEqual:newSelection]) return; + +// NSRect visibleRect = [self.currentTableView.enclosingScrollView documentVisibleRect]; + [newSelection setFrame:[self.currentTableView frame]]; [newSelection setAutoresizingMask:[self.currentTableView autoresizingMask]]; [self.view replaceSubview:self.currentTableView with:newSelection]; self.currentTableView = newSelection; + +// [self.currentTableView scrollRectToVisible:visibleRect]; + [self.view.window makeFirstResponder:self.currentTableView]; } @@ -150,6 +179,14 @@ typedef NS_ENUM(NSInteger, ViewType) { [self showViewWithNumber:tag]; } +#pragma mark - NSTableViewDelegate & NSTableViewDataSource + +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +{ + NSView *itemView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:nil]; + return itemView; +} + #pragma mark - NSScrollViewDidEndLiveScrollNotification - (void)scrollViewDidEndLiveScrollNotification:(NSNotification *)notification { @@ -157,7 +194,7 @@ typedef NS_ENUM(NSInteger, ViewType) { NSRect visibleRect = [object documentVisibleRect]; - for(id item in @[self.expTableView, self.powerTableView, self.power2TableView]) { + for(id item in @[self.expTableView, self.powerTableView, self.power2TableView, self.power3TableView]) { if(![object isEqual:item]) { NSView *view = [item documentView]; [view scrollRectToVisible:visibleRect]; diff --git a/KCD/ja.lproj/HMShipViewController.xib b/KCD/ja.lproj/HMShipViewController.xib index 0ce15823..a4c04853 100644 --- a/KCD/ja.lproj/HMShipViewController.xib +++ b/KCD/ja.lproj/HMShipViewController.xib @@ -1,14 +1,15 @@ - + - + + @@ -28,8 +29,8 @@ - - + + @@ -47,9 +48,29 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -63,19 +84,35 @@ - - - - - - - - - - HMPlanToShowsBoldFontTransformer - - - + + + + + + + + + + + + + + + + + HMPlanToShowsBoldFontTransformer + + + + + + + + + + + + @@ -87,20 +124,34 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -110,16 +161,34 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -129,27 +198,48 @@ - - - - - - - - MAX - - - + + + + + + + + + + + + + + + + + + MAX + + + + + + + + + + + + + + - - - - - - - - - - - - - - - @@ -213,7 +288,7 @@ + + + + + + + + + + + + + + + + @@ -240,7 +331,7 @@ - + @@ -259,19 +350,35 @@ - - - - - - - - - - HMPlanToShowsBoldFontTransformer - - - + + + + + + + + + + + + + + + + + HMPlanToShowsBoldFontTransformer + + + + + + + + + + + + @@ -283,13 +390,38 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -302,14 +434,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -321,14 +471,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -340,14 +508,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -359,16 +545,38 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -393,7 +601,7 @@ - + @@ -412,19 +620,35 @@ - - - - - - - - - - HMPlanToShowsBoldFontTransformer - - - + + + + + + + + + + + + + + + + + HMPlanToShowsBoldFontTransformer + + + + + + + + + + + + @@ -436,14 +660,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -455,14 +697,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -474,14 +734,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -493,14 +771,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -512,16 +808,38 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -537,7 +855,260 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HMPlanToShowsBoldFontTransformer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HMLengTransformer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HMSokuTransformer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HMIgnoreZeroTransformer + + + + + + + + + + + + + + + + + HMIgnoreZeroTransformer + + + + + + + + + + + + + + + + + HMIgnoreZeroTransformer + + + + + + + + + + + + + + + + + HMIgnoreZeroTransformer + + + + + + + + + + + + + + + + + + + + + + + + + + +