CS476/576

Assignment #2

Due Midnight, Wednesday   Oct. 8, 2003


Write an X lib/Motif  program with the following descriptions:

NAME

drawPolygons - A simple polygons drawing program
SYNOPSIS
drawPolygons [-n] [-q]
DESCRIPTION
 
Initially, the interface looks like the one given in Fig. (A) with  a drawing area and  a QUIT button

If the user clicks at position (x,y) inside the drawing area  it draws:
If the user clicks on a QUIT button, the program exits.

The program accepts two options*:

-n  This will number the nodes 1, 2, .... as shown in
Fig. (D).

-q  If the user clicks on a  QUIT button, it will be replaced with two buttons:
     
OK and Cancel as shown in
Fig. (F). During that phase, if the user clicks inside
      the drawing  area, the program
rings a bell and does not draw as usual.

      If 
the user clicks on the OK  button, the program exits. 
      If the user clicks on the 
Cancel  button the program returns back to the
      previous state before clicking on the
QUIT  button.


 * For  CS476 students: You may not implement these two options.

See sample solution under: /home/cs476/public_html/fall03/assignments/a2/wahab/drawPolygons

Fig. (A)                                          Fig. (B)           
Fig. (A)Fig. (B)
 
                     
        

Fig. (C)                                            Fig. (D)
Fig. (C)Fig. (A)



                               Fig. (F) 
Fig. (A)