mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 06:50:48 +00:00
Fix up for change in NSBrowser
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14419 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a01856e889
commit
d09d2a20e3
4 changed files with 42 additions and 82 deletions
|
@ -519,55 +519,6 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
return self;
|
||||
}
|
||||
@end
|
||||
//
|
||||
// NSOpenPanel browser delegate methods
|
||||
//
|
||||
@interface NSOpenPanel (_BrowserDelegate)
|
||||
- (BOOL) browser: (NSBrowser *)sender
|
||||
selectCellWithString: (NSString *)title
|
||||
inColumn: (int)column;
|
||||
@end
|
||||
|
||||
@implementation NSOpenPanel (_BrowserDelegate)
|
||||
- (BOOL) browser: (NSBrowser *)sender
|
||||
selectCellWithString: (NSString *)title
|
||||
inColumn: (int)column
|
||||
{
|
||||
NSMatrix *m;
|
||||
NSArray *c;
|
||||
BOOL isLeaf;
|
||||
|
||||
m = [_browser matrixInColumn: column];
|
||||
c = [m selectedCells];
|
||||
|
||||
if ([c count] == 1)
|
||||
{
|
||||
isLeaf = [[c objectAtIndex: 0] isLeaf];
|
||||
|
||||
if (_canChooseDirectories == NO)
|
||||
{
|
||||
[_okButton setEnabled: isLeaf];
|
||||
return [super browser: sender
|
||||
selectCellWithString: title
|
||||
inColumn: column];
|
||||
}
|
||||
else // _canChooseDirectories
|
||||
{
|
||||
BOOL ret;
|
||||
ret = [super browser: sender
|
||||
selectCellWithString: title
|
||||
inColumn: column];
|
||||
if (isLeaf == NO)
|
||||
ASSIGN (_fullFileName, _directory);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
else // Multiple Selection, and it is not the first item of the selection
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
//
|
||||
// NSForm delegate methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue