$APPTYPE GUI
$INCLUDE "Rapidq.inc"
DECLARE SUB FontClick
DECLARE SUB PrintClick
DECLARE SUB ResizeClick
DIM font1 AS QFONT
DIM FontDialog AS QFONTDIALOG
CREATE form AS QFORM
CAPTION = "Print QRichEdit"
Width = 640
Height = 480
ONResize = ResizeClick
Center
CREATE MainMenu AS QMAINMENU
CREATE FontMenu AS QMENUITEM
CAPTION = "Font"
OnClick = FontClick
END CREATE
CREATE PrintItem AS QMENUITEM
CAPTION = "Print"
OnClick = PrintClick
END CREATE
END CREATE
CREATE RichEdit AS QRICHEDIT
Left = 0
Top = 0
Width = Form.ClientWidth
Height = Form.ClientHeight
ScrollBars = ssVertical
Font = font1
END CREATE
END CREATE
Form.SHOWMODAL
SUB FontClick
FontDialog.GetFont(font1)
IF FontDialog.EXECUTE THEN
FontDialog.SetFont(font1)
RichEdit.Font = font1
END IF
END SUB
SUB PrintClick
Printer.font = font1
LPRINT RichEdit.Text
LFLUSH
END SUB
SUB ResizeClick
RichEdit.Width = Form.ClientWidth
RichEdit.Height = Form.ClientHeight
END SUB
|