home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / corel6 / draw / goldbar.csc < prev    next >
Encoding:
Text File  |  1995-08-11  |  2.7 KB  |  83 lines

  1. REM Creates a Gold Bar with the desired Text on top.
  2. REM GoldBar.CSC July 21, 1995
  3.  
  4. REM Uses your default text font to generate a gold bar with desired text on top.
  5. REM Lets you specify the color of the text.
  6. REM You need an open document to run this script.
  7.  
  8. BEGIN DIALOG GBDialog 222, 137, "Gold Bar Dialog"
  9.     TEXT  13, 12, 80, 8, "The text for the Gold Bar:"
  10.     TEXTBOX  98, 12, 111, 13, Mess$
  11.     TEXT  13, 41, 50, 8, "Cyan Value"
  12.     SPINCONTROL  76, 41, 50, 11, CyanVal%
  13.     TEXT  13, 59, 50, 8, "Magenta Value"
  14.     SPINCONTROL  76, 60, 50, 13, MagentaVal%
  15.     TEXT  13, 83, 50, 8, "Yellow Value"
  16.     SPINCONTROL  76, 83, 50, 13, YellowVal%
  17.     OKBUTTON  162, 41, 48, 14
  18.     CANCELBUTTON  162, 67, 48, 14
  19.     GROUPBOX  3, 28, 144, 102, "Fill Color (CMYK)"
  20.     TEXT  13, 106, 50, 8, "K Value"
  21.     SPINCONTROL  76, 106, 50, 13, KVal%
  22. END DIALOG
  23.  
  24. YellowVal% = 100            'set default to Red
  25. MagentaVal = 100
  26.  
  27. RETRY:
  28. ret = DIALOG(GBDialog)
  29. IF CANCEL THEN STOP
  30.  
  31. IF Mess = "" THEN 
  32.     MESSAGE "You didn't enter any text"
  33.     GOTO RETRY
  34. END IF
  35. IF CyanVal > 100 OR MagentaVal > 100 OR YellowVal > 100 OR KVal > 100 THEN
  36.     Message "One of the color values exceeds 100, please try again"
  37.     GOTO RETRY
  38. END IF
  39.  
  40. REM Height and Width are in inches for readability
  41. Height# = 1
  42. strlen% = LEN(Mess$)
  43. Width# = 0.75 * strlen
  44.  
  45. WITHOBJECT DRAW
  46. REM Adds the text on top
  47.     .CreateArtisticText Mess
  48.     .SetSize FROMINCHES(Width - 0.4), FROMINCHES(Height - 0.4)
  49.     .SetReferencePoint 1
  50.     .SetPosition FROMINCHES(0.2), FROMINCHES(-0.2)
  51.     .ApplyUniformFillColor 2, CyanVal, MagentaVal, YellowVal, KVal
  52.     TopText& = .GetObjectsCDRStaticID()
  53.  
  54. REM Creates the Top Rectangle
  55.     .CreateRectangle FROMINCHES(-0.1), FROMINCHES(0.1), FROMINCHES(-Height + 0.1), FROMINCHES(Width - 0.1), 0
  56.     .ApplyFountainFill 0, 0, 0, 1500, 60, 0, 3, 0
  57.         .SetFountainFillColor 0, 2, 0, 20, 100, 
  58.         .SetFountainFillColor 30, 2, 0, 0, 0, 0
  59.         .SetFountainFillColor 70, 2, 0, 20, 100, 
  60.         .SetFountainFillColor 95, 2, 0, 0, 0, 0
  61.         .SetFountainFillColor 100, 2, 0, 0, 0, 0
  62.         .ApplyOutline 3000, 0, 0, 0, 100, 10, 1, 1, 1, 0
  63.     .OrderToBack
  64.     Top& = .GetObjectsCDRStaticID()
  65.     
  66. REM Creates the Base Rectangle
  67.     .CreateRectangle FROMINCHES(0), FROMINCHES(0), FROMINCHES(-Height), FROMINCHES(Width), 0
  68.     .ApplyFountainFill 0, 0, 0, -200, 60, 0, 3, 0
  69.         .SetFountainFillColor 0, 2, 0, 20, 100, 20
  70.         .SetFountainFillColor 30, 2, 0, 0, 0, 0
  71.         .SetFountainFillColor 50, 2, 0, 20, 100, 20
  72.         .SetFountainFillColor 70, 2, 0, 0, 0, 0
  73.         .SetFountainFillColor 100, 2, 0, 20, 100, 20
  74.         .ApplyOutline 3000, 0, 0, 0, 100, 10, 1, 1, 1, 0
  75.     .OrderToBack
  76.     Base& = .GetObjectsCDRStaticID()
  77.  
  78.     .SelectObjectOfCDRStaticID Base
  79.     .SelectObjectOfCDRStaticID Top
  80.     .SelectObjectOfCDRStaticID TopText
  81.     .Group
  82. END WITHOBJECT
  83.