home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Corel Draw 6
/
corel-draw-6-cd1.iso
/
draw
/
card.csc
< prev
next >
Wrap
Text File
|
1995-08-18
|
5KB
|
125 lines
REM Business Card Helper
REM Card.csc July 21, 1995
REM This Script generates a page of business cards.
REM It will ask you for all the relevant information, generate the
REM card with the logo you specify, and then fill the page with
REM as many as possible.
REM It uses the "AvantGarde Bk BT" font, so it may run into problems if you don't have that font.
REM Try changing the variable FontName to another value to get it to work.
FontName$ = "AvantGarde Bk BT"
DIM Width#, Height#
BEGIN DIALOG Dialog1 264, 203, "Business Card Helper"
CHECKBOX 28, 19, 50, 9, "Name", NameBool%
TEXTBOX 100, 19, 101, 13, Name$
CHECKBOX 28, 41, 50, 10, "Title", TitleBool%
TEXTBOX 100, 41, 101, 13, Title$
CHECKBOX 28, 63, 50, 9, "Company", CompBool%
TEXTBOX 100, 60, 101, 13, Company$
CHECKBOX 28, 84, 50, 10, "Address", AddBool%
TEXTBOX 100, 83, 101, 13, Address$
CHECKBOX 28, 105, 50, 10, "City", CityBool%
TEXTBOX 100, 105, 54, 13, City$
CHECKBOX 28, 128, 50, 10, "State", StateBool%
TEXTBOX 100, 127, 54, 13, State$
CHECKBOX 28, 150, 50, 10, "Zip Code", ZipBool%
TEXTBOX 100, 150, 54, 13, ZipCode$
OKBUTTON 198, 104, 58, 15
CANCELBUTTON 198, 145, 58, 15
PUSHBUTTON 198, 124, 58, 16, "Logo..."
TEXT 17, 181, 70, 8, "Width (1/1000" + CHR(34) + ")"
SPINCONTROL 75, 181, 40, 12, Width#
TEXT 126, 181, 70, 8, "Height (1/1000" + CHR(34) + ")"
SPINCONTROL 185, 181, 40, 12, Height#
END DIALOG
REM Defaults
Width = 3500
Height = 2000
RETRY:
Ret = DIALOG(dialog1)
IF CANCEL THEN STOP
IF Ret = 3 THEN 'Get logo and return
currfolder = "C:\"
Logo$ = GETFILEBOX("*.BMP", "Choose your favorite BITMAP file")
GOTO RETRY
END IF
REM Assemble the text for the card
DIM CardText$
IF NameBool = 1 THEN CardText = CardText$ + Name + CHR(13) + CHR(10)
IF TitleBool = 1 THEN CardText = CardText$ + Title + CHR(13) + CHR(10)
IF CompBool = 1 THEN CardText = CardText$ + Company + CHR(13) + CHR(10)
IF AddBool = 1 THEN CardText = CardText$ + Address + CHR(13) + CHR(10)
IF CityBool = 1 THEN CardText = CardText$ + City + CHR(13) + CHR(10)
IF StateBool = 1 THEN CardText = CardText$ + State + CHR(13) + CHR(10)
IF ZipBool = 1 THEN CardText = CardText$ + ZipCode + CHR(13) + CHR(10)
DIM FirstLine%
FirstLine = INSTR(CardText$, CHR(13)) 'Parses the length of the first line
HeightInch# = Height / 1000
WidthInch# = Width / 1000
WITHOBJECT DRAW
.FileNew
REM Create the actual rectangle for the card
.CreateRectangle FROMINCHES(HeightInch / 2), -FROMINCHES(WidthInch / 2), -FROMINCHES(HeightInch / 2), FROMINCHES(WidthInch / 2), 0
REM Insert Logo
IF Logo <> "" THEN
.FileImport Logo$
.SetSize FROMINCHES(WidthInch / 2), FROMINCHES(HeightInch / 2)
.SetReferencePoint 1
.SetPosition FROMINCHES(-WidthInch / 2), FROMINCHES(HeightInch / 2)
END IF
REM Insert two bars for effect
.CreateRectangle FROMINCHES((HeightInch / 2) - HeightInch *.1), FROMINCHES(0), FROMINCHES((HeightInch / 2) - HeightInch *.2), FROMINCHES(WidthInch * 6/13), 0
.ApplyFountainFill 0, 0, 0, -300, 50, 0, 3, 0
.SetFountainFillColor 0, 5, 255, 255, 255, 0
.SetFountainFillColor 20, 5, 255, 255, 255, 0
.SetFountainFillColor 100, 5, 255, 0, 0, 0
.ApplyOutline 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.CreateRectangle FROMINCHES((HeightInch / 2) - HeightInch *.3), FROMINCHES(0), FROMINCHES((HeightInch / 2) - HeightInch *.4), FROMINCHES(WidthInch * 6/13), 0
.ApplyFountainFill 0, 0, 0, -300, 50, 0, 3, 0
.SetFountainFillColor 0, 5, 255, 255, 255, 0
.SetFountainFillColor 10, 5, 255, 255, 255, 0
.SetFountainFillColor 100, 5, 255, 0, 0, 0
.ApplyOutline 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
REM Insert the text of the card
.CreateTextString 0, 0, FROMINCHES(-HeightInch / 2), FROMINCHES(WidthInch / 2), CardText$
.SelectPreviousObject 0'sInRect 0, 0, FROMINCHES(-HeightInch / 2), FROMINCHES(WidthInch / 2), 0
.SetCharacterAttributes 0, LEN(CardText$)-1, FontName, 12, 100, 0, 0, 0, 0, 0, 1000, 750, 0
.SetCharacterAttributes 0, FirstLine, FontName, 12, 120, 0, 0, 0, 0, 0, 1000, 750, 0 'Punches up the first line a little
REM Rotate all
.SelectAllObjects
.Group
.RotateObject 90000000, -1, 0, 0
.CopyToClipboard
.DeleteObject
REM Fill The Page
.SetPageSize FROMINCHES(8.5), FROMINCHES(11)
NumRow% = INT(11 / WidthInch)
NumCol% = INT(8.5 / HeightInch)
For Row% = 0 to NumRow - 1
For Col% = 0 to NumCol - 1
Topedge& = FROMINCHES(5.25 - Row * WidthInch)
LeftEdge& = FROMINCHES(-4.0 + Col * HeightInch)
.PasteFromClipboard
.SetPosition LeftEdge&, TopEdge&
NEXT COL
NEXT ROW
END WITHOBJECT