Printing Scintilla editor text - very easy...
Posted: Wed Nov 23, 2005 2:23 pm
This code will enable you to do a colour printout from a Scintilla editor window:
Use the SCI_SetPrintColourMode(x) calls to set the various colour modes beforehand.
Find the Scintilla includes in the usual places...
(If you don't already have them then this code will be of no use to you!
)
Code: Select all
length=SCI_GetLength()
If length
FormatRange.FORMATRANGE
If PrintRequester()
width=PrinterPageWidth()
height=PrinterPageHeight()
FormatRange\rc\left=0
FormatRange\rc\top=0
FormatRange\rc\right=width
FormatRange\rc\bottom=height
FormatRange\rcPage\left=0
FormatRange\rcPage\top=0
FormatRange\rcPage\right=width
FormatRange\rcPage\bottom=height
FormatRange\chrg\cpMin=0
FormatRange\chrg\cpMax=length
If StartPrinting("ReportBuilder Draft")
dc=StartDrawing(PrinterOutput())
If dc
FormatRange\hDC=dc
FormatRange\hdcTarget=dc
FormatRange\chrg\cpMin=SCI_FormatRange(#True,FormatRange)
While FormatRange\chrg\cpMin<FormatRange\chrg\cpMax
NewPrinterPage()
FormatRange\chrg\cpMin=SCI_FormatRange(#True,FormatRange)
Wend
StopDrawing()
EndIf
StopPrinting()
EndIf
EndIf
EndIf
Find the Scintilla includes in the usual places...
(If you don't already have them then this code will be of no use to you!
