Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QRICHEDIT


QRICHEDIT Component

QRichedit implements a fully featured multi-line text edit control.

QRichedit Properties
Field Type R/W Default Support
Align INTEGER RW alNone W
Align determines how the control aligns within its parent control.
Alignment INTEGER RW taLeftJustify W
Alignment determines how the text is aligned within the edit control.
BorderStyle INTEGER RW bsSingle W
Color INTEGER RW W
Enabled INTEGER RW True WXG
Font QFONT W WX
Handle INTEGER R W
Height INTEGER RW WXG
HideScrollBars INTEGER RW True WG
HideSelection INTEGER RW True W
Hint STRING RW WG
Left INTEGER RW 0 WXG
Line ARRAY of STRING RW WXG
LineCount INTEGER RW  ReadOnly WXG
Modified INTEGER RW WG
Parent QFORM/QPANEL/QTABCONTROL W WXG
PopupMenu QPOPUPMENU W W
Plaintext INTEGER RW False W
Readonly INTEGER RW False WXG
ScrollBars INTEGER RW ssNone
CONST ssNone = 0
CONST ssHorizontal = 1
CONST ssVertical = 2
CONST ssBoth = 3
WXG
SelAttributes QFONT W W
SelLength INTEGER RW WXG
SelLength is the number of characters that are selected.
SelStart INTEGER RW WXG
SelStart is the position of the first selected character in the text. If there is no selected text, SelStart indicates the position of the cursor.
SelText STRING RW WXG
SelText is the selected portion of the edit control's text.
ShowHint INTEGER RW False WG
TabOrder INTEGER RW W
Tag INTEGER RW WXG
Text STRING RW WXG
Top INTEGER RW 0 WXG
WantTabs INTEGER RW False W
WantTabs determines whether the user can insert tab characters into the text.
Width INTEGER RW WXG
WhereX INTEGER R WXG
WhereY INTEGER R WXG
Wordwrap INTEGER RW True W
Visible INTEGER RW True WXG



QRichedit Methods

Method Type Description Params Support
AddStrings SUBI Add strings STRING, Infinite WXG
Clear SUB Clear entire text 0 WXG
CopyToClipboard SUB Copy selected text to clipboard 0 W
CutToClipboard SUB Cut selected text to clipboard 0 W
LoadFromFile SUB (FileName$) Load text from a file 1 WXG
LoadFromStream SUB (Stream AS QFILESTREAM/QMEMORYSTREAM) Load text from a stream 1 WX
PasteFromClipboard SUB Paste text from clipboard 0 W
SaveToFile SUB (FileName$) Save text to a file 1 WXG
SaveToStream SUB (Stream AS QFILESTREAM/QMEMORYSTREAM) Save text to a stream 1 W
SelectAll SUB Selects all text from Richedit 0 WXG
LINEINDEX Function as long
result=SendMessageA  (.handle, rEM_LINEINDEX, .WhereY, 0)
Returm position of first char of current line $INCLUDE "RichEdPopUp.inc" W
GetLINEIdx Function (lineN as long) as long
result=SendMessageA (.handle,rEM_LINEINDEX, LineN, 0)
Returm position of first char of line number LineN $INCLUDE "RichEdPopUp.inc" W
LINEFROMCHAR Function as long
result=SendMessageA (.handle,rEM_LINEFROMCHAR,.SelStart,0)
Return line number when current selection or cursor $INCLUDE "RichEdPopUp.inc" W
GoToLineEnd Function as long
.selstart=.LINEINDEX+len(.line(.WhereY))
Set cursor to end of line $INCLUDE "RichEdPopUp.inc" W
GoToLineBegin Function as long
.selstart=.LINEINDEX
Set cursor to begin of line $INCLUDE "RichEdPopUp.inc" W


QRichedit Events

Event Type Occurs when... Params Support
OnChange VOID Text changes 0 WG
OnKeyDown SUB (Key AS WORD, Shift AS INTEGER) Key held down 2 WG
OnKeyPress SUB (Key AS BYTE) User presses a key 1 WG
OnKeyUp SUB (Key AS WORD, Shift AS INTEGER) Key released 2 WG
OnMouseDown SUB (Button%, X%, Y%, Shift%) Mouse button held down 4 WX
OnMouseMove SUB (X%, Y%, Shift%) Mouse moves 2 WX
OnMouseUp SUB (Button%, X%, Y%, Shift%) Mouse button is released 4 WX



QRichedit Examples

  $INCLUDE "RAPIDQ.INC"

  DIM Form AS QForm
  DIM RichEdit AS QRichEdit

  RichEdit.Parent = Form
  RichEdit.Scrollbars = ssBoth
  RichEdit.AddString "Hello world!"

  Form.ShowModal

Prev Component Contents Next Component

D>