Example #1
0
 public void wdgmsg(Widget sender, String msg, Object... args) {
   if (sender == cbtn) {
     wdgmsg("close");
   } else {
     super.wdgmsg(sender, msg, args);
   }
 }
Example #2
0
 public void resize(Coord sz) {
   super.resize(sz);
   if (sb != null) {
     sb.resize(ih());
     sb.move(new Coord(sz.x, 0));
     int y = 0;
     for (Message m : msgs) y += m.sz().y;
     boolean b = sb.val >= sb.max;
     sb.max = y - ih();
     if (b) sb.val = sb.max;
   }
   if (cbtn != null) cbtn.c = new Coord(sz.x - cbtn.sz.x - sb.sz.x - 3, 0);
 }
Example #3
0
 public void mousemove(Coord c) {
   if (selorig != null) {
     CharPos ch = charat(c);
     if ((ch != null) && !ch.equals(lasthit)) {
       lasthit = ch;
       if (!dragging && !ch.equals(selorig)) dragging = true;
       int o = poscmp.compare(selorig, ch);
       if (o < 0) {
         selstart = selorig;
         selend = ch;
       } else if (o > 0) {
         selstart = ch;
         selend = selorig;
       } else {
         selstart = selend = null;
       }
     }
   } else {
     super.mousemove(c);
   }
 }
Example #4
0
 public void draw(GOut g) {
   g.chcolor(24, 24, 16, 200);
   g.frect(Coord.z, sz);
   g.chcolor();
   int y = 0;
   boolean sel = false;
   synchronized (msgs) {
     for (Message msg : msgs) {
       if ((selstart != null) && (msg == selstart.msg)) sel = true;
       int y1 = y - sb.val;
       int y2 = y1 + msg.sz().y;
       if ((y2 > 0) && (y1 < ih())) {
         if (sel) drawsel(g, msg, y1);
         g.image(msg.tex(), new Coord(0, y1));
       }
       if ((selend != null) && (msg == selend.msg)) sel = false;
       y += msg.sz().y;
     }
   }
   sb.max = y - ih();
   super.draw(g);
 }
Example #5
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));
 }