Reinstate WinHelp topic now we have a manual chapter.
[sgt/puzzles] / windows.c
index c05dd6e..0cf8148 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -1,14 +1,5 @@
 /*
  * windows.c: Windows front end for my puzzle collection.
- * 
- * TODO:
- * 
- *  - Figure out what to do if a puzzle requests a size bigger than
- *    the screen will take. In principle we could put scrollbars in
- *    the window, although that would be pretty horrid. Another
- *    option is to detect in advance that this will be a problem -
- *    we can probably tell this using midend_size() before actually
- *    generating the puzzle - and simply refuse to do it.
  */
 
 #include <windows.h>
@@ -339,6 +330,24 @@ void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour)
     SelectObject(fe->hdc_bm, oldpen);
 }
 
+void draw_circle(frontend *fe, int cx, int cy, int radius,
+                 int fill, int colour)
+{
+    if (fill) {
+       HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]);
+       HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
+       Ellipse(fe->hdc_bm, cx - radius, cy - radius,
+               cx + radius + 1, cy + radius + 1);
+       SelectObject(fe->hdc_bm, oldbrush);
+       SelectObject(fe->hdc_bm, oldpen);
+    } else {
+       HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
+       MoveToEx(fe->hdc_bm, cx + radius, cy, NULL);
+       AngleArc(fe->hdc_bm, cx, cy, radius, 0.0F, 360.0F);
+       SelectObject(fe->hdc_bm, oldpen);
+    }    
+}
+
 void draw_polygon(frontend *fe, int *coords, int npoints,
                   int fill, int colour)
 {