Handle the clear command in a ChatView

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@75 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mark Johnson
2006-11-09 01:01:51 +00:00
parent 20922a1cf1
commit c8d5239edc
@@ -95,8 +95,9 @@ public class ChatView extends BContainer
public void setChatButton (BButton button) public void setChatButton (BButton button)
{ {
_incont.add(button, GroupLayout.FIXED); _inBtn = button;
button.addListener(_inlist); _incont.add(_inBtn, GroupLayout.FIXED);
_inBtn.addListener(_inlist);
} }
/** /**
@@ -110,6 +111,9 @@ public class ChatView extends BContainer
// documentation inherited from interface ChatDisplay // documentation inherited from interface ChatDisplay
public void clear () public void clear ()
{ {
if (_input.hasFocus() || _inBtn.hasFocus()) {
_text.clearText();
}
} }
// documentation inherited from interface ChatDisplay // documentation inherited from interface ChatDisplay
@@ -198,4 +202,5 @@ public class ChatView extends BContainer
protected BTextArea _text; protected BTextArea _text;
protected BContainer _incont; protected BContainer _incont;
protected BTextField _input; protected BTextField _input;
protected BButton _inBtn;
} }