mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 23:31:02 +00:00
(-setSelectionFrom:to:anchor:highlight:): Update the selection related ivars after changing the selection.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1e848bde2d
commit
faf7070654
2 changed files with 30 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-03-27 23:52 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSMatrix.m (-setSelectionFrom:to:anchor:highlight:): Update
|
||||
the selection related ivars after changing the selection.
|
||||
|
||||
2003-03-27 Serg Stoyan <stoyan@on.com.ua>
|
||||
|
||||
* Source/NSMenuView.m:
|
||||
|
|
|
@ -1211,7 +1211,6 @@ static SEL getSel;
|
|||
startIndex: startPos
|
||||
endIndex: selStart-1];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1281,6 +1280,31 @@ static SEL getSel;
|
|||
endIndex: INDEX_FROM_COORDS(maxx_AS, miny_AE-1)];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Update the _selectedCell and related ivars. This could be optimized a lot
|
||||
in many cases, but the full search cannot be avoided in the general case,
|
||||
and being correct comes first.
|
||||
*/
|
||||
{
|
||||
int i, j;
|
||||
for (i = _numRows - 1; i >= 0; i--)
|
||||
{
|
||||
for (j = _numCols - 1; j >= 0; j--)
|
||||
{
|
||||
if (_selectedCells[i][j])
|
||||
{
|
||||
_selectedCell = _cells[i][j];
|
||||
_selectedRow = i;
|
||||
_selectedColumn = j;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
_selectedCell = nil;
|
||||
_selectedColumn = -1;
|
||||
_selectedRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
- (id) cellAtRow: (int)row
|
||||
|
|
Loading…
Reference in a new issue