<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -52,8 +52,8 @@
     
     if (self)
     {
-        _radioGroup = aRadioGroup || [CPRadioGroup new];
-    
+        [self setRadioGroup:aRadioGroup || [CPRadioGroup new]];
+
         [self setHighlightsBy:CPContentsCellMask];
         [self setShowsStateBy:CPContentsCellMask];
 
@@ -102,6 +102,29 @@
 
 @end
 
+var CPRadioRadioGroupKey    = @&quot;CPRadioRadioGroupKey&quot;;
+
+@implementation CPRadio (CPCoding)
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+    self = [super initWithCoder:aCoder];
+
+    if (self)
+        _radioGroup = [aCoder decodeObjectForKey:CPRadioRadioGroupKey];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(CPCoder)aCoder
+{
+    [super encodeWithCoder:aCoder];
+
+    [aCoder encodeObject:_radioGroup forKey:CPRadioRadioGroupKey];
+}
+
+@end
+
 @implementation CPRadioGroup : CPObject
 {
     CPSet   _radios;
@@ -157,3 +180,29 @@
 }
 
 @end
+
+var CPRadioGroupRadiosKey           = @&quot;CPRadioGroupRadiosKey&quot;,
+    CPRadioGroupSelectedRadioKey    = @&quot;CPRadioGroupSelectedRadioKey&quot;;
+
+@implementation CPRadioGroup (CPCoding)
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+    self = [super init];
+
+    if (self)
+    {
+        _radios = [aCoder decodeObjectForKey:CPRadioGroupRadiosKey];
+        _selectedRadio = [aCoder decodeObjectForKey:CPRadioGroupSelectedRadioKey];
+    }
+
+    return self;
+}
+
+- (void)encodeWithCoder:(CPCoder)aCoder
+{
+    [aCoder encodeObject:_radios forKey:CPRadioGroupRadiosKey];
+    [aCoder encodeObject:_selectedRadio forKey:CPRadioGroupSelectedRadioKey];
+}
+
+@end</diff>
      <filename>AppKit/CPRadio.j</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@
 @import &quot;NSFont.j&quot;
 @import &quot;NSIBObjectData.j&quot;
 @import &quot;NSImageView.j&quot;
+@import &quot;NSMatrix.j&quot;
 @import &quot;NSMenu.j&quot;
 @import &quot;NSMenuItem.j&quot;
 @import &quot;NSNibConnector.j&quot;</diff>
      <filename>Tools/nib2cib/NSAppKit.j</filename>
    </modified>
    <modified>
      <diff>@@ -185,6 +185,8 @@ _CPButtonBezelStyleHeights[CPHUDBezelStyle] = 20;
 
         // NSContents for NSButton is actually the title
         _title = [aCoder decodeObjectForKey:@&quot;NSContents&quot;];
+        // ... and _objectValue is _state
+        _objectValue = [self state];
 
         _alternateImage = [aCoder decodeObjectForKey:@&quot;NSAlternateImage&quot;];
     }</diff>
      <filename>Tools/nib2cib/NSButton.j</filename>
    </modified>
    <modified>
      <diff>@@ -53,7 +53,7 @@
     {
         var flags  = [aCoder decodeIntForKey:@&quot;NSCellFlags&quot;],
             flags2 = [aCoder decodeIntForKey:@&quot;NSCellFlags2&quot;];
-            
+
         _state          = (flags &amp; 0x80000000) ? CPOnState : CPOffState;
         _isHighlighted  = (flags &amp; 0x40000000) ? YES : NO;
         _isEnabled      = (flags &amp; 0x20000000) ? NO : YES;
@@ -66,7 +66,7 @@
         _wraps          = (flags &amp; 0x00100000) ? NO : YES;
         _alignment      = (flags2 &amp; 0x1c000000) &gt;&gt; 26;
         _controlSize    = (flags2 &amp; 0xE0000) &gt;&gt; 17;
-                        
+
         _objectValue    = [aCoder decodeObjectForKey:@&quot;NSContents&quot;];
         _font           = [aCoder decodeObjectForKey:@&quot;NSSupport&quot;];
     }</diff>
      <filename>Tools/nib2cib/NSCell.j</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c3d698bcac5a890bc4f844cd9d8f1b0931220557</id>
    </parent>
  </parents>
  <author>
    <name>Francisco Tolmasky</name>
    <email>francisco@280north.com</email>
  </author>
  <url>http://github.com/280north/cappuccino/commit/4ff6590e74f5d6492e917c3eb338070192045568</url>
  <id>4ff6590e74f5d6492e917c3eb338070192045568</id>
  <committed-date>2009-05-17T20:03:36-07:00</committed-date>
  <authored-date>2009-05-17T20:03:36-07:00</authored-date>
  <message>Added support for NSMatrix of radio buttons.

Reviewed by me.</message>
  <tree>85424984dd2deab7d43006592dacdab0d00f5ff7</tree>
  <committer>
    <name>Francisco Tolmasky</name>
    <email>francisco@280north.com</email>
  </committer>
</commit>
