mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:11:07 +00:00
Don't edit columns which are not editable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7459 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
16fd608dd2
commit
10ad22071d
1 changed files with 20 additions and 7 deletions
|
@ -1426,6 +1426,7 @@ byExtendingSelection: (BOOL)flag
|
|||
NSPoint location = [theEvent locationInWindow];
|
||||
NSTableColumn *tb;
|
||||
int clickCount;
|
||||
BOOL shouldEdit;
|
||||
|
||||
//
|
||||
// Pathological case -- ignore mouse down
|
||||
|
@ -1765,20 +1766,32 @@ byExtendingSelection: (BOOL)flag
|
|||
if ([self isRowSelected: _clickedRow] == NO)
|
||||
return;
|
||||
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(tableView:shouldEditTableColumn:row:)])
|
||||
tb = [_tableColumns objectAtIndex: _clickedColumn];
|
||||
|
||||
shouldEdit = YES;
|
||||
|
||||
if ([tb isEditable] == NO)
|
||||
{
|
||||
shouldEdit = NO;
|
||||
}
|
||||
else if ([_delegate respondsToSelector:
|
||||
@selector(tableView:shouldEditTableColumn:row:)])
|
||||
{
|
||||
tb = [_tableColumns objectAtIndex: _clickedColumn];
|
||||
if ([_delegate tableView: self shouldEditTableColumn: tb
|
||||
row: _clickedRow] == NO)
|
||||
{
|
||||
// Send double-action but don't edit
|
||||
[self sendAction: _doubleAction to: _target];
|
||||
return;
|
||||
shouldEdit = NO;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldEdit == NO)
|
||||
{
|
||||
// Send double-action but don't edit
|
||||
[self sendAction: _doubleAction to: _target];
|
||||
return;
|
||||
}
|
||||
|
||||
// Delegate said its OK to edit column. Go on, do it.
|
||||
// It is OK to edit column. Go on, do it.
|
||||
[self editColumn: _clickedColumn row: _clickedRow
|
||||
withEvent: theEvent select: NO];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue