[Mit-cadr-cvs] r397 - in branches/ggilley/emulator/usim/CADR: . CADR.xcodeproj

ggilley at common-lisp.net ggilley at common-lisp.net
Fri Dec 7 03:54:24 UTC 2012


Author: ggilley
Date: Thu Dec  6 19:54:23 2012
New Revision: 397

Log:
progress on createdisk dialog

Modified:
   branches/ggilley/emulator/usim/CADR/CADR.xcodeproj/project.pbxproj
   branches/ggilley/emulator/usim/CADR/CreateDisk.xib
   branches/ggilley/emulator/usim/CADR/CreateDiskController.h
   branches/ggilley/emulator/usim/CADR/CreateDiskController.m

Modified: branches/ggilley/emulator/usim/CADR/CADR.xcodeproj/project.pbxproj
==============================================================================
--- branches/ggilley/emulator/usim/CADR/CADR.xcodeproj/project.pbxproj	Wed Dec  5 13:20:24 2012	(r396)
+++ branches/ggilley/emulator/usim/CADR/CADR.xcodeproj/project.pbxproj	Thu Dec  6 19:54:23 2012	(r397)
@@ -235,8 +235,6 @@
 			children = (
 				DDA39C17166EFC2A0079DDDF /* CADR.entitlements */,
 				DD36580B1665EAC000755138 /* cadrAppDelegate.m */,
-				DD36580C1665EAC000755138 /* CreateDisk.xib */,
-				DD36580D1665EAC000755138 /* diskutil.m */,
 				DD36580E1665EAC000755138 /* DebuggerController.m */,
 				DD36580F1665EAC000755138 /* AppController.h */,
 				DD3658101665EAC000755138 /* AppController.m */,
@@ -248,6 +246,7 @@
 				DD3658161665EAC000755138 /* cadrAppDelegate.h */,
 				DD3658171665EAC000755138 /* CreateDiskController.h */,
 				DD3658181665EAC000755138 /* CreateDiskController.m */,
+				DD36580C1665EAC000755138 /* CreateDisk.xib */,
 				DD3658191665EAC000755138 /* DataTypes.c */,
 				DD36581A1665EAC000755138 /* DataTypes.h */,
 				DD36581B1665EAC000755138 /* Debugger.xib */,
@@ -256,19 +255,20 @@
 				DD36581E1665EAC000755138 /* DebugSettingsController.h */,
 				DD36581F1665EAC000755138 /* DebugSettingsController.m */,
 				DD3658201665EAC000755138 /* diskutil.h */,
+				DD36580D1665EAC000755138 /* diskutil.m */,
 				DD3658211665EAC000755138 /* macro.png */,
 				DD3658231665EAC000755138 /* micro.png */,
+				DD3658271665EAC000755138 /* pause.png */,
+				DD3658281665EAC000755138 /* play.png */,
+				DD36582E1665EAC000755138 /* step.png */,
 				DD3658241665EAC000755138 /* Partitions.xib */,
 				DD3658251665EAC000755138 /* PartitionViewController.h */,
 				DD3658261665EAC000755138 /* PartitionViewController.m */,
-				DD3658271665EAC000755138 /* pause.png */,
-				DD3658281665EAC000755138 /* play.png */,
 				DD3658291665EAC000755138 /* PreferenceController.h */,
 				DD36582A1665EAC000755138 /* PreferenceController.m */,
 				DD36582B1665EAC000755138 /* Preferences.xib */,
 				DD36582C1665EAC000755138 /* SimView.h */,
 				DD36582D1665EAC000755138 /* SimView.m */,
-				DD36582E1665EAC000755138 /* step.png */,
 				DD308D041665E71F00361F6D /* chaos.c */,
 				DD308D051665E71F00361F6D /* chaos.h */,
 				DD308D061665E71F00361F6D /* ether.c */,

Modified: branches/ggilley/emulator/usim/CADR/CreateDisk.xib
==============================================================================
--- branches/ggilley/emulator/usim/CADR/CreateDisk.xib	Wed Dec  5 13:20:24 2012	(r396)
+++ branches/ggilley/emulator/usim/CADR/CreateDisk.xib	Thu Dec  6 19:54:23 2012	(r397)
@@ -2,9 +2,9 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
 	<data>
 		<int key="IBDocument.SystemTarget">1080</int>
-		<string key="IBDocument.SystemVersion">12D31</string>
+		<string key="IBDocument.SystemVersion">12D38</string>
 		<string key="IBDocument.InterfaceBuilderVersion">2844</string>
-		<string key="IBDocument.AppKitVersion">1187.35</string>
+		<string key="IBDocument.AppKitVersion">1187.37</string>
 		<string key="IBDocument.HIToolboxVersion">626.00</string>
 		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -15,6 +15,9 @@
 			<string>NSButton</string>
 			<string>NSButtonCell</string>
 			<string>NSCustomObject</string>
+			<string>NSMenu</string>
+			<string>NSMenuItem</string>
+			<string>NSPopUpButtonCell</string>
 			<string>NSScrollView</string>
 			<string>NSScroller</string>
 			<string>NSTableColumn</string>
@@ -68,7 +71,6 @@
 											<array class="NSMutableArray" key="NSSubviews"/>
 											<string key="NSFrameSize">{612, 225}</string>
 											<reference key="NSSuperview" ref="727482002"/>
-											<reference key="NSWindow"/>
 											<reference key="NSNextKeyView" ref="442844632"/>
 											<string key="NSReuseIdentifierKey">_NS:13</string>
 											<bool key="NSEnabled">YES</bool>
@@ -79,7 +81,6 @@
 												<int key="NSvFlags">256</int>
 												<string key="NSFrameSize">{612, 17}</string>
 												<reference key="NSSuperview" ref="308288361"/>
-												<reference key="NSWindow"/>
 												<reference key="NSNextKeyView" ref="533917296"/>
 												<string key="NSReuseIdentifierKey">_NS:16</string>
 												<reference key="NSTableView" ref="51481222"/>
@@ -89,7 +90,6 @@
 												<int key="NSvFlags">-2147483392</int>
 												<string key="NSFrame">{{224, 0}, {16, 17}}</string>
 												<reference key="NSSuperview" ref="62218533"/>
-												<reference key="NSWindow"/>
 												<reference key="NSNextKeyView" ref="727482002"/>
 												<string key="NSReuseIdentifierKey">_NS:19</string>
 											</object>
@@ -141,7 +141,7 @@
 															<int key="NSColorSpace">6</int>
 															<string key="NSCatalogName">System</string>
 															<string key="NSColorName">controlBackgroundColor</string>
-															<object class="NSColor" key="NSColor" id="1006537297">
+															<object class="NSColor" key="NSColor">
 																<int key="NSColorSpace">3</int>
 																<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
 															</object>
@@ -159,7 +159,7 @@
 													<reference key="NSTableView" ref="51481222"/>
 												</object>
 												<object class="NSTableColumn" id="40246556">
-													<string key="NSIdentifier">NameCell</string>
+													<string key="NSIdentifier">PartitionTypeCell</string>
 													<double key="NSWidth">59.73828125</double>
 													<double key="NSMinWidth">40</double>
 													<double key="NSMaxWidth">1000</double>
@@ -174,20 +174,48 @@
 														</object>
 														<reference key="NSTextColor" ref="648720527"/>
 													</object>
-													<object class="NSTextFieldCell" key="NSDataCell" id="472211756">
-														<int key="NSCellFlags">337641537</int>
-														<int key="NSCellFlags2">272631808</int>
-														<string key="NSContents">Text</string>
+													<object class="NSPopUpButtonCell" key="NSDataCell" id="286429564">
+														<int key="NSCellFlags">-2076180416</int>
+														<int key="NSCellFlags2">2048</int>
 														<reference key="NSSupport" ref="1014988084"/>
 														<string key="NSCellIdentifier">_NS:9</string>
 														<reference key="NSControlView" ref="51481222"/>
-														<object class="NSColor" key="NSBackgroundColor">
-															<int key="NSColorSpace">6</int>
-															<string key="NSCatalogName">System</string>
-															<string key="NSColorName">controlColor</string>
-															<reference key="NSColor" ref="1006537297"/>
+														<int key="NSButtonFlags">100679680</int>
+														<int key="NSButtonFlags2">129</int>
+														<string key="NSAlternateContents"/>
+														<string key="NSKeyEquivalent"/>
+														<int key="NSPeriodicDelay">400</int>
+														<int key="NSPeriodicInterval">75</int>
+														<nil key="NSMenuItem"/>
+														<bool key="NSMenuItemRespectAlignment">YES</bool>
+														<object class="NSMenu" key="NSMenu" id="525041087">
+															<string key="NSTitle">OtherViews</string>
+															<array class="NSMutableArray" key="NSMenuItems">
+																<object class="NSMenuItem" id="711529600">
+																	<reference key="NSMenu" ref="525041087"/>
+																	<string key="NSTitle">Type</string>
+																	<string key="NSKeyEquiv"/>
+																	<int key="NSKeyEquivModMask">1048576</int>
+																	<int key="NSMnemonicLoc">2147483647</int>
+																	<object class="NSCustomResource" key="NSOnImage">
+																		<string key="NSClassName">NSImage</string>
+																		<string key="NSResourceName">NSMenuCheckmark</string>
+																	</object>
+																	<object class="NSCustomResource" key="NSMixedImage">
+																		<string key="NSClassName">NSImage</string>
+																		<string key="NSResourceName">NSMenuMixedState</string>
+																	</object>
+																	<string key="NSAction">_popUpItemAction:</string>
+																	<reference key="NSTarget" ref="286429564"/>
+																</object>
+															</array>
+															<reference key="NSMenuFont" ref="26"/>
 														</object>
-														<reference key="NSTextColor" ref="932753859"/>
+														<int key="NSSelectedIndex">-1</int>
+														<int key="NSPreferredEdge">3</int>
+														<bool key="NSUsesItemFromMenu">YES</bool>
+														<bool key="NSAltersState">YES</bool>
+														<int key="NSArrowPosition">1</int>
 													</object>
 													<int key="NSResizingMask">3</int>
 													<bool key="NSIsResizeable">YES</bool>
@@ -327,7 +355,6 @@
 									</array>
 									<string key="NSFrame">{{1, 17}, {612, 225}}</string>
 									<reference key="NSSuperview" ref="62218533"/>
-									<reference key="NSWindow"/>
 									<reference key="NSNextKeyView" ref="51481222"/>
 									<string key="NSReuseIdentifierKey">_NS:11</string>
 									<reference key="NSDocView" ref="51481222"/>
@@ -339,7 +366,6 @@
 									<int key="NSvFlags">-2147483392</int>
 									<string key="NSFrame">{{224, 17}, {15, 102}}</string>
 									<reference key="NSSuperview" ref="62218533"/>
-									<reference key="NSWindow"/>
 									<reference key="NSNextKeyView" ref="914976451"/>
 									<string key="NSReuseIdentifierKey">_NS:58</string>
 									<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -352,7 +378,6 @@
 									<int key="NSvFlags">-2147483392</int>
 									<string key="NSFrame">{{1, 225}, {610, 15}}</string>
 									<reference key="NSSuperview" ref="62218533"/>
-									<reference key="NSWindow"/>
 									<reference key="NSNextKeyView" ref="896764449"/>
 									<string key="NSReuseIdentifierKey">_NS:60</string>
 									<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -369,7 +394,6 @@
 									</array>
 									<string key="NSFrame">{{1, 0}, {612, 17}}</string>
 									<reference key="NSSuperview" ref="62218533"/>
-									<reference key="NSWindow"/>
 									<reference key="NSNextKeyView" ref="230617521"/>
 									<string key="NSReuseIdentifierKey">_NS:15</string>
 									<reference key="NSDocView" ref="230617521"/>
@@ -380,7 +404,6 @@
 							</array>
 							<string key="NSFrame">{{28, 61}, {614, 243}}</string>
 							<reference key="NSSuperview" ref="1006"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView" ref="308288361"/>
 							<string key="NSReuseIdentifierKey">_NS:9</string>
 							<int key="NSsFlags">133682</int>
@@ -399,7 +422,6 @@
 							<int key="NSvFlags">268</int>
 							<string key="NSFrame">{{567, 13}, {81, 32}}</string>
 							<reference key="NSSuperview" ref="1006"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView"/>
 							<string key="NSReuseIdentifierKey">_NS:9</string>
 							<bool key="NSEnabled">YES</bool>
@@ -424,7 +446,6 @@
 							<int key="NSvFlags">268</int>
 							<string key="NSFrame">{{22, 13}, {40, 32}}</string>
 							<reference key="NSSuperview" ref="1006"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView" ref="81018695"/>
 							<string key="NSReuseIdentifierKey">_NS:9</string>
 							<bool key="NSEnabled">YES</bool>
@@ -449,7 +470,6 @@
 							<int key="NSvFlags">268</int>
 							<string key="NSFrame">{{55, 13}, {39, 32}}</string>
 							<reference key="NSSuperview" ref="1006"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView" ref="686803963"/>
 							<string key="NSReuseIdentifierKey">_NS:9</string>
 							<bool key="NSEnabled">YES</bool>
@@ -474,7 +494,6 @@
 							<int key="NSvFlags">268</int>
 							<string key="NSFrame">{{277, 13}, {109, 32}}</string>
 							<reference key="NSSuperview" ref="1006"/>
-							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView" ref="628916555"/>
 							<string key="NSReuseIdentifierKey">_NS:9</string>
 							<bool key="NSEnabled">YES</bool>
@@ -497,7 +516,6 @@
 					</array>
 					<string key="NSFrameSize">{662, 378}</string>
 					<reference key="NSSuperview"/>
-					<reference key="NSWindow"/>
 					<reference key="NSNextKeyView" ref="62218533"/>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
@@ -558,6 +576,14 @@
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
+						<string key="label">_partitionMenu</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="286429564"/>
+					</object>
+					<int key="connectionID">445</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
 						<string key="label">dataSource</string>
 						<reference key="source" ref="51481222"/>
 						<reference key="destination" ref="1001"/>
@@ -854,7 +880,7 @@
 						<int key="objectID">33</int>
 						<reference key="object" ref="40246556"/>
 						<array class="NSMutableArray" key="children">
-							<reference ref="472211756"/>
+							<reference ref="286429564"/>
 						</array>
 						<reference key="parent" ref="51481222"/>
 					</object>
@@ -1078,10 +1104,26 @@
 						<reference key="parent" ref="442840955"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">50</int>
-						<reference key="object" ref="472211756"/>
+						<int key="objectID">442</int>
+						<reference key="object" ref="286429564"/>
+						<array class="NSMutableArray" key="children">
+							<reference ref="525041087"/>
+						</array>
 						<reference key="parent" ref="40246556"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">443</int>
+						<reference key="object" ref="525041087"/>
+						<array class="NSMutableArray" key="children">
+							<reference ref="711529600"/>
+						</array>
+						<reference key="parent" ref="286429564"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">444</int>
+						<reference key="object" ref="711529600"/>
+						<reference key="parent" ref="525041087"/>
+					</object>
 				</array>
 			</object>
 			<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -1150,78 +1192,30 @@
 				<string key="428.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="429.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="43.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="442.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="443.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="444.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="45.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="46.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="47.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="48.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="49.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="50.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 			</dictionary>
 			<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">441</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<object class="IBPartialClassDescription">
-					<string key="className">CreateDiskController</string>
-					<string key="superclassName">NSWindowController</string>
-					<dictionary class="NSMutableDictionary" key="actions">
-						<string key="addPartition:">id</string>
-						<string key="deletePartition:">id</string>
-						<string key="dismissWindow:">id</string>
-						<string key="setDefault:">id</string>
-					</dictionary>
-					<dictionary class="NSMutableDictionary" key="actionInfosByName">
-						<object class="IBActionInfo" key="addPartition:">
-							<string key="name">addPartition:</string>
-							<string key="candidateClassName">id</string>
-						</object>
-						<object class="IBActionInfo" key="deletePartition:">
-							<string key="name">deletePartition:</string>
-							<string key="candidateClassName">id</string>
-						</object>
-						<object class="IBActionInfo" key="dismissWindow:">
-							<string key="name">dismissWindow:</string>
-							<string key="candidateClassName">id</string>
-						</object>
-						<object class="IBActionInfo" key="setDefault:">
-							<string key="name">setDefault:</string>
-							<string key="candidateClassName">id</string>
-						</object>
-					</dictionary>
-					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">_tableView</string>
-						<string key="NS.object.0">NSTableView</string>
-					</object>
-					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<string key="NS.key.0">_tableView</string>
-						<object class="IBToOneOutletInfo" key="NS.object.0">
-							<string key="name">_tableView</string>
-							<string key="candidateClassName">NSTableView</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">./Classes/CreateDiskController.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">NSLayoutConstraint</string>
-					<string key="superclassName">NSObject</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
-					</object>
-				</object>
-			</array>
+			<int key="maxID">445</int>
 		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes"/>
 		<int key="IBDocument.localizationMode">0</int>
 		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
 		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+		<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+			<string key="NSMenuCheckmark">{11, 11}</string>
+			<string key="NSMenuMixedState">{10, 3}</string>
+		</dictionary>
 		<bool key="IBDocument.UseAutolayout">YES</bool>
 	</data>
 </archive>

Modified: branches/ggilley/emulator/usim/CADR/CreateDiskController.h
==============================================================================
--- branches/ggilley/emulator/usim/CADR/CreateDiskController.h	Wed Dec  5 13:20:24 2012	(r396)
+++ branches/ggilley/emulator/usim/CADR/CreateDiskController.h	Thu Dec  6 19:54:23 2012	(r397)
@@ -13,7 +13,10 @@
 @private
     NSMutableArray *_tableContents;
     IBOutlet NSTableView *_tableView;
+    IBOutlet NSPopUpButtonCell *_partitionMenu;
     NSString *diskFileName;
+    NSArray *partitionTypes;
+    int partitionSize[10];
 }
 
 - (IBAction)setDefault:(id)sender;
@@ -23,5 +26,6 @@
 - (void)updateDictionary;
 - (void)updateStarts;
 - (void)handleAction:(id)sender;
+- (NSNumber *)findIndex:(NSString *)name;
 
 @end

Modified: branches/ggilley/emulator/usim/CADR/CreateDiskController.m
==============================================================================
--- branches/ggilley/emulator/usim/CADR/CreateDiskController.m	Wed Dec  5 13:20:24 2012	(r396)
+++ branches/ggilley/emulator/usim/CADR/CreateDiskController.m	Thu Dec  6 19:54:23 2012	(r397)
@@ -29,6 +29,18 @@
 {
     self = [super initWithWindowNibName:@"CreateDisk"];
     
+    partitionTypes = [[NSArray alloc] initWithObjects:@"MCR1", @"MCR2", @"MCR3", @"MCR4", @"PAGE", @"LOD1", @"LOD2", @"LOD3", @"LOD4", @"FILE", nil];
+    partitionSize[0] = 148;
+    partitionSize[1] = 148;
+    partitionSize[2] = 148;
+    partitionSize[3] = 148;
+    partitionSize[4] = 32768;
+    partitionSize[5] = 25344;
+    partitionSize[6] = 25344;
+    partitionSize[7] = 25344;
+    partitionSize[8] = 25344;
+    partitionSize[9] = 131072;
+
     diskFileName = 0;
     return self;
 }
@@ -61,6 +73,8 @@
     
     default_template();
 
+    [_partitionMenu addItemsWithTitles:partitionTypes];
+
     [_tableView setDataSource:self];
     [_tableView setAction:@selector(handleAction:)];
     [self updateDictionary];
@@ -98,6 +112,19 @@
     return nil;
 }
 
+- (NSNumber *)findIndex:(NSString *)name
+{
+    int i = 1;
+    
+    for (id object in partitionTypes)
+    {
+        if ([name compare:object] == NSOrderedSame)
+            break;
+        i++;
+    }
+    return [NSNumber numberWithInt:i];
+}
+
 - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
 {
     // Group our "model" object, which is a dictionary
@@ -108,8 +135,8 @@
     
     if ([identifier isEqualToString:@"DefaultCell"]) {
         return [dictionary objectForKey:@"Default"];
-    } else if ([identifier isEqualToString:@"NameCell"]) {
-        return [dictionary objectForKey:@"Name"];
+    } else if ([identifier isEqualToString:@"PartitionTypeCell"]) {
+        return [self findIndex:[dictionary objectForKey:@"Name"]];
     } else if ([identifier isEqualToString:@"StartCell"]) {
         return [dictionary objectForKey:@"Start"];
     } else if ([identifier isEqualToString:@"SizeCell"]) {
@@ -124,9 +151,40 @@
     return nil;
 }
 
-- (void)tableView:(NSTableView *)tableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
+- (void)tableView:(NSTableView *)tableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
 {
+    // Group our "model" object, which is a dictionary
+    NSMutableDictionary *dictionary = [_tableContents objectAtIndex:(NSUInteger)row];
+    
+    // In IB the tableColumn has the identifier set to the same string as the keys in our dictionary
+    NSString *identifier = [tableColumn identifier];
     
+    if ([identifier isEqualToString:@"PartitionTypeCell"])
+    {
+        int index = [anObject intValue] - 1;
+
+        [dictionary setObject:[partitionTypes objectAtIndex:index] forKey:@"Name"];
+        [dictionary setObject:[[NSNumber numberWithInt:partitionSize[index]] stringValue] forKey:@"Size"];
+        
+        free((void *)parts[row].name);
+        parts[row].name = strdup([[partitionTypes objectAtIndex:index] cStringUsingEncoding:NSASCIIStringEncoding]);
+        parts[row].size = partitionSize[index];
+        [self updateStarts];
+        [self updateDictionary];
+        [_tableView reloadData];        
+    }
+    else if ([identifier isEqualToString:@"DescriptionCell"])
+    {
+        const char *description = [anObject cStringUsingEncoding:NSASCIIStringEncoding];
+        size_t len = description ? strlen(description) : 0;
+        
+        if (description)
+            strcpy(parts[row].label, description);
+        
+        for (size_t i = len; i < 16; i++)
+            parts[row].label[i] = ' ';
+        [self updateDictionary];
+    }
 }
 
 static int isloadband(const char *name)
@@ -198,7 +256,7 @@
         for (NSInteger i = (NSInteger)part_count - 1; i >= row; i--)
             parts[i + 1] = parts[i];
 
-        parts[row].name = "PART";
+        parts[row].name = "LOD1";
         parts[row].filename = 0;
         parts[row].size = 200;
         parts[row].start = 0;
@@ -242,12 +300,6 @@
     {
         
     }
-#if 0
-    if (col < 5)
-    {
-        [sender editColumn:col row:row withEvent:nil select:YES];
-    }
-#endif
 }
 
 - (IBAction)dismissWindow:(id)sender




More information about the mit-cadr-cvs mailing list