Revision: 21918
          http://sourceforge.net/p/bibdesk/svn/21918
Author:   hofman
Date:     2018-02-13 17:22:44 +0000 (Tue, 13 Feb 2018)
Log Message:
-----------
Select all text in address field when selecting the control

Modified Paths:
--------------
    trunk/bibdesk/BDSKAddressTextFieldCell.m

Modified: trunk/bibdesk/BDSKAddressTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKAddressTextFieldCell.m    2018-02-13 16:07:32 UTC (rev 
21917)
+++ trunk/bibdesk/BDSKAddressTextFieldCell.m    2018-02-13 17:22:44 UTC (rev 
21918)
@@ -111,8 +111,15 @@
     [super editWithFrame:[self adjustedFrame:aRect inView:controlView] 
inView:controlView editor:textObj delegate:anObject event:theEvent];
 }
 
+- (void)selectAllTextWithEditor:(NSText *)textObj {
+    if ([textObj selectedRange].length == 0)
+        [textObj setSelectedRange:NSMakeRange(0, [[textObj string] length])];
+}
+
 - (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView 
editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart 
length:(NSInteger)selLength {
     [super selectWithFrame:[self adjustedFrame:aRect inView:controlView] 
inView:controlView editor:textObj delegate:anObject start:selStart 
length:selLength];
+    if ([[self stringValue] length])
+        [self performSelector:@selector(selectAllTextWithEditor:) 
withObject:textObj afterDelay:0];
 }
 
 @end

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to