home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw 6 / corel-draw-6-cd1.iso / draw / stripes.csc < prev    next >
Text File  |  1995-08-18  |  1KB  |  39 lines

  1. REM Fills objects with stripes in Draw
  2. REM Stripes.csc, July 28, 1995
  3.  
  4. REM Improved! Fills conical or linear depending on type of object
  5.  
  6. WITHOBJECT DRAW
  7.     REM see if any object selected
  8.     ON ERROR GOTO HANDLER            ' setup error handler
  9.         ObjType& = .GetObjectType()
  10.     ON ERROR EXIT                            ' restore no error handling
  11.  
  12.     IF ObjType = 1 OR Objtype = 4 OR ObjType = 12 THEN            ' rectangle, text OR group
  13.         .ApplyFountainFill 0, 0, 0, 0, 200, 0, 3, 50                    ' linear
  14.     ELSEIF ObjType = 2 OR ObjType = 9 THEN                                        ' ellipse or sum polygon
  15.         .ApplyFountainFill 2, 0, 0, 0, 200, 0, 3, 50                    ' conical
  16.     ELSE
  17.         MESSAGE "Cannot fill objects of selected type."
  18.         STOP
  19.     ENDIF
  20.  
  21.     FOR i = 5 TO 95 STEP 10
  22.         .SetFountainFillcolor  i, 5, 255, 0, 51, 0
  23.     NEXT i
  24.  
  25.     FOR i = 0 TO 100 STEP 10
  26.         .SetFountainFillcolor  i, 5, 255, 255, 255, 0
  27.     NEXT i
  28.     STOP     ' END of main program
  29.  
  30.     HANDLER :                            ' handles runtime errors
  31.         IF ERRNUM = 5010 THEN
  32.             MESSAGE "You need something selected"
  33.         ELSE
  34.             MESSAGE "Unhandled Error " + STR(ERRNUM)
  35.         END IF
  36.  
  37. END WITHOBJECT
  38.  
  39.