Author: mlytwyn
Date: Fri Mar  6 02:10:09 2015
New Revision: 38383

URL: http://svn.gna.org/viewcvs/gnustep?rev=38383&view=rev
Log:
Add menu event processing for table cell(s)

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

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=38383&r1=38382&r2=38383&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     Fri Mar 
 6 02:10:09 2015
@@ -7039,6 +7039,31 @@
   return(NSNotFound);
 }
 
+- (NSMenu *)menuForEvent:(NSEvent *)event
+{
+  NSPoint eventPoint = [event locationInWindow];
+  NSPoint viewPoint  = [self convertPoint:eventPoint fromView:nil];
+  NSUInteger row     = [self rowAtPoint:viewPoint];
+  NSUInteger col     = [self columnAtPoint:viewPoint];
+  
+  if ((row != -1) && (col != -1))
+  {
+    NSCell *cell = [self preparedCellAtColumn:col row:row];
+    
+    // If there is a defined cell at row,col...
+    if (cell)
+    {
+      NSMenu *menu = [cell menu];
+      // If we found a menu...
+      if (menu)
+        return(menu);
+    }
+  }
+  
+  // else pass it on...
+  return([super menuForEvent:event]);
+}
+
 @end /* implementation of NSTableView */
 
 @implementation NSTableView (SelectionHelper)


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

Reply via email to