Moved chat controls here.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@320 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2007-10-30 19:07:23 +00:00
parent 7ac169ad97
commit bce057c307
2 changed files with 195 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
//
// $Id: ChatInput.as 4826 2007-06-20 20:07:25Z mdb $
package com.threerings.flex {
import flash.events.FocusEvent;
import mx.controls.TextInput;
/**
* A special TextInput for entering Chat. One of these is used in ChatControl.
*
* A standard TextInput has the stupid behavior of selecting all the text when it receives
* focus. Disable that so that we can receive focus and people can type and we don't blow away
* whatever they had before.
*/
public class ChatInput extends TextInput
{
public function ChatInput ()
{
styleName = "chatInput";
width = 175;
}
override protected function focusInHandler (event :FocusEvent) :void
{
var oldValue :Boolean = textField.selectable;
textField.selectable = false;
try {
super.focusInHandler(event);
} finally {
textField.selectable = oldValue;
}
}
}
}