- misindented items in outline view
- switched window controller to use synchronous cibs.
- typo in cibloading.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-09-12 23:37:44 -07:00
parent 186adee0f2
commit dba418a93d
3 changed files with 22 additions and 51 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_
_itemInfosForItems = { };
_disclosureControlsForRows = [];
[self setIndentationPerLevel:25.0];
[self setIndentationPerLevel:16.0];
[self setIndentationMarkerFollowsDataView:YES];
[super setDataSource:[[_CPOutlineViewTableViewDataSource alloc] initWithOutlineView:self]];
@@ -327,7 +327,7 @@ var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_
- (CGRect)frameOfOutlineDataViewAtColumn:(CPInteger)aColumn row:(CPInteger)aRow
{
var frame = [super frameOfDataViewAtColumn:aColumn row:aRow],
indentationWidth = [self levelForRow:aRow] * [self indentationPerLevel] + (_disclosureControlPrototype ? _CGRectGetWidth([_disclosureControlPrototype frame]) : 0.0);
indentationWidth = ([self levelForRow:aRow] + 1) * [self indentationPerLevel];
frame.origin.x += indentationWidth;
frame.size.width -= indentationWidth;
+18 -47
View File
@@ -49,9 +49,6 @@
id _cibOwner;
CPString _windowCibName;
CPString _windowCibPath;
BOOL _isWindowLoading;
BOOL _shouldDisplayWindowWhenLoaded;
}
- (id)init
@@ -74,9 +71,6 @@
[self setShouldCloseDocument:NO];
[self setNextResponder:CPApp];
if (aWindow)
[self windowDidLoad];
}
return self;
@@ -127,36 +121,12 @@
/*!
Loads the window
*/
- (BOOL)loadWindow
- (void)loadWindow
{
if ([self isWindowLoaded])
return YES;
if (_window)
return;
if (![self isWindowLoading])
{
_isWindowLoading = YES;
[self windowWillLoad];
[CPBundle loadCibFile:[self windowCibPath]
externalNameTable:[CPDictionary dictionaryWithObject:_cibOwner forKey:CPCibOwner]
loadDelegate:self];
}
return NO;
}
- (void)cibDidFinishLoading:(CPCib)aCib
{
if (_window === nil && _document !== nil && _cibOwner === _document)
[self setWindow:[_document valueForKey:@"window"]];
[self synchronizeWindowTitleWithDocumentName];
[self windowDidLoad];
if (_shouldDisplayWindowWhenLoaded)
[self showWindow:self];
[[CPBundle bundleForClass:[_cibOwner class]] loadCibFile:[self windowCibPath] externalNameTable:[CPDictionary dictionaryWithObject:_cibOwner forKey:CPCibOwner]];
}
/*!
@@ -165,13 +135,6 @@
*/
- (@action)showWindow:(id)aSender
{
if (![self loadWindow])
{
_shouldDisplayWindowWhenLoaded = YES;
return;
}
var theWindow = [self window];
if ([theWindow respondsToSelector:@selector(becomesKeyOnlyIfNeeded)] && [theWindow becomesKeyOnlyIfNeeded])
@@ -189,18 +152,26 @@
return _window !== nil;
}
- (BOOL)isWindowLoading
{
return _isWindowLoading;
}
/*!
Returns the window this object controls.
*/
- (CPWindow)window
{
if (!_window)
[self loadWindow];
{
[self windowWillLoad];
[_document windowControllerWillLoadCib:self];
[self loadWindow];
if (_window === nil && _document !== nil && _cibOwner === _document)
[self setWindow:[_document valueForKey:@"window"]];
[self windowDidLoad];
[_document windowControllerDidLoadCib:self];
[self synchronizeWindowTitleWithDocumentName];
}
return _window;
}
+2 -2
View File
@@ -56,9 +56,9 @@ var LoadInfoForCib = {};
[self loadCibFile:path externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner]];
}
- (void)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable loadDelegate:(id)aDelegate
- (void)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable
{
[[[CPCib alloc] initWithCibNamed:aFileName bundle:self] instantiateCibWithExternalNameTable:aNameTable];
[[[CPCib alloc] initWithContentsOfURL:aFileName] instantiateCibWithExternalNameTable:aNameTable];
}
+ (void)loadCibFile:(CPString)anAbsolutePath externalNameTable:(CPDictionary)aNameTable loadDelegate:aDelegate