[26306] users/rhwood/Pallet/IFVerticallyExpandingTextField.m

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 19 03:12:24 PDT 2007


Revision: 26306
          http://trac.macosforge.org/projects/macports/changeset/26306
Author:   rhwood at macports.org
Date:     2007-06-19 03:12:24 -0700 (Tue, 19 Jun 2007)

Log Message:
-----------
Add methods to support bindings, although this class rips the selection from the bound object, making these worthless.

Modified Paths:
--------------
    users/rhwood/Pallet/IFVerticallyExpandingTextField.m

Modified: users/rhwood/Pallet/IFVerticallyExpandingTextField.m
===================================================================
--- users/rhwood/Pallet/IFVerticallyExpandingTextField.m	2007-06-19 10:10:38 UTC (rev 26305)
+++ users/rhwood/Pallet/IFVerticallyExpandingTextField.m	2007-06-19 10:12:24 UTC (rev 26306)
@@ -87,6 +87,10 @@
    }
 }
 
+- (void)bind:(NSString *)binding toObject:(id)observableController withKeyPath:(NSString *)keyPath options:(NSDictionary *)options {
+	[super bind:binding toObject:observableController withKeyPath:keyPath options:options];
+}
+
 - (void) setSuperviewsExpandOnGrowth: (BOOL)shouldExpand {
    superviewsExpandOnGrowth = shouldExpand;
 }
@@ -283,9 +287,10 @@
    }
 }
 
-
 /* Overridden methods */
 
+
+
 - (void) textDidChange: (NSNotification *)note {
    [self forceAutosize];
 }
@@ -295,18 +300,31 @@
 }
 
 - (void) setStringValue: (NSString *)aString {
-   NSTextView *myEditor = [self currentEditor];
-   
-   if (myEditor)
-      [myEditor setString: aString];
-   else
-      [super setStringValue: aString];
-   
-   // If we don't delay, autosizing won't display correctly
-   [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: .05]];
-   [self forceAutosize];
+	NSTextView *myEditor = [self currentEditor];
+	
+	if (myEditor)
+		[myEditor setString: aString];
+	else
+		[super setStringValue: aString];
+	
+	// If we don't delay, autosizing won't display correctly
+	[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: .05]];
+	[self forceAutosize];
 }
 
+- (void)setObjectValue:(id <NSCopying>)object {
+	NSTextView *myEditor = [self currentEditor];
+	
+	if (myEditor)
+		[myEditor setObjectValue:object];
+	else
+		[super setObjectValue:object];
+	
+	// If we don't delay, autosizing won't display correctly
+	[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: .05]];
+	[self forceAutosize];
+}
+
 - (void) setCollapsed: (BOOL)flag {
    if (isCollapsed != flag) {
       isCollapsed = flag;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070619/6fd4fd1a/attachment.html


More information about the macports-changes mailing list