Пример #1
0
 private void expand() {
   resize(new Coord(sz.x, 100));
   setcanfocus(true);
   if (sel != null) sel.show();
   chansel.show();
   expanded = true;
 }
Пример #2
0
 private void contract() {
   resize(new Coord(sz.x, 50));
   setcanfocus(false);
   if (sel != null) sel.hide();
   chansel.hide();
   expanded = false;
 }
Пример #3
0
 public void cdestroy(Widget w) {
   if (w instanceof Channel) {
     Channel chan = (Channel) w;
     if (chan == sel) sel = null;
     chansel.rm(chan);
   }
 }
Пример #4
0
 public void newchild(Widget w) {
   if (w instanceof Channel) {
     Channel chan = (Channel) w;
     select(chan);
     chansel.add(chan);
     if (!expanded) chan.hide();
   }
 }
Пример #5
0
 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);
 }
Пример #6
0
 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));
   }
 }
Пример #7
0
 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));
 }