(-keyDown:): When the user selects a cell by typing a partial name, make sure all other cells are deselected.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19090 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-04-13 22:42:30 +00:00
parent f7d73e0eca
commit 3b4a1570d4
2 changed files with 33 additions and 19 deletions

View file

@ -1,3 +1,9 @@
2004-04-14 00:36 Alexander Malmberg <alexander@malmberg.org>
* Source/NSBrowser.m (-keyDown:): When the user selects a cell
by typing a partial name, make sure all other cells are
deselected.
2004-04-13 Quentin Mathe <qmathe@club-internet.fr>
* Source/NSToolbarItem.m:

View file

@ -2254,6 +2254,7 @@ static NSTextFieldCell *titleCell;
NSMatrix *matrix;
NSString *sv;
int i, n, s;
int match;
int selectedColumn;
SEL lcarcSel = @selector(loadedCellAtRow:column:);
IMP lcarc = [self methodForSelector: lcarcSel];
@ -2301,20 +2302,20 @@ static NSTextFieldCell *titleCell;
&& ([sv hasPrefix: _charBuffer]))
return;
for (i = s+1; i < n; i++)
match = -1;
for (i = s + 1; i < n; i++)
{
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
stringValue];
if (([sv length] > 0)
&& ([sv hasPrefix: _charBuffer]))
{
[self selectRow: i
inColumn: selectedColumn];
[matrix scrollCellToVisibleAtRow: i column: 0];
[matrix performClick: self];
return;
match = i;
break;
}
}
if (i == n)
{
for (i = 0; i < s; i++)
{
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
@ -2322,14 +2323,21 @@ static NSTextFieldCell *titleCell;
if (([sv length] > 0)
&& ([sv hasPrefix: _charBuffer]))
{
[self selectRow: i
match = i;
break;
}
}
}
if (match != -1)
{
[matrix deselectAllCells];
[self selectRow: match
inColumn: selectedColumn];
[matrix scrollCellToVisibleAtRow: i column: 0];
[matrix scrollCellToVisibleAtRow: match column: 0];
[matrix performClick: self];
return;
}
}
}
_lastKeyPressed = 0.;
}