public void draw(GOut g) { g.chcolor(0, 0, 0, 160); if (ctl == null || csz == null) { return; } g.frect(ctl, csz); g.chcolor(); cdraw(g.reclip(xlate(Coord.z, true), asz)); if (cap != null) { topless.draw(g, new Coord(0, th), sz.sub(0, th)); g.image(tleft, Coord.z); Coord tmul = new Coord(tleft.sz().x, tdh); Coord tmbr = new Coord(sz.x - tright.sz().x, th); for (int x = tmul.x; x < tmbr.x; x += tmain.sz().x) { g.image(tmain, new Coord(x, tdh), tmul, tmbr); } g.image(tright, new Coord(sz.x - tright.sz().x, tdh)); g.image(cap.tex(), capc.sub(0, cap.sz().y)); } else { wbox.draw(g, Coord.z, sz); } /* if(cap != null) { GOut cg = og.reclip(new Coord(0, -7), sz.add(0, 7)); int w = cap.tex().sz().x; cg.image(cl, new Coord((sz.x / 2) - (w / 2) - cl.sz().x, 0)); cg.image(cm, new Coord((sz.x / 2) - (w / 2), 0), new Coord(w, cm.sz().y)); cg.image(cr, new Coord((sz.x / 2) + (w / 2), 0)); cg.image(cap.tex(), new Coord((sz.x / 2) - (w / 2), 0)); } */ super.draw(g); }
public void resize(Coord sz) { IBox box; int th; if (cap == null) { box = wbox; th = 0; } else { box = topless; th = Window.th; } sz = sz.add(box.bisz()).add(0, th).add(mrgn.mul(2)); this.sz = sz; ctl = box.btloff().add(0, th); csz = sz.sub(box.bisz()).sub(0, th); atl = ctl.add(mrgn); asz = csz.sub(mrgn.mul(2)); ac = new Coord(); // ac = tlo.add(wbox.btloff()).add(mrgn); placetwdgs(); for (Widget ch = child; ch != null; ch = ch.next) ch.presize(); }