## 27.8 Mouse Events (cont.)

- Depending on the number of corners that have already been specified, the paint handler draws
  - a small circle for the first mouse click
  - a line after the first two mouse clicks
  - a triangle after three mouse clicks

>     void TriangleWindow::OnPaint(wxPaintEvent & event)
>     {
>        const int RADIUS = 2;
>        wxPaintDC(this);
>        if (corners == 1)
>           dc.DrawEllpse(x[0] - RADIUS, y[0] - RADIUS,
>              2 * RADIUS, 2 * RADIUS);
>        if (corners >= 2)
>           dc.DrawLine(x[0], y[0], x[1], y[1]);
>        if (corners >= 3)
>        {
>           dc.DrawLine(x[1], y[1], x[2], y[2]);
>           dc.DrawLine(x[2], y[2], x[0], y[0]);
>        }
>     }

prev |top |next