Revision: 18315
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18315&view=rev
Author:   hofman
Date:     2011-12-14 12:56:57 +0000 (Wed, 14 Dec 2011)
Log Message:
-----------
hit cell hit test to determine editing of editor text field rather than probing 
cell field specifics

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditorTableView.m
    trunk/bibdesk/BDSKEditorTextFieldCell.m

Modified: trunk/bibdesk/BDSKEditorTableView.m
===================================================================
--- trunk/bibdesk/BDSKEditorTableView.m 2011-12-14 07:36:04 UTC (rev 18314)
+++ trunk/bibdesk/BDSKEditorTableView.m 2011-12-14 12:56:57 UTC (rev 18315)
@@ -37,7 +37,6 @@
  */
 
 #import "BDSKEditorTableView.h"
-#import "BDSKEditorTextFieldCell.h"
 
 
 @interface NSTableView (BDSKApplePrivate)
@@ -60,11 +59,11 @@
         BOOL isEditable = [tableColumn isEditable] && 
                 ([[self delegate] 
respondsToSelector:@selector(tableView:shouldEditTableColumn:row:)] == NO || 
                  [[self delegate] tableView:self 
shouldEditTableColumn:tableColumn row:clickedRow]);
-        if ([cell respondsToSelector:@selector(buttonRectForBounds:)] &&
-            NSMouseInRect(location, [cell buttonRectForBounds:cellFrame], 
[self isFlipped])) {
+        NSUInteger hit = [cell hitTestForEvent:theEvent inRect:cellFrame 
ofView:self];
+        if ((hit & NSCellHitTrackableArea)) {
             if ([theEvent clickCount] > 1)
                 theEvent = [NSEvent mouseEventWithType:[theEvent type] 
location:[theEvent locationInWindow] modifierFlags:[theEvent modifierFlags] 
timestamp:[theEvent timestamp] windowNumber:[theEvent windowNumber] 
context:[theEvent context] eventNumber:[theEvent eventNumber] clickCount:1 
pressure:[theEvent pressure]];
-        } else if ([cell isKindOfClass:[NSTextFieldCell class]] && isEditable) 
{
+        } else if ((hit & NSCellHitEditableTextArea) && isEditable) {
             if ([[self window] makeFirstResponder:nil]) {
                 [self selectRowIndexes:[NSIndexSet 
indexSetWithIndex:clickedRow] byExtendingSelection:NO];
                 [self editColumn:clickedColumn row:clickedRow 
withEvent:theEvent select:NO];

Modified: trunk/bibdesk/BDSKEditorTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKEditorTextFieldCell.m     2011-12-14 07:36:04 UTC (rev 
18314)
+++ trunk/bibdesk/BDSKEditorTextFieldCell.m     2011-12-14 12:56:57 UTC (rev 
18315)
@@ -96,6 +96,8 @@
     NSPoint mouseLoc = [controlView convertPoint:[event locationInWindow] 
fromView:nil];
     if (NSMouseInRect(mouseLoc, buttonRect, [controlView isFlipped]))
         hit = NSCellHitContentArea | NSCellHitTrackableArea;
+    else if ([self isEditable])
+        hit |= NSCellHitEditableTextArea;
     return hit;
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to