public override void DrawTemporary(Graphics g, Rectangle r, int offx, int offy, Rectangle pagepiece)
        {
            switch (action)
            {
            case MouseAction.Select:
                g.DrawRectangle(Pens.Blue, selrect.X + r.X - offx, selrect.Y + r.Y - offy, selrect.Width - 1, selrect.Height - 1);
                break;

            case MouseAction.Drag:
                if (dropitem != null && dropitem.place.IntersectsWith(pagepiece))
                {
                    int x = dropitem.place.X + r.X - offx, y = dropitem.place.Y + r.Y - offy;
                    dropitem.Paint(g, r, offx, offy);
                    using (Pen p = new Pen(Color.White)) {
                        p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                        if (dropitem is GuiPolygonItem)
                        {
                            g.DrawPolygon(p, ((GuiPolygonItem)dropitem).shifted_edges);
                        }
                        else
                        {
                            g.DrawRectangle(p, x + GuiPolygonItem.inflate, y + GuiPolygonItem.inflate, dropitem.place.Width - 2 * GuiPolygonItem.inflate, dropitem.place.Height - 2 * GuiPolygonItem.inflate);
                        }
                    }
                }

                break;

            case MouseAction.CreateConnection:
                if (conn != null)
                {
                    conn.Paint(g, r, offx, offy);
                    conn.DrawTemporary(g, r, offx, offy);
                }
                break;
            }
        }