Revision: 18276
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18276&view=rev
Author:   hofman
Date:     2011-12-03 11:19:36 +0000 (Sat, 03 Dec 2011)
Log Message:
-----------
move delegate method for dragging source to BDSKAddressTextField

Modified Paths:
--------------
    trunk/bibdesk/BDSKAddressTextField.h
    trunk/bibdesk/BDSKAddressTextField.m
    trunk/bibdesk/BDSKDragTextField.h
    trunk/bibdesk/BDSKWebGroupViewController.m

Modified: trunk/bibdesk/BDSKAddressTextField.h
===================================================================
--- trunk/bibdesk/BDSKAddressTextField.h        2011-12-03 10:58:18 UTC (rev 
18275)
+++ trunk/bibdesk/BDSKAddressTextField.h        2011-12-03 11:19:36 UTC (rev 
18276)
@@ -39,6 +39,7 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKDragTextField.h"
 
+@protocol BDSKAddressTextFieldDelegate;
 
 @interface BDSKAddressTextField : BDSKDragTextField {
     NSButton *button;
@@ -46,4 +47,15 @@
 
 - (NSButton *)button;
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+- (id <BDSKAddressTextFieldDelegate>)delegate;
+- (void)setDelegate:(id <BDSKAddressTextFieldDelegate>)newDelegate;
+#endif
+
 @end
+
+
+@protocol BDSKAddressTextFieldDelegate <BDSKDragTextFieldDelegate>
+@optional
+- (BOOL)addressTextField:(BDSKAddressTextField *)textField 
writeDataToPasteboard:(NSPasteboard *)pasteboard;
+@end

Modified: trunk/bibdesk/BDSKAddressTextField.m
===================================================================
--- trunk/bibdesk/BDSKAddressTextField.m        2011-12-03 10:58:18 UTC (rev 
18275)
+++ trunk/bibdesk/BDSKAddressTextField.m        2011-12-03 11:19:36 UTC (rev 
18276)
@@ -148,7 +148,7 @@
 }
 
 - (void)mouseDown:(NSEvent *)theEvent {
-    if ([[self delegate] 
respondsToSelector:@selector(dragTextField:writeDataToPasteboard:)]) {
+    if ([[self delegate] 
respondsToSelector:@selector(addressTextField:writeDataToPasteboard:)]) {
         NSRect iconRect = [[self cell] iconRectForBounds:[self bounds]];
         NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] 
fromView:nil];
         if (NSMouseInRect(mouseLoc, iconRect, [self isFlipped])) {
@@ -157,7 +157,7 @@
             if (NSLeftMouseDragged == [nextEvent type]) {
                 NSPasteboard *pboard = [NSPasteboard 
pasteboardWithName:NSDragPboard];
                 
-                if ([[self delegate] dragTextField:self 
writeDataToPasteboard:pboard]) {
+                if ([[self delegate] addressTextField:self 
writeDataToPasteboard:pboard]) {
                
                     NSImage *dragImage = nil;
                     NSSize imageSize = NSZeroSize;
@@ -188,6 +188,11 @@
     [super mouseDown:theEvent];
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+- (id <BDSKAddressTextFieldDelegate>)delegate { return (id 
<BDSKAddressTextFieldDelegate>)[super delegate]; }
+- (void)setDelegate:(id <BDSKAddressTextFieldDelegate>)newDelegate { [super 
setDelegate:newDelegate]; }
+#endif
+
 @end
 
 

Modified: trunk/bibdesk/BDSKDragTextField.h
===================================================================
--- trunk/bibdesk/BDSKDragTextField.h   2011-12-03 10:58:18 UTC (rev 18275)
+++ trunk/bibdesk/BDSKDragTextField.h   2011-12-03 11:19:36 UTC (rev 18276)
@@ -44,7 +44,6 @@
 @optional
 - (NSDragOperation)dragTextField:(BDSKDragTextField *)textField 
validateDrop:(id <NSDraggingInfo>)sender;
 - (BOOL)dragTextField:(BDSKDragTextField *)textField acceptDrop:(id 
<NSDraggingInfo>)sender;
-- (BOOL)dragTextField:(BDSKDragTextField *)textField 
writeDataToPasteboard:(NSPasteboard *)pasteboard;
 @end
 
 

Modified: trunk/bibdesk/BDSKWebGroupViewController.m
===================================================================
--- trunk/bibdesk/BDSKWebGroupViewController.m  2011-12-03 10:58:18 UTC (rev 
18275)
+++ trunk/bibdesk/BDSKWebGroupViewController.m  2011-12-03 11:19:36 UTC (rev 
18276)
@@ -252,7 +252,7 @@
     return NO;
 }
 
-- (BOOL)dragTextField:(BDSKDragTextField *)textField 
writeDataToPasteboard:(NSPasteboard *)pboard {
+- (BOOL)addressTextField:(BDSKAddressTextField *)textField 
writeDataToPasteboard:(NSPasteboard *)pboard {
     NSURL *url = [[self webView] URL];
     if (url) {
         [pboard declareTypes:[NSArray arrayWithObjects:NSURLPboardType, 
BDSKWeblocFilePboardType, nil] owner:nil];

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to