Lab 4 -Spring 2000

The Problem

Create a Windows program using the Application Wizzard. This program will allow the user to draw rectangles and circles of a size and location specified by the user using a dialog you create that looks like this. Notice that the HeightBox (group box) has its Visible property set false when you are creating a circle. In this case the Caption of the WidthBox is changed to Radius.

Each of the rectangles and circles are stored as counted pointers in an Array and all of the shapes are draw by the main windows Paint handler. There should be a menu that allows the user to add a circle or a rectangle. The handlers for these add commands should call on the Invalidate function to force the window to redraw itself.

In order to draw your rectangles and circles without fill on a white background add the following to the MainForm constructor.

  Image1->Canvas->FloodFill(ClientWidth,ClientHeight,clWhite,fsSurface);
  Image1->Canvas->Brush->Style = bsClear;

The Schedule