discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView progress


From: Fred Kiefer
Subject: Re: NSTableView progress
Date: Wed, 03 May 2006 23:54:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060411

Hi Andreas,

could you actually explain why this selection of the row changes the
tabbing behaviour? Is teh important thing to stop the current editing
process? Would the following code at the beginning of the method do the
trich as well?
  if (_textObject != nil)
    {
      [self validateEditing];
      [self abortEditing];
    }

Or is it important that the current row gets selected? Or is it your own
delegate that wont allow a cell from a non-selected row to be selected?
I just want to understand why this resolves the problem to be able to
add a similar chang to the _editPrevious... method as well.

Cheers
Fred

Andreas Höschler wrote:
>>> Do you remember the pieces of code you added or
>>> modified for this
>>> feature? I assume pressing TAB in the last column of
>>> a row does the
>>> same!?
>>>
>>
>> in -textDidEndEditing i impleneted
>> NSReturnTextMovement
>> tab is implemented but i haven't tested it much.
>> I believe there are at least issues with
>> _editNext/Previous not selecting the newly edited row.
>>
> 
> I just implemented the following in NSTableView to make tabbing to the
> next row work:
> 
> - (BOOL)_editNextEditableCellAfterRow:(int)row column: (int)column
> {
>    int i, j;
> 
>    if (row > -1)
>      {
>       // First look for cells in the same row
>       for (j = column + 1; j < _numberOfColumns; j++)
>         {
>          if (_isCellEditable (_delegate, _tableColumns, self, row, j) ==
> YES)
>            {
>             [self editColumn: j  row: row  withEvent: nil  select: YES];
>             return YES;
>            }
>         }
>      }
>   // Otherwise, make the big cycle.
>    for (i = row + 1; i < _numberOfRows; i++)
>      {
>       [self selectRow:i byExtendingSelection:NO]; // <-- add this to
> make tabbing over row boundaries work
> 
>       for (j = 0; j < _numberOfColumns; j++)
>         {
>          if (_isCellEditable (_delegate, _tableColumns, self, i, j) == YES)
>            {
>             [self editColumn: j  row: i  withEvent: nil  select: YES];
>             NSLog(@"row YES editColumn: %d row: %d", j, i);
>             return YES;
>            }
>         }
>      }
>    return NO;
> }
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]