A bit more crap.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3969 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.threerings.msoy.client {
|
||||
|
||||
import mx.containers.HBox;
|
||||
|
||||
import mx.controls.Button;
|
||||
import mx.controls.TextInput;
|
||||
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
public class ChatControl extends HBox
|
||||
{
|
||||
public function ChatControl (ctx :MsoyContext)
|
||||
{
|
||||
_ctx = ctx;
|
||||
|
||||
addChild(_txt = new TextInput());
|
||||
var but :Button = new Button();
|
||||
but.label = "Send"; // TODO: xlate
|
||||
addChild(but);
|
||||
|
||||
_txt.addEventListener(FlexEvent.ENTER, sendChat);
|
||||
but.addEventListener(FlexEvent.BUTTON_DOWN, sendChat);
|
||||
}
|
||||
|
||||
protected function sendChat (event :FlexEvent) :void
|
||||
{
|
||||
var message :String = _txt.text;
|
||||
_txt.text = "";
|
||||
_ctx.getChatDirector().requestChat(null, message, true);
|
||||
}
|
||||
|
||||
/** Our client-side context. */
|
||||
protected var _ctx :MsoyContext;
|
||||
|
||||
protected var _txt :TextInput;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,24 @@
|
||||
package com.threerings.msoy.client {
|
||||
|
||||
import mx.containers.VBox;
|
||||
|
||||
public class SimpleChatPanel extends VBox
|
||||
implements PlaceView
|
||||
{
|
||||
public function SimpleChatPanel (ctx :MsoyContext)
|
||||
{
|
||||
addChild(new ChatTextArea(ctx));
|
||||
addChild(new ChatControl(ctx));
|
||||
}
|
||||
|
||||
// documentation inherited from interface PlaceView
|
||||
public function willEnterPlace (plobj :PlaceObject) :void
|
||||
{
|
||||
}
|
||||
|
||||
// documentation inherited from interface PlaceView
|
||||
public function didLeavePlace (plobj :PlaceObject) :void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user