Created
October 27, 2009 02:34
-
-
Save furusystems/219248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #if PLATFORM(DOM) | |
var CPTextViewDOMInputElement = nil; | |
// #endif | |
@implementation CPTextView : CPTextField | |
{ | |
} | |
/* @ignore */ | |
#if PLATFORM(DOM) | |
- (DOMElement)_inputElement | |
{ | |
if(!CPTextViewDOMInputElement){ | |
[super _inputElement]; // make the parent create it's input element an attach all the listeners. | |
CPTextViewDOMInputElement = document.createElement("textarea"); | |
CPTextViewDOMInputElement.style.resize = "none"; | |
CPTextViewDOMInputElement.style.overflow = "hidden"; | |
CPTextViewDOMInputElement.style.position = "absolute"; | |
CPTextViewDOMInputElement.style.border = "0px"; | |
CPTextViewDOMInputElement.style.padding = "0px"; | |
CPTextViewDOMInputElement.style.margin = "0px"; | |
CPTextViewDOMInputElement.style.whiteSpace = "pre"; | |
CPTextViewDOMInputElement.style.background = "transparent"; | |
CPTextViewDOMInputElement.style.outline = "none"; | |
} | |
return CPTextViewDOMInputElement; | |
} | |
#endif | |
// @override stringValue | |
- (CPString) stringValue | |
{ | |
if(CPTextViewDOMInputElement){ | |
return CPTextViewDOMInputElement.value; // override return value. | |
} | |
return [super stringValue]; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #if PLATFORM(DOM) | |
var CPTextViewDOMInputElement = nil; | |
// #endif | |
@implementation CPTextView : CPTextField | |
{ | |
} | |
/* @ignore */ | |
#if PLATFORM(DOM) | |
- (DOMElement)_inputElement | |
{ | |
if(!CPTextViewDOMInputElement){ | |
[super _inputElement]; // make the parent create it's input element an attach all the listeners. | |
CPTextViewDOMInputElement = document.createElement("textarea"); | |
CPTextViewDOMInputElement.style.resize = "none"; | |
CPTextViewDOMInputElement.style.overflow = "hidden"; | |
CPTextViewDOMInputElement.style.position = "absolute"; | |
CPTextViewDOMInputElement.style.border = "0px"; | |
CPTextViewDOMInputElement.style.padding = "0px"; | |
CPTextViewDOMInputElement.style.margin = "0px"; | |
CPTextViewDOMInputElement.style.whiteSpace = "pre"; | |
CPTextViewDOMInputElement.style.background = "transparent"; | |
CPTextViewDOMInputElement.style.outline = "none"; | |
} | |
return CPTextViewDOMInputElement; | |
} | |
#endif | |
// @override setObjectValue | |
- (void)setObjectValue:(id)aValue | |
{ | |
if(CPTextViewDOMInputElement){ | |
aValue = CPTextViewDOMInputElement.value; | |
} | |
[super setObjectValue:aValue]; // bubble up. | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment