private void expand() { resize(new Coord(sz.x, 100)); setcanfocus(true); if (sel != null) sel.show(); chansel.show(); expanded = true; }
private void contract() { resize(new Coord(sz.x, 50)); setcanfocus(false); if (sel != null) sel.hide(); chansel.hide(); expanded = false; }
public void cdestroy(Widget w) { if (w instanceof Channel) { Channel chan = (Channel) w; if (chan == sel) sel = null; chansel.rm(chan); } }
public void newchild(Widget w) { if (w instanceof Channel) { Channel chan = (Channel) w; select(chan); chansel.add(chan); if (!expanded) chan.hide(); } }
public ChatUI(Coord c, int w, Widget parent) { super(c.add(0, -50), new Coord(w, 50), parent); chansel = new Selector(Coord.z, new Coord(selw, sz.y)); chansel.hide(); base = c; setfocusctl(true); setcanfocus(false); }
public boolean keydown(KeyEvent ev) { boolean M = (ev.getModifiersEx() & (KeyEvent.META_DOWN_MASK | KeyEvent.ALT_DOWN_MASK)) != 0; if (qline != null) { if (M && (ev.getKeyCode() == KeyEvent.VK_UP)) { Channel prev = this.sel; while (chansel.up()) { if (this.sel instanceof EntryChannel) break; } if (!(this.sel instanceof EntryChannel)) { select(prev); return (true); } qline = new QuickLine((EntryChannel) sel); return (true); } else if (M && (ev.getKeyCode() == KeyEvent.VK_DOWN)) { Channel prev = this.sel; while (chansel.down()) { if (this.sel instanceof EntryChannel) break; } if (!(this.sel instanceof EntryChannel)) { select(prev); return (true); } qline = new QuickLine((EntryChannel) sel); return (true); } qline.key(ev); return (true); } else { if (M && (ev.getKeyCode() == KeyEvent.VK_UP)) { chansel.up(); return (true); } else if (M && (ev.getKeyCode() == KeyEvent.VK_DOWN)) { chansel.down(); return (true); } return (super.keydown(ev)); } }
public void resize(Coord sz) { super.resize(sz); this.c = base.add(0, -this.sz.y); chansel.resize(new Coord(selw, this.sz.y)); if (sel != null) sel.resize(new Coord(this.sz.x - selw, this.sz.y)); }