$ESCAPECHARS ON
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
CONST EM_GETSEL = &HB0
CONST EM_SETSEL = &HB1
CONST EM_GETRECT = &HB2
CONST EM_SETRECT = &HB3
CONST EM_SETRECTNP = &HB4
CONST EM_SCROLL = &HB5
CONST EM_LINESCROLL = &HB6
CONST EM_SCROLLCARET = &HB7
CONST EM_GETMODIFY = &HB8
CONST EM_SETMODIFY = &HB9
CONST EM_GETLINECOUNT = &HBA
CONST EM_LINEINDEX = &HBB
CONST EM_SETHANDLE = &HBC
CONST EM_GETHANDLE = &HBD
CONST EM_GETTHUMB = &HBE
CONST EM_LINELENGTH = &HC1
CONST EM_REPLACESEL = &HC2
CONST EM_GETLINE = &HC4
CONST EM_LIMITTEXT = &HC5
CONST EM_CANUNDO = &HC6
CONST EM_UNDO = &HC7
CONST EM_FMTLINES = &HC8
CONST EM_LINEFROMCHAR = &HC9
CONST EM_SETTABSTOPS = &HCB
CONST EM_SETPASSWORDCHAR = &HCC
CONST EM_EMPTYUNDOBUFFER = &HCD
CONST EM_GETFIRSTVISIBLELINE = &HCE
CONST EM_SETREADONLY = &HCF
CONST EM_SETWORDBREAKPROC = &HD0
CONST EM_GETWORDBREAKPROC = &HD1
CONST EM_GETPASSWORDCHAR = &HD2
DECLARE FUNCTION QRED_SendMessage LIB "user32" ALIAS "SendMessageA" (hwnd AS LONG, _
wMsg AS LONG, wParam AS LONG, lParam AS LONG) AS LONG
TYPE QREdit EXTENDS QRICHEDIT
RichFont AS QFONT
CONSTRUCTOR
PlainText = 0
RichFont.Name = "Arial"
Font = QREdit.RichFont
END CONSTRUCTOR
END TYPE
DECLARE SUB OnClose_frmMyForm
CREATE frmMyForm AS QFORM
Center
Width = 600
height = 400
CAPTION = "frmMyForm"
AutoScroll = False
OnClose = OnClose_frmMyForm
CREATE rchWin AS QRICHEDIT
Align = 5
Font.Name = "courier"
Font.Size = 8
Font.COLOR = &H800000
Width = 200
Height = 200
ReadOnly = True
WordWrap = False
ScrollBars = ssBoth
HideSelection = False
PlainText = True
END CREATE
END CREATE
frmMyForm.Show
DEFINT N
DEFSTR sTmp = sTmp
FOR N = 1 TO 100
rchwin.Addstring (STR$(N) & " - Anything")
sTmp = sTmp & STR$(N) & " - Anything\n"
NEXT N
rchWin.Addstring ("\n\nYou Should Read This\n it works fine with QRICHEDIT.Addstrin(your string)")
SHOWMESSAGE ("Clic OK For Next Test")
rchWin.Text = sTmp
SHOWMESSAGE ("But does not Work with QRICHEDIT.TEXT = String (Click OK)")
rchWin.SelStart = LEN(rchWin.Text)
rchWin.Addstring ("\n\nYou Should Read This Again\n\nJust Add a line\n\n\"QRICHEDIT.SelStart =Len(QRICHEDIT.Text)\"")
frmMyForm.Visible = False
frmMyForm.SHOWMODAL
SUB OnClose_frmMyForm
Application.Terminate
END
END SUB
|