Revision: 15183
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15183&view=rev
Author:   hofman
Date:     2009-04-25 11:16:31 +0000 (Sat, 25 Apr 2009)

Log Message:
-----------
implement designated popup cell method and implement NSCoding for header popup

Modified Paths:
--------------
    trunk/bibdesk/BDSKHeaderPopUpButtonCell.h
    trunk/bibdesk/BDSKHeaderPopUpButtonCell.m

Modified: trunk/bibdesk/BDSKHeaderPopUpButtonCell.h
===================================================================
--- trunk/bibdesk/BDSKHeaderPopUpButtonCell.h   2009-04-25 04:58:38 UTC (rev 
15182)
+++ trunk/bibdesk/BDSKHeaderPopUpButtonCell.h   2009-04-25 11:16:31 UTC (rev 
15183)
@@ -42,5 +42,4 @@
 @interface BDSKHeaderPopUpButtonCell : NSPopUpButtonCell {
        NSTableHeaderCell *headerCell;
 }
-- (id)initWithHeaderCell:(NSTableHeaderCell *)aHeaderCell;
 @end

Modified: trunk/bibdesk/BDSKHeaderPopUpButtonCell.m
===================================================================
--- trunk/bibdesk/BDSKHeaderPopUpButtonCell.m   2009-04-25 04:58:38 UTC (rev 
15182)
+++ trunk/bibdesk/BDSKHeaderPopUpButtonCell.m   2009-04-25 11:16:31 UTC (rev 
15183)
@@ -43,17 +43,7 @@
 
 @implementation BDSKHeaderPopUpButtonCell
 
-- (id)initTextCell:(NSString *)aString {
-       NSTableHeaderCell *aHeaderCell = [[NSTableHeaderCell 
allocWithZone:[self zone]] initTextCell:@""];
-       if (self = [self initWithHeaderCell:aHeaderCell]) {
-               [self setStringValue:aString];
-        [headerCell setStringValue:aString];
-       }
-       [aHeaderCell release];
-       return self;
-}
-
-- (id)initWithHeaderCell:(NSTableHeaderCell *)aHeaderCell {
+- (id)initTextCell:(NSString *)stringValue pullsDown:(BOOL)pullDown {
        if ([super initTextCell:@"" pullsDown:NO]) {
                
                [self setArrowPosition:NSPopUpNoArrow];
@@ -62,11 +52,11 @@
                [self setUsesItemFromMenu:YES];
                [self setRefusesFirstResponder:YES];
                
-               // we could pass more properties
-               [self setFont:[aHeaderCell font]];
+               // we keep the headercell for drawing
+               headerCell = [[NSTableHeaderCell allocWithZone:[self zone]] 
initTextCell:@""];
                
-               // we keep the headercell for drawing
-               headerCell = [aHeaderCell retain];
+        // we could pass more properties
+               [headerCell setFont:[self font]];
        }
        return self;
 }
@@ -77,6 +67,18 @@
     return copy;
 }
 
+- (id)initWithCoder:(NSCoder *)decoder {
+    if (self = [super initWithCoder:decoder]) {
+        headerCell = [[decoder decodeObjectForKey:@"headerCell"] retain];
+    }
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+    [coder encodeObject:headerCell forKey:@"headerCell"];
+}
+
 - (void)dealloc {
        [headerCell release];
        [super dealloc];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to