VERSION 2.00 Begin Form frmPrintOptions Caption = "WordJunction Print Options" ClientHeight = 2535 ClientLeft = 3570 ClientTop = 3795 ClientWidth = 5550 Height = 2940 Left = 3510 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 2535 ScaleWidth = 5550 Top = 3450 Width = 5670 Begin SSPanel Panel3D1 Alignment = 1 'Left Justify - MIDDLE BevelInner = 1 'Inset BevelOuter = 0 'None BorderWidth = 1 Height = 2565 Left = 0 TabIndex = 0 Top = 0 Width = 5565 Begin SSPanel pnlWordFindNotice BevelInner = 2 'Raised BevelOuter = 0 'None BorderWidth = 1 Caption = "Clues are available by printing the contents of the WRD file used to generate this Word Find puzzle." Height = 855 Left = 390 TabIndex = 9 Top = 1020 Visible = 0 'False Width = 4785 End Begin CommandButton cmdCancel Caption = "Cancel" Height = 375 Left = 4290 TabIndex = 8 Top = 1980 Width = 1140 End Begin CommandButton cmdPrint Caption = "&Print" Height = 375 Left = 3150 TabIndex = 7 Top = 1980 Width = 1140 End Begin CommandButton cmdHelp Caption = "&Help" Height = 375 Left = 1860 TabIndex = 6 Top = 1980 Width = 1140 End Begin OptionButton optSquareColor BackColor = &H00C0C0C0& Caption = "Use &Gray For Solid Square Color" Height = 225 Index = 1 Left = 210 TabIndex = 5 Top = 1140 Value = -1 'True Width = 3285 End Begin OptionButton optSquareColor BackColor = &H00C0C0C0& Caption = "Use Screen Display's Solid Square Color" Height = 225 Index = 0 Left = 210 TabIndex = 4 Top = 1395 Width = 4275 End Begin CheckBox chkFitToPage BackColor = &H00C0C0C0& Caption = "&Fit Puzzle To Page" Height = 225 Left = 210 TabIndex = 3 Top = 690 Value = 1 'Checked Width = 3645 End Begin CheckBox chkPrintClues BackColor = &H00C0C0C0& Caption = "Print &Clues" Height = 225 Left = 210 TabIndex = 2 Top = 435 Value = 1 'Checked Width = 3645 End Begin CheckBox chkPrintAnswers BackColor = &H00C0C0C0& Caption = "Print &Answers" Height = 225 Left = 210 TabIndex = 1 Top = 180 Value = 1 'Checked Width = 3645 End End End Sub cmdCancel_Click () Unload Me End Sub Sub cmdHelp_Click () SendKeys "{F1}" End Sub Sub cmdPrint_Click () Screen.MousePointer = HOURGLASS Printer.ScaleMode = 5 DisplayPuzzleP Screen.MousePointer = DEFAULT Unload Me End Sub Sub cmdStop_Click () Hide End Sub Sub DisplayPuzzleP () Dim Row As Integer, Col As Integer, i As Integer, j As Integer Dim PrinterPuzzleHeight As Single Dim PrinterPuzzleWidth As Single Dim PuzzleTopOffset As Long Dim PuzzleLeftOffset As Long Dim SkipNumberPrint As Integer Dim RandomLetter As String InitPuzzleGrid PrintPuzzleHeader Printer.Print "Page: " & Printer.Page Printer.Print Printer.Print Puzzle.Height = Args.Size Puzzle.Width = Args.Size Printer.ScaleMode = TWIPS If chkFitToPage Then gCWScale = (Printer.ScaleWidth / ((Puzzle.Width * 460) + 10 * ((Printer.DrawWidth * Screen.TwipsPerPixelX)))) Else gCWScale = 1 End If Puzzle.SquareSize = 460 * gCWScale If optSquareColor(0) Then ' use Main screen's setting for the solid square color Puzzle.SquareFillColor = frmMain!shpSampleSquare.FillColor Else ' use grey Puzzle.SquareFillColor = &HC0C0C0 End If Puzzle.SquareBorderColor = BLACK Puzzle.ThreeD = False Printer.ScaleMode = 1 PrinterPuzzleHeight = (Puzzle.Height * Puzzle.SquareSize) + (Printer.DrawWidth * Screen.TwipsPerPixelY) PrinterPuzzleWidth = (Puzzle.Width * Puzzle.SquareSize) + (Printer.DrawWidth * Screen.TwipsPerPixelX) PuzzleTopOffset = ((Printer.ScaleHeight - Printer.CurrentY) - PrinterPuzzleHeight) \ 2 PuzzleLeftOffset = (Printer.ScaleWidth - PrinterPuzzleWidth) \ 2 ' print the grid squares first For Row = 1 To UBound(PuzzleGrid%, 1) For Col = 1 To UBound(PuzzleGrid%, 1) If PuzzleGrid%(Row, Col) = 0 Then Printer.CurrentY = PuzzleTopOffset + (Puzzle.SquareSize * (Row - 1)) Printer.CurrentX = PuzzleLeftOffset + Puzzle.SquareSize * (Col - 1) If Not frmMain!optStyle(0).Value Then Printer.Line (Printer.CurrentX, Printer.CurrentY)-Step(Puzzle.SquareSize, Puzzle.SquareSize), Puzzle.SquareFillColor, BF ' Draw upper-left. Else SetWordFontP RandomLetter$ = Chr$(Int(Rnd * 26) + 65) SetCursorLetterP RandomLetter$, Puzzle, Col, Row, PuzzleTopOffset, PuzzleLeftOffset Printer.Print RandomLetter$ End If End If DoEvents Next Col Next Row For i = 1 To UBound(Solution, 1) SkipNumberPrint = False ' across word If Solution(i).AcrossWord > -1 Then For j = 1 To Len(Words(Solution(i).AcrossWord)) If PuzzleGrid%(Solution(i).Row, Solution(i).Col + j - 1) Then Printer.CurrentY = PuzzleTopOffset + (Puzzle.SquareSize * (Solution(i).Row - 1)) Printer.CurrentX = PuzzleLeftOffset + Puzzle.SquareSize * (Solution(i).Col + j - 2) Printer.Line (Printer.CurrentX, Printer.CurrentY)-Step(Puzzle.SquareSize, Puzzle.SquareSize), WHITE, BF ' Draw upper-left. If (chkPrintAnswers And frmMain!optStyle(0).Value) Or Not frmMain!optStyle(0).Value Then Printer.CurrentY = PuzzleTopOffset + (Puzzle.SquareSize * (Solution(i).Row - 1)) Printer.CurrentX = PuzzleLeftOffset + Puzzle.SquareSize * (Solution(i).Col + j - 2) Printer.Line (Printer.CurrentX, Printer.CurrentY)-Step(Puzzle.SquareSize, Puzzle.SquareSize), BLACK, B ' Draw upper-left. End If If chkPrintAnswers Or frmMain!optStyle(0).Value Then SetWordFontP SetCursorLetterP Mid$(Words(Solution(i).AcrossWord), j, 1), Puzzle, Solution(i).Col + j - 1, Solution(i).Row, PuzzleTopOffset, PuzzleLeftOffset Printer.Print Mid$(Words(Solution(i).AcrossWord), j, 1) End If ' mark that we filled this square with a letter PuzzleGrid%(Solution(i).Row, Solution(i).Col + j - 1) = 0 End If If j = 1 And Not frmMain!optStyle(0).Value Then SkipNumberPrint = True SetNumberFontP SetCursorNumberP Puzzle, Solution(i).Col, Solution(i).Row, PuzzleTopOffset, PuzzleLeftOffset Printer.Print Trim$(Str$(i)) End If DoEvents Next j End If ' down word If Solution(i).DownWord > -1 Then For j = 1 To Len(Words(Solution(i).DownWord)) If PuzzleGrid%(Solution(i).Row + j - 1, Solution(i).Col) Then Printer.CurrentY = PuzzleTopOffset + (Puzzle.SquareSize * (Solution(i).Row + j - 2)) Printer.CurrentX = PuzzleLeftOffset + Puzzle.SquareSize * (Solution(i).Col - 1) Printer.Line (Printer.CurrentX, Printer.CurrentY)-Step(Puzzle.SquareSize, Puzzle.SquareSize), WHITE, BF ' Draw upper-left. If (chkPrintAnswers And frmMain!optStyle(0).Value) Or Not frmMain!optStyle(0).Value Then Printer.CurrentY = PuzzleTopOffset + (Puzzle.SquareSize * (Solution(i).Row + j - 2)) Printer.CurrentX = PuzzleLeftOffset + Puzzle.SquareSize * (Solution(i).Col - 1) Printer.Line (Printer.CurrentX, Printer.CurrentY)-Step(Puzzle.SquareSize, Puzzle.SquareSize), BLACK, B ' Draw upper-left. End If If chkPrintAnswers Or frmMain!optStyle(0).Value Then SetWordFontP SetCursorLetterP Mid$(Words(Solution(i).DownWord), j, 1), Puzzle, Solution(i).Col, Solution(i).Row + j - 1, PuzzleTopOffset, PuzzleLeftOffset Printer.Print Mid$(Words(Solution(i).DownWord), j, 1) End If ' mark that we filled this square with a letter PuzzleGrid%(Solution(i).Row + j - 1, Solution(i).Col) = 0 End If If j = 1 And (Not SkipNumberPrint) And (Not frmMain!optStyle(0).Value) Then SetNumberFontP SetCursorNumberP Puzzle, Solution(i).Col, Solution(i).Row, PuzzleTopOffset, PuzzleLeftOffset Printer.Print Trim$(Str$(i)) End If DoEvents Next j End If DoEvents Next i On Error Resume Next Printer.NewPage DoEvents If chkPrintClues Then PrintPuzzleHeader DoEvents Printer.Print "Page: " & Printer.Page DoEvents Printer.Print DoEvents Printer.Print DoEvents Printer.FontName = "Courier New" Printer.FontSize = 10 Printer.FontBold = False Printer.ForeColor = &H80000008 DoEvents Printer.FontUnderline = True Printer.Print "Across Clues" Printer.FontUnderline = False DoEvents For i = 1 To UBound(Solution, 1) If Solution(i).AcrossWord > -1 Then Printer.Print Trim$(Str$(i)) & ". " & Clues(Solution(i).AcrossWord) End If DoEvents Next i Printer.Print Printer.FontUnderline = True Printer.Print "Down Clues" Printer.FontUnderline = False DoEvents For i = 1 To UBound(Solution, 1) If Solution(i).DownWord > -1 Then Printer.Print Trim$(Str$(i)) & ". " & Clues(Solution(i).DownWord) End If DoEvents Next i End If On Error Resume Next Printer.EndDoc DoEvents If Err = 482 Then MsgBox "WordJunction encountered a problem when printing." End If On Error GoTo 0 End Sub Sub Form_Load () CenterForm Me optSquareColor(0).Visible = Not frmMain!optStyle(0).Value optSquareColor(1).Visible = Not frmMain!optStyle(0).Value pnlWordFindNotice.Visible = frmMain!optStyle(0).Value chkPrintClues.Visible = Not frmMain!optStyle(0).Value If Not (chkPrintClues.Visible) Then chkPrintClues.Value = False End If End Sub Sub PrintPuzzleHeader () Printer.FontName = "Courier New" Printer.FontSize = 7.5 Printer.FontBold = False Printer.ForeColor = &H80000008 Printer.Print "WordJunction Puzzle * Copyright (c) 1995 Ziff-Davis Publishing Company " Printer.Print "Written By Jonathan Waldman and Jack R. Heath" End Sub Sub SetCursorLetterP (CharToPrint As String, P As PuzzleInfo, x, y, TopOffset, LeftOffset) Printer.CurrentX = LeftOffset + (P.SquareSize * x - (Int(.5 * P.SquareSize))) - Int(.5 * Printer.TextWidth(CharToPrint)) Printer.CurrentY = TopOffset + (P.SquareSize * y - (Int(.5 * P.SquareSize))) - Int(.5 * Printer.TextHeight(CharToPrint)) End Sub Sub SetCursorNumberP (P As PuzzleInfo, x, y, TopOffset, LeftOffset) Printer.CurrentX = LeftOffset + 10 + ((P.SquareSize) * (x - 1)) Printer.CurrentY = TopOffset + 1 + ((P.SquareSize) * (y - 1)) End Sub Sub SetNumberFontP () Printer.FontName = "Courier New" Printer.FontSize = 7 * gCWScale Printer.FontBold = False Printer.ForeColor = &H80000008 End Sub Sub SetWordFontP () Printer.FontName = "Courier New" Printer.FontSize = 10 * gCWScale Printer.FontBold = False Printer.ForeColor = &H80000008 End Sub