mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:10:47 +00:00
Fixed column for point when point lies on the column boundary;
unselect an already selected row on click only if shift is pressed git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8910 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1b83d41f35
commit
cd0f252a86
1 changed files with 12 additions and 7 deletions
|
@ -1451,8 +1451,12 @@ byExtendingSelection: (BOOL)flag
|
||||||
if (clickCount == 1)
|
if (clickCount == 1)
|
||||||
{
|
{
|
||||||
SEL selector;
|
SEL selector;
|
||||||
|
unsigned int modifiers;
|
||||||
|
modifiers = [theEvent modifierFlags];
|
||||||
|
|
||||||
if ([self isRowSelected: _clickedRow] == YES)
|
/* Unselect a selected row if the shift key is pressed */
|
||||||
|
if ([self isRowSelected: _clickedRow] == YES
|
||||||
|
&& (modifiers & NSShiftKeyMask))
|
||||||
{
|
{
|
||||||
if (([_selectedRows count] == 1) && (_allowsEmptySelection == NO))
|
if (([_selectedRows count] == 1) && (_allowsEmptySelection == NO))
|
||||||
return;
|
return;
|
||||||
|
@ -1477,11 +1481,8 @@ byExtendingSelection: (BOOL)flag
|
||||||
}
|
}
|
||||||
else // row is not selected
|
else // row is not selected
|
||||||
{
|
{
|
||||||
unsigned int modifiers;
|
|
||||||
BOOL newSelection;
|
BOOL newSelection;
|
||||||
|
|
||||||
modifiers = [theEvent modifierFlags];
|
|
||||||
|
|
||||||
if ((modifiers & (NSShiftKeyMask | NSAlternateKeyMask))
|
if ((modifiers & (NSShiftKeyMask | NSAlternateKeyMask))
|
||||||
&& _allowsMultipleSelection)
|
&& _allowsMultipleSelection)
|
||||||
newSelection = NO;
|
newSelection = NO;
|
||||||
|
@ -1912,12 +1913,14 @@ byExtendingSelection: (BOOL)flag
|
||||||
- (int) columnAtPoint: (NSPoint)aPoint
|
- (int) columnAtPoint: (NSPoint)aPoint
|
||||||
{
|
{
|
||||||
if ((NSMouseInRect (aPoint, _bounds, YES)) == NO)
|
if ((NSMouseInRect (aPoint, _bounds, YES)) == NO)
|
||||||
return -1;
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while ((aPoint.x > _columnOrigins[i]) && (i < _numberOfColumns))
|
while ((aPoint.x >= _columnOrigins[i]) && (i < _numberOfColumns))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -1929,7 +1932,9 @@ byExtendingSelection: (BOOL)flag
|
||||||
{
|
{
|
||||||
/* NB: Y coordinate system is flipped in NSTableView */
|
/* NB: Y coordinate system is flipped in NSTableView */
|
||||||
if ((NSMouseInRect (aPoint, _bounds, YES)) == NO)
|
if ((NSMouseInRect (aPoint, _bounds, YES)) == NO)
|
||||||
return -1;
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int return_value;
|
int return_value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue