From 2f8cd7600be2e85fe27bda04862aceff86b38e30 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 1 Aug 2012 22:50:16 +0000 Subject: - Remove all BWToolKit elements from the Content Filter Manager, replacing with SPSplitView and equivalents - Update localisable strings --- Source/SPContentFilterManager.h | 5 ++--- Source/SPContentFilterManager.m | 34 ++++++---------------------------- 2 files changed, 8 insertions(+), 31 deletions(-) (limited to 'Source') diff --git a/Source/SPContentFilterManager.h b/Source/SPContentFilterManager.h index 88eda63c..17ed782f 100644 --- a/Source/SPContentFilterManager.h +++ b/Source/SPContentFilterManager.h @@ -30,8 +30,8 @@ // // More info at -@class BWAnchoredButtonBar; @class SPDatabaseDocument; +@class SPSplitView; @interface NSObject (SPContentFilterManagerDelegate) @@ -57,14 +57,13 @@ IBOutlet id contentFilterConjunctionTextField; IBOutlet id contentFilterConjunctionLabel; IBOutlet id contentFilterTextView; + IBOutlet SPSplitView *contentFilterSplitView; IBOutlet id removeButton; IBOutlet id numberOfArgsLabel; IBOutlet id resultingClauseLabel; IBOutlet id resultingClauseContentLabel; IBOutlet id insertPlaceholderButton; IBOutlet NSButton *suppressLeadingFiledPlaceholderCheckbox; - - IBOutlet BWAnchoredButtonBar *splitViewButtonBar; IBOutlet id contentFilterArrayController; diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 7ac36649..4bfb399e 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -37,10 +37,7 @@ #import "SPQueryDocumentsController.h" #import "SPTableContent.h" #import "SPConnectionController.h" - -#ifndef SP_REFACTOR /* headers */ -#import -#endif +#import "SPSplitView.h" #define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]") #define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]") @@ -89,6 +86,11 @@ */ - (void)awakeFromNib { + + // Set up the split view + [contentFilterSplitView setMinSize:120.f ofSubviewAtIndex:0]; + [contentFilterSplitView setMaxSize:245.f ofSubviewAtIndex:0]; + // Add global group row to contentFilters [contentFilters addObject:[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"Global",@"Content Filter Manager : Filter Entry List: 'Global' Header"), @"MenuLabel", @@ -151,11 +153,6 @@ // Set column header [[[contentFilterTableView tableColumnWithIdentifier:@"MenuLabel"] headerCell] setStringValue:[NSString stringWithFormat:NSLocalizedString(@"‘%@’ Fields Content Filters", @"table column header. Read: 'Showing all content filters for fields of type %@' (ContentFilterManager)"), filterType]]; - -#ifndef SP_REFACTOR /* split view delegate */ - // Set the button delegate - [splitViewButtonBar setSplitViewDelegate:self]; -#endif } #pragma mark - @@ -408,25 +405,6 @@ [contentFilterTextView insertText:@""]; } -#pragma mark - -#pragma mark SplitView delegate methods - -/** - * Return the maximum possible size of the splitview. - */ -- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset -{ - return (proposedMax - 245); -} - -/** - * Return the minimum possible size of the splitview. - */ -- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset -{ - return (proposedMin + 120); -} - #pragma mark - #pragma mark TableView delegate methods -- cgit v1.2.3