summaryrefslogtreecommitdiffstats
path: root/tksao/frame/box.C
diff options
context:
space:
mode:
Diffstat (limited to 'tksao/frame/box.C')
-rw-r--r--tksao/frame/box.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/tksao/frame/box.C b/tksao/frame/box.C
index e6362b7..a6ca971 100644
--- a/tksao/frame/box.C
+++ b/tksao/frame/box.C
@@ -42,6 +42,33 @@ Box::Box(Base* p, const Vector& ctr,
updateBBox();
}
+void Box::renderXDraw(Drawable drawable, GC lgc, XPoint* pp)
+{
+ if (fill_)
+ XFillPolygon(display, drawable, lgc, pp, numPoints_, Convex, CoordModeOrigin);
+ else
+ XDrawLines(display, drawable, lgc, pp, numPoints_, CoordModeOrigin);
+}
+
+void Box::renderPSDraw(int ii)
+{
+ ostringstream str;
+ for (int jj=0; jj<numPoints_; jj++) {
+ Vector v = parent->mapFromRef(vertices_[ii][jj],Coord::CANVAS);
+ if (jj==0)
+ str << "newpath "
+ << v.TkCanvasPs(parent->canvas) << " moveto" << endl;
+ else
+ str << v.TkCanvasPs(parent->canvas) << " lineto" << endl;
+ }
+ if (fill_)
+ str << "fill" << endl << ends;
+ else
+ str << "stroke" << endl << ends;
+
+ Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
+}
+
void Box::editBegin(int h)
{
switch (h) {