Commits

insolor committed a241fa0 Merge

Merge with new-primitives

  • Participants
  • Parent commits 7d59c2f, 8efea49

Comments (0)

Files changed (1)

File dos_rescue.ew

     MoveToEx = link_c_proc(gdi32, "MoveToEx", {C_LONG, C_LONG, C_LONG, C_POINTER}),
     LineTo = link_c_proc(gdi32, "LineTo", {C_LONG, C_LONG, C_LONG}),
     Ellipse = link_c_proc(gdi32, "Ellipse", {C_LONG, C_LONG, C_LONG, C_LONG, C_LONG}),
+    Rectangle = link_c_proc(gdi32, "Rectangle", {C_LONG, C_LONG, C_LONG, C_LONG, C_LONG}),
     SelectObject = link_c_proc(gdi32, "SelectObject", {C_LONG, C_LONG}),
     GetCurrentObject = link_c_func(gdi32, "GetCurrentObject", {C_LONG, C_LONG},C_LONG),
     SetTextColor = link_c_proc(gdi32, "SetTextColor", {C_LONG, C_LONG}),
     end if
 end procedure
 
+global procedure rectangle(integer color, integer fill, sequence coord1, sequence coord2)
+    if window_ready then
+        coord2 += 1
+        if not color then
+            color = last_bk_color
+        end if
+        color = and_bits(color_mask,color)
+        c_proc(SelectObject, {hdcActive, pens[1+color]})
+        if fill then
+            c_proc(SelectObject, {hdcActive, brushes[1+color]})
+        else
+            c_proc(SelectObject, {hdcActive, null_brush})
+        end if
+        c_proc(Rectangle, hdcActive & coord1 & coord2)
+        
+        repaint = TRUE
+    end if
+end procedure
+
 atom points, npoints
 points = NULL
 npoints = 0