home *** CD-ROM | disk | FTP | other *** search
- $DEFINE GDI
- $DEFINE USER
- INCLUDE 'WINDOWS.FI'
- SUBROUTINE DRAW_HOURHAND
- IMPLICIT NONE
- C
- C Author : Kevin B Black
- C Date written : 23-Oct-1991
- C Abstract :
- C
- C DRAW HOUR 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 HHAND(2,8) ! Hour hand vector description
- REAL COSA,SINA,HANGLE ! Cosine, Sine and Hour Hand angle
- INTEGER I ! Work integer
- INCLUDE 'WINDOWS.FD' ! Windows functions and parameters
- RECORD /POINT/ HHANDV(8) ! Hour hand device vectors
- INCLUDE 'FWCLOCK.FD' ! Include FWLCOCK variables and parameters
- DATA HHAND/-0.03, 0.00, ! Hour hand outline vectors
- * -0.04, 0.30,
- * -0.05, 0.425,
- * 0.00, 0.50,
- * 0.05, 0.425,
- * 0.04, 0.30,
- * 0.03, 0.00,
- * -0.03, 0.00/
- C
- C Compute hour angle
- C
- HANGLE=PI-(FLOAT(OHOURS)+FLOAT(OMINS)/60.0)*5.0*ZINC
- COSA=COS(HANGLE)
- SINA=SIN(HANGLE)
- 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)
- HHANDV(1).X=AXC+FLOAT(RADIUS)*0.45*SINA
- HHANDV(1).Y=AYC+FLOAT(RADIUS)*0.45*COSA
- WSTATUS=LineTo(FWCPS.HDC,HHANDV(1).X,HHANDV(1).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
- DO I=1,8
- HHANDV(I).X=AXC+FLOAT(RADIUS*HHAND(1,I))*COSA+
- * FLOAT(RADIUS*HHAND(2,I))*SINA
- HHANDV(I).Y=AYC-FLOAT(RADIUS*HHAND(1,I))*SINA+
- * FLOAT(RADIUS*HHAND(2,I))*COSA
- ENDDO
- IF(SOLIDHANDS)THEN
- WSTATUS=Polygon(FWCPS.HDC,HHANDV,8)
- ELSE
- WSTATUS=Polyline(FWCPS.HDC,HHANDV,8)
- C IF(SOLIDHANDS)WSTATUS=FloodFill(FWCPS.HDC,
- C * AXC+FLOAT(RADIUS)*0.45*SINA,
- C * AYC+FLOAT(RADIUS)*0.45*COSA,COLOUR)
- ENDIF
- ENDIF
- RETURN
- END
-