//
//  Oaxaca2IBView.m
//  Oaxaca2IB
//
//  Created by Nicholas Matsakis on 1/31/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <InterfaceBuilderKit/InterfaceBuilderKit.h>
#import <Oaxaca2IB/Oaxaca2IBView.h>
#import "Oaxaca2IBInspector.h"
#import "OxDictionaryController.h"

@implementation OxDictionaryController ( Oaxaca2IBView )

- (NSString*) sortSelectorString
{
	SEL sel = self.sortSelector;
	const char *selChars = sel_getName(sel);
	return [NSString stringWithUTF8String:selChars];
}	

- (void) setSortSelectorString:(NSString*)str
{
	const char *selChars = [str UTF8String];
	SEL sel = sel_registerName(selChars);
	self.sortSelector = sel;
}

- (void)ibPopulateKeyPaths:(NSMutableDictionary *)keyPaths {
    [super ibPopulateKeyPaths:keyPaths];
	
	// Remove the comments and replace "MyFirstProperty" and "MySecondProperty" 
	// in the following line with a list of your view's KVC-compliant properties.
	NSArray *props = [NSArray arrayWithObjects:@"dictionary", @"entries", @"sortSelector", @"selectionIndexes", nil];
    [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray:props];
}

- (void)ibPopulateAttributeInspectorClasses:(NSMutableArray *)classes {
    [super ibPopulateAttributeInspectorClasses:classes];
    [classes addObject:[Oaxaca2IBInspector class]];
}

@end
