$DEFINE GDI
$DEFINE USER
      INCLUDE 'WINDOWS.FI'
      SUBROUTINE DRAW_MINUTEHAND
      IMPLICIT NONE
C
C Author       : Kevin B Black
C Date written : 23-Oct-1991
C Abstract     :
C
C DRAW MINUTE HAND
C
C Draws minute hand using the colour specified by the COLOUR argument. Only a
C line is drawn in the iconic state, using the second hand's vectors. If solid
C hands are required, in the non-iconic state, then the hands area is flood
C filled with the Polygon function.
C
C Variables
C
      REAL MHAND(2,6)              ! Minute hand vector description
      REAL COSA,SINA               ! Cosine and Sine of minute hand angle
      INTEGER I                    ! Work integer
      INCLUDE 'WINDOWS.FD'         ! Windows functions and parameters
      RECORD /POINT/ MHANDV(6)     ! Minute hand device vectors
      INCLUDE 'FWCLOCK.FD'         ! Include FWLCOCK variables and parameters
      DATA MHAND/-0.025,  0.00,    ! Minute hand outline vectors
     *           -0.030,  0.60,
     *            0.00,   0.665,
     *            0.030,  0.60,
     *            0.025,  0.00,
     *           -0.025,  0.00/
C
C Depends if window is open or iconic
C
      IF(IMANICON)THEN
C
C In the iconic state only a line is required, the pen and ROP2 mode should
C already have been selected.
C
         WSTATUS=MoveTo(FWCPS.HDC,AXC,AYC)
         WSTATUS=LineTo(FWCPS.HDC,MHAND2(OMINS).X,MHAND2(OMINS).Y)
      ELSE
C
C In the open window state the minute hand outline must be rotated to the
C correct angle. It is then drawn using the Polyline or filled in with the
C Polygon function, if solid hands have been chosen by the user.
C
         COSA=COS(PI-FLOAT(OMINS)*ZINC)
         SINA=SIN(PI-FLOAT(OMINS)*ZINC)
         DO I=1,6
            MHANDV(I).X=AXC+FLOAT(RADIUS*MHAND(1,I))*COSA+
     *                      FLOAT(RADIUS*MHAND(2,I))*SINA
            MHANDV(I).Y=AYC-FLOAT(RADIUS*MHAND(1,I))*SINA+
     *                      FLOAT(RADIUS*MHAND(2,I))*COSA
         ENDDO
         IF(SOLIDHANDS)THEN
            WSTATUS=Polygon(FWCPS.HDC,MHANDV,6)
         ELSE
            WSTATUS=Polyline(FWCPS.HDC,MHANDV,6)
c         IF(SOLIDHANDS)WSTATUS=FloodFill(FWCPS.HDC,
c     *                               AXC+FLOAT(RADIUS)*0.6*SINA,
c     *                               AYC+FLOAT(RADIUS)*0.6*COSA,COLOUR)
         ENDIF
      ENDIF
      RETURN
      END
