Author: dpsimons
Date: Thu Jul  2 18:11:58 2015
New Revision: 38739

URL: http://svn.gna.org/viewcvs/gnustep?rev=38739&view=rev
Log:
change click and double-click behavior related to editing of cells to match 
Cocoa

Modified:
    libs/gui/branches/gnustep_testplant_branch/ChangeLog
    libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m

Modified: libs/gui/branches/gnustep_testplant_branch/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/ChangeLog?rev=38739&r1=38738&r2=38739&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/ChangeLog        (original)
+++ libs/gui/branches/gnustep_testplant_branch/ChangeLog        Thu Jul  2 
18:11:58 2015
@@ -1,4 +1,12 @@
-2015-07-01  Doug Simons <[email protected]>
+2015-07-02  Doug Simons <[email protected]>
+
+       * Source/NSTableView.m: Changed click and double-click behavior
+       to match Cocoa: A single-click on an already-selected editable
+       cell will now begin editing. A double-click will send the
+       doubleAction if there is one, and only begin editing if there is
+       no doubleAction assigned.
+
+       2015-07-01  Doug Simons <[email protected]>
 
        * Source/NSTextStorage.m: Fixed a bug with setting _editedRange for
        multiple edits when the first one is a delete (which results in

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m?rev=38739&r1=38738&r2=38739&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     Thu Jul 
 2 18:11:58 2015
@@ -3717,6 +3717,16 @@
           // Check for grouped row...
           if ([self _isGroupRow: _clickedRow])
             theColumn = -1;
+                       
+                 // Check for single click on already-selected editable cell 
to begin editing
+                 if (clickCount == 1 && [self isRowSelected: _clickedRow] && 
[self _isCellEditableColumn: _clickedColumn row: _clickedRow ])
+                       {
+                         [self editColumn: _clickedColumn
+                           row: _clickedRow
+                     withEvent: theEvent
+                        select: YES];
+                         return;
+                       }
 
           // Application specific hit test processing is handled within the 
delegate's should select callbacks
           // if they're implemented...however - I'm not sure when this SHOULD 
be invoked...
@@ -3734,6 +3744,13 @@
           return;
         }
       
+         // If we have a doubleAction, send that on a double-click, even for 
editable cells
+          if (clickCount == 2 && _doubleAction != (SEL)0 && _clickedRow != -1)
+                   {
+                         [self sendAction: _doubleAction to: _target];
+                         return;
+                   }
+                       
       if (![self _isCellEditableColumn: _clickedColumn row: _clickedRow ])
         {
           // Send double-action but don't edit


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to