jsRichEdit Method Members
autoURLDetect
Attempts to enable/disable automatic URL highlighting in the editor to
<lDetect> and then queries the editor for the setting and updates
URLDetect
to the actual setting in the editor. The editor detects URLs beginning with the
prefixes file:, ftp:, gopher:, http:, https:, mailto:, news:, nntp:, prospero:,
telnet::, and wais:.
Parameters:
<lDetect> (Optional - Default = false)
True = Enable automatic URL highlighting.
False = Disable automatic URL highlighting.
Returns:
URLDetect.
See also:
getAutoURLDetect
canPaste
Queries the editor to determine if any data format currently in the
system clipboard can be pasted into the editor at the current caret position.
Parameters: None
Returns:
True = There is an acceptable data format in the
system clipboard that can be pasted into the editor.
False = There is not an acceptable format in the system clipboard, or there may
be insufficient memory or other system problem that would preclude a successful
paste operation.
See also:
emptyUndoBuffer,
getPriorityClipboardFormat,
pasteSpecial,
redo,
undo
canRedo
Queries the editor to determine
if there are any undo operations in the undo queue that can be redone.
Parameters: None
Returns:
True = There are undo operations that can be redone.
False = There are no undo operatons that can be redone.
See also:
redo,
undo,
emptyUndoBuffer
canUndo
Queries the editor to determine if there are any edit operations that can be undone.
Parameters: None
Returns:
True = There are edit operations in the undo queue that can be undone.
False = There are no edit operations in the undo queue that can be undone.
See also:
redo,
undo,
emptyUndoBuffer
charFromPos
Retrieves the zero-based index of the character at the
specified screen coordinates represented by <nX> (horizontal) and
<nY> (vertical) relative to the editor's top-left corner.
Parameters:
<nX> (Required)
Horizontal coordinate in pixels.
<nY> (Required)
Vertical coordinate in pixels.
Returns:
The zero-based index of the character at the specified coordinates.
See also:
posFromChar
clear
Deletes the selected text in the editor. If no text is
selected, deletes the character at the current caret position.
Parameters: None
Returns: None
See also:
copy,
cut,
emptyUndoBuffer,
redo,
undo
colorDialog
Displays the dBL getColor dialog
with the caption passed in <cCaption> for the user to select a color.
Parameters:
<cCaption> (Optional - Default = "Choose Color")
The text caption to display in the TitleBar of the getColor dialog window.
Returns:
The user-selected color as a numeric 32-bit value or -1 if the user clicked cancel.
See also:
setColorBkgnd,
setColorText,
setColorTextBkgnd
copy
Copies the currently selected text in the editor (if any) to the clipboard.
Parameters: None
Returns: None
See also:
clear,
cut,
emptyUndoBuffer,
exGetSel,
pasteSpecial,
redo,
undo
cursorPosition
Retrieves the mouse cursor position in pixels relative to the editor window and
saves the horizontal position to the
PointerX
and the vertical position to
PointerY
property members.
Parameters: None
Returns:
The horizontal position that was saved to PointerX as a convenience.
cursorWindow
Get hWND of the window under the mouse cursor.
Parameters: None
Returns:
hWND of the window currently under the mouse cursor.
Note: The hWND may represent a window, entryfield, pushbutton, etc.
cut
Copies the currently selected text in the editor to the
clipboard and deletes the selected text from the editor.
Parameters: None
Returns: None
See also:
clear,
copy,
emptyUndoBuffer,
exGetSel,
pasteSpecial,
redo,
undo
dataLinkLoad
Loads the editor from the field object assigned to the
dataLink
property.
Parameters: None
Returns: None
See also:
dataLinkSave
dataLinkSave
Saves the editor's contents to the field object assigned to the
dataLink
property.
Parameters: None
Returns: None
See also:
dataLinkLoad
deleteContents
Removes all contents from the editor window and resets the editor's internal modify flag.
Parameters: None
Returns: None
See also:
getModify,
setModify
displayBand
Renders the editor's contents to the device context that is
setup in a previous call to FormatRange. <nLeft>, <nTop>,
<nRight>, and <nBottom> indicate the rectangle in
the device context within which to render the output.
Parameters:
<nLeft> (Required)
Left edge of the rendering rectangle.
<nTop> (Required)
Top edge of the rendering rectangle.
<nRight> (Required)
Right edge of the rendering rectangle.
<nBottom> (Required)
Bottom edge of the rendering rectangle.
Returns:
The completion status of the operation.
True = The text was successfully rendered.
False = An error was encountered.
emptyUndoBuffer
Clears the contents of the editor's undo buffer.
Parameters: None
Returns: None
See also:
getRedoName,
getUndoName,
setUndoLimit,
stopGroupTyping
enable
Enables/disables the editor according to <lEnable>.
Parameters:
<lEnable> (Optional - Default = false)
True = The editor is enabled.
False = The editor is disabled.
Returns:
The new enabled status of the editor.
exGetSel
Determines the zero-based starting and ending positions
of the selected text (if any) in the editor.
selStart
is set to the starting character position.
selEnd
is set to the ending character position. If there is no text currently
selected in the editor, selEnd will be equal to selStart, and this value
indicates the current text caret position within the text in the editor.
Parameters: None
Returns:
selStart
See also:
exSetSel,
getSelectionLines,
hideSelection,
replaceSel
exLimitText
Attempts to set the maximum
editor text buffer size in characters to <nLimit>, then sets
limitText
to the size that was actually set.
Note: The actual value returned may differ from the requested <nLimit>
value if the system memory is currently constrained or due to other errors.
Parameters:
<nLimit> (Optional - Default = 32767)
The new text limit to set in the editor.
Returns:
limitText.
See also:
getLimitText
exLineFromChar
Retrieves the zero-based line number containing the
character at the zero-based character index <nInd>.
Parameters:
<nInd> (Optional - Default = -1)
The zero-based index of the character for which to determine the line number.
If <nInd> = -1, retrieves the line containing the text caret, or if there
is a selection, then retrieve the starting line of the selection.
Returns:
The zero-based line number containing the specified character index.
exSetSel
Selects text in the editor
beginning at the zero-based character index <nStart> and ending at the
zero-based character index <nEnd>, then calls exGetSel() to retrieve
the new selection start/end and saves these values to
selStart
and selEnd.
If <nStart> = <nEnd> or if <nEnd> is not passed, then
the text caret position within the editor's text is set to <nStart>
Parameters:
<nStart> (Required)
The zero-based character index of the first character in the selection.
<nEnd> (Optional - Default = <nStart>)
The zero-based character index of the last character in the selection.
Returns:
selStart.
See also:
exGetSel,
getSelectionLines,
hideSelection,
replaceSel
findDialog
Displays the enhanced jsRichEdit Find/Replace dialog
customized according to the optional parameters passed. If no parameters are
passed, the resulting dialog is a modeless non-MDI smallTitle topMost Find Text
dialog with no TaskBar button.
Parameters:
<lReplace> (Optional - Default = false)
True = Display the Replace Text dialog.
False = (Default) Display the Find Text dialog.
<lMDI> (Optional - Default = false)
True = The dialog is an MDI child window of the frameWindow.
False = The dialog is a desktop-level window.
<lModal> (Optional - Default = false)
True = The dialog is modal.
False = The dialog is modeless.
<lSmallTitle> (Optional - Default = false)
True = The dialog has a small TitleBar.
False = The dialog has a normal TitleBar.
<lTaskBar> (Optional - Default = false)
True = Place a button on the system taskbar.
False = Do not place a button on the system taskbar.
<lTopMost> (Optional - Default = false)
True = The dialog is a topMost window.
False = The dialog is not a topMost window.
Returns:
True = The dialog was opened successfully.
False = There was a problem when attempting to open the dialog.
See also:
findTextEx,
goToLineDialog
findTextEx
Finds the text <cText> in the
editor contents. <cText> is required. If no other parameters are passed,
the search starts at the current caret position and searches forward
(downward) through the text, case is ignored, partial words will match,
the search will wrap from the current position to the end and then back
to the beginning until a match is found or the end of the text is
encountered. If the text is found, it is scrolled into view and highlighted.
Parameters:
<cText> (Required)
The text to find in the editor.
<cStart> (Optional - Default = C)
B = Start at the bottom (end) of the editor contents.
C = Start from the current caret position.
T = Start at the top (beginning) of the editor contents.
<lUp> (Optional - Default = false)
True = Search from <cStart> to the top (beginning) of the
text in the editor.
False = Search from <cStart> to the bottom (end) of the text in the editor.
<lCase> (Optional - Default = false)
True = Only find text in the editor that matches the upper/lower
casing of the search argument <cText>.
False = Ignore casing in the search.
<lWord> (Optional - Default = false)
True = Require whole-word matches.
False = Allow partial-word matches.
<lStop> (Optional - Default = false)
True = Stop when the beginning or end of the text in the editor is reached.
False = Wrap around the beginning or end of the text in the editor and
continue the search until all text in the editor has been searched.
<lHide> (Optional - Default = false)
True = Do not scroll the text into view.
False = Scroll the found text into the editor's viewing rectangle
and select the found text.
Returns:
-1 = The text specified in cText was not found.
<n> = The zero-based character index of the beginning of the
target string found in the editor.
See also:
findDialog,
findWordBreak
findWordBreak
Find the next word before or after the specified position <nIndex>.
Parameters:
<nIndex> (Optional - Default = Current position)
Zero-based character index of where to begin the search.
<nOp> (Optional - Default = 5)
0 = Search from nIndex to the left.
1 = Search from nIndex to the right.
2 = Return nonzero if character at nIndex is a delimiter, 0 otherwise.
3 = Get character class and word-break flags of character at nIndex.
4 = Find the character before nIndex that starts a word.
5 = (Default) Find the character after nIndex that starts a word.
6 = Find the word-break character before nIndex.
7 = Find the word-break character after nIndex.
<lMove> (Optional - Default = false)
False = Do not move to the new position.
True = Move to the new position.
Returns:
The return value is dependent on nOp:
If nOp = 0, the zero-based index of the nearest character that begins a
word before the specified position.
If nOp = 1, the zero-based index of the nearest character that begins a
word after the specified position.
If nOp = 2, nonzero if the character at the specified position is a
delimiter, or zero otherwise.
If nOp = 3, the character class and word-break flags of the character
at the specified position. See "Word break flags" in the file
jsRichEdit.h for a description of the flags returned.
If nOp = 4, the zero-based index of the character that begins a word
before the specified position.
If nOp = 5, the zero-based index of the character that begins a word
after the specified position.
If nOp = 6, the zero-based index of the word end before the specified position.
If nOp = 7, the zero-based index of the end-of-word delimiter after the
specified position.
See also:
findTextEx
fmtLines
Set the editor control's usage of soft line-break characters according to
<lSoft>. A soft line break is 2 carriage returns followed by a linefeed.
Parameters:
<lSoft> (Optional - Default = false)
True = Use soft line-break characters.
False = Do not use soft line-break characters.
Returns:
The new setting for soft line-break characters from the editor.
True = Use soft line-break characters.
False = Do not use soft line-break characters.
fontDialog
Displays the system font dialog for the user to select the
current font and font attributes and sets the selections in the editor's current
font and font attributes. This also has the effect of updating the
font*
property members.
Parameters: None
Returns:
True = The user clicked OK and the font and attributes were
successfully set in the editor.
False = The user clicked Cancel, or the user's font selections were not
successfully set in the editor.
See also:
getCharFormat,
setCharFormat
getAutoURLDetect
Determines whether automatic URL detection is enabled in the editor and sets
urlDetect
accordingly. The editor detects URLs beginning with the prefixes file:, ftp:,
gopher:, http:, https:, mailto:, news:, nntp:, prospero:, telnet::, and wais:.
Parameters: None
Returns:
urlDetect
True = Automatic URL detection is enabled.
False = Automatic URL detection is disabled.
See also:
autoURLDetect,
urlDetect
getCaretIndex
Retrieves the zero-based character index of the caret position in the editor and sets
caretIndex
to the value retrieved.
Parameters: None
Returns:
caretIndex
Returns:
caretIndex
See also:
getCaretX,
getCaretY
getCaretX
Retrieves the insertion caret pixel position in x/y editor coordinates and saves to
caretX
and caretY.
Parameters: None
Returns:
caretX
See also:
getCaretIndex,
getCaretY
getCaretY
Retrieves the insertion caret pixel position in x/y editor coordinates and saves to
caretX
and caretY.
Parameters: None
Returns:
caretY
See also:
getCaretIndex,
getCaretX
getCharFormat
Retrieves the character format
(font characteristics) of the text at the specified position and set
font*
properties accordingly.
Parameters:
<lWord> - (Optional - Default = false)
True = Get the character format of the word at the caret.
False = Get the character format of the current selection if there is a current
selection, or the character format of the character immediately before the text
caret if there is no text currently selected.
Returns:
True if successful, false otherwise.
See also:
fontDialog,
setCharFormat
getColumnNo
Retrieves the zero-based character position of the caret in the current line and save to
columnNo.
Parameters: None
Returns:
columnNo.
See also:
getLineNo
getEditStyle
Retrieves the current edit style flags for the editor and sets the
ses*
properties to the edit style flags.
Parameters: None
Returns:
The current style settings as a numeric composite flag value.
See also:
getOptions,
getTextMode,
getTypographyOptions,
setEditStyle,
setOptions,
setTextMode,
setTypographyOptions
getFirstVisibleLine
Retrieves the zero-based line index of the first visible line in the editor.
Parameters: None
Returns:
The zero-based line index of the first visible line in the editor.
See also:
getScrollPos,
getThumb,
lineScroll,
scroll,
setScrollPos
getLimitText
Retrieves the size of the editor's edit buffer in characters and sets
limitText
accordingly. The default size is 32767 when the editor is first created.
Parameters: None
Returns:
limitText
See also:
exLimitText
getLine
Retrieves the text from the line at the zero-based line index <nLine>.
Parameters:
<nLine> (Optional - Default = current line)
The zero-based line index of the line from which to retrieve the text.
<nSize> (Optional - Default = 256)
The default buffer size for the line length (nSize) is 256 characters.
The optional nSize parameter specifies a longer or shorter line length if needed.
Returns:
The text contained in the specified line.
See also:
lineLength
getLineCount
Retrieves the total number of lines of text in the editor.
Parameters: None
Returns:
The total number of lines in the editor.
See also:
getTextLengthEx,
getWordCount
getLineNo
Retrieves the zero-based line index of the current line in the editor and saves to
lineNo.
Parameters: None
Returns:
lineNo
See also:
getColumnNo
getModify
Retrieves the modify flag which
indicates whether the user has made changes to the editor contents.
Parameters: None
Returns:
True = The editor contents have been modified.
False = The editor contents have not been modified.
See also:
setModify
getOptions
Retrieves the current edit option flags for the editor and sets the
eco*
properties to the edit option flags.
Parameters: None
Returns:
The current option settings as a numeric composite flag value.
See also:
getEditStyle,
getTextMode,
getTypographyOptions,
setEditStyle,
setOptions,
setTextMode,
setTypographyOptions
getParaFormat
Retrieves the paragraph format options for the current paragraph and sets
para*
properties to the current paragraph's format options.
Parameters: None
Returns:
True = The current paragraph format was retrieved successfully,
False = The paragraph format options could not be retrieved.
See also:
setParaFormat
getParagraphCount
Retrieves the number of paragraphs in the editor text.
Parameters: None
Returns:
The number of paragraphs in the editor.
See also:
getTextLenghEx,
getWordCount
getPasswordChar
Get the password display character (if any) that is currently set in the editor and set
passwordChar
accordingly.
Parameters: None
Returns:
passwordChar
See also:
setPasswordChar
getPriorityClipboardFormat
Determines if one of a variable
number of clipboard formats is available in the clipboard.
Parameters:
Accepts a variable number of parameters. The parameters are numeric and
represent predefined clipboard format constants. The clipboard format
constants are the CF_* constants in the jsWin.h file.
Returns:
The first format found from the parameter list for which data is in the
clipboard, or
0 if the clipboard is empty.
-1 if the clipboard contains data but not in any of the specified
formats in the parameter list.
See also:
pasteSpecial
getRect
Retrieves the viewing rectangle size within the editor and sets
rectLeft,
rectTop,
rectRight,
and rectBottom
accordingly.
Parameters: None
Returns:
rectLeft
See also:
setRect
getRedoName
Retrieves the type of the currently available redo operation in the editor.
Parameters: None
Returns:
0 = No redo operation available.
1 = Typing
2 = Delete
3 = Drag and drop
4 = Cut
5 = Paste
See also:
cut,
emptyUndoBuffer,
getUndoName,
pasteSpecial
getScrollPos
Retrieves the current scroll position of the editor viewing
area in pixel coordinates and saves the horizontal position to
scrollX
and the vertical position to
scrollY.
Parameters: None
Returns:
scrollY
See also:
getFirstVisibleLine,
getThumb,
lineScroll,
scroll,
setScrollPos
getSelectionLines
Retrieves the zero-based line
index numbers containing the current selection start and selection end and set
selStartLine
and selEndLine
accordingly
Parameters: None
Returns:
selStartLine
See also:
exGetSel,
exSetSel,
hideSelection
getSelText
Retrieves the currently selected text in the editor.
Parameters: None
Returns:
The currently selected text if successful, or an empty string if
unsuccessful or if there is no text selected.
See also:
getLine,
getTextEx,
getTextRange
getTextEx
Retrieves the specified text
from the editor. The parameters to this method determine the text retrieved.
Parameters:
<lSelection> (Optional - Default = false)
False = Retrieve all text from the editor.
True = Retrieve the selected text (if any) from the editor.
<lXlateCR> (Optional - Default = false)
False = Do not translate CR to CRLF.
True = Translate CR to CRLF.
<lUnicode> (Optional - Default = false)
False = Retrieve the text using the ANSI codepage.
True = Retrieve the text using the Unicode codepage.
Returns:
The specified text from the editor or an empty string if an error
occurs or the parameters are incorrect.
See also:
getLine,
getSelText,
getTextLengthEx,
getTextRange
getTextLengthEx
Retrieves the total length of the text in the editor.
Determining the total text length requires a number of variables. The parameters
to this method determine the settings to use for the calculation of the text length.
Parameters:
<lXlateCR> (Optional - Default = false)
False = Do not translate CR to CRLF.
True = Translate CR to CRLF.
<lBytes> (Optional - Default = false)
False = Compute the size in characters.
True = Compute the size in bytes.
<lPrecise> (Optional - Default = false)
False = Compute a precise count.
True = Compute an estimated count.
<lUnicode> (Optional - Default = false)
False = Compute the size using the ANSI codepage.
True = Compute the size using the Unicode codepage.
Returns:
The length of the text computed using the parameters specified.
See also:
lineLength
getTextMode
Retrieves the current operating modes of the editor and sets
modeRichText
and modeMultiCP
accordingly.
Parameters: None
Returns:
modeRichText
See also:
getEditStyle,
getOptions,
getTypographyOptions,
setEditStyle,
setOptions,
setTextMode,
setTypographyOptions
getTextRange
Retrieves a range of characters
at zero-based character indices <nStart> - <nEnd>.
Parameters:
<nStart> (Required)
Zero-based character index of the first character to retrieve.
<nEnd> (Required)
Zero-based character indes of the last character to retrieve.
Returns:
The specified range of characters or an empty string if the specified
range is invalid.
See also:
getLine,
getSelText,
getTextEx
getThumb
Retrieves the vertical scrollbar thumb (slider) position.
Parameters: None
Returns:
The vertical scrollbar thumb position.
See also:
getFirstVisibleLine,
getScrollPos,
lineScroll,
scroll,
setScrollPos
getTypographyOptions
Retrieves the current typography options of the editor and sets
advancedTypography
accordingly. Currently the only supported option is advancedTypography.
Parameters: None
Returns:
advancedTypography.
See also:
getEditStyle,
getOptions,
getTextMode,
setEditStyle,
setOptions,
setTextMode,
setTypographyOptions
getUndoName
Retrieves the type of the currently available undo operation in the editor.
Parameters: None
Returns:
0 = No redo operation available.
1 = Typing
2 = Delete
3 = Drag and drop
4 = Cut
5 = Paste
See also:
cut,
emptyUndoBuffer,
getRedoName,
pasteSpecial
getWordCount
Retrieves the number of words in the editor text.
Parameters: None
Returns:
The number of words in the editor text.
See also:
getParagraphCount,
getTextLengthEx
getZoom
Retrieves the current editor display zoom factor as percent and sets
zoom
accordingly.
Parameters: None
Returns:
zoom
See also:
setZoom
goToLine
Moves the current position in the editor (the position where
the text caret is) to the line specified in <nLine> and updates
lineNo
accordingly.
Parameters:
<nLine> (Required)
The zero-based line index of the line to move to.
Returns:
The zero-based new current line number.
See also:
goToLineDialog
goToLineDialog
Displays the Go To Line modal
dialog for the user to specify which line to move to, moves the current
position in the editor to the line specified by the user and updates
lineNo
accordingly.
Parameters: None
Returns:
The zero-based new current line number.
See also:
findDialog,
goToLine
hasFocus
Determines if the editor has the input focus.
Parameters: None
Returns:
True = The editor has the input focus.
False = The editor does not have the input focus.
hideSelection
Hides or shows the current selection (if any) in the editor and sets
selectionHidden
to the value of lHide.
Parameters: None
<lHide> (Optional - Default = false)
False = Show selection.
True = Hide selection.
Parameters: None
Returns:
selectionHidden
See also:
exGetSel,
exSetSel,
getSelectionLines
isRTFFile
Checks the contents of the file specified in the fully qualified
file <cFile> in an attempt to verify if it is a file containing RTF text.
Note that this is only a gross quick test of the first few bytes of the file header.
Parameters: None
Returns:
True if the file is an RTF file.
False if the file is not an RTF file.
See also:
loadFromFile,
streamFromFile
isScrollBarVisible
Determines whether the scrollBar specified in <nBar> is currently visible
in the window represented by <hWND>.
Parameters:
<hWND> (Required)
Window handle of the window containing the scrollBar.
<nBar> (Optional - Default = 1)
1 = Horizontal scrollBar.
2 = Vertical scrollBar.
Returns:
True = The scrollBar is visible.
False = The scrollBar is not visible.
See also:
loadFromFile,
streamFromFile
lineIndex
Retrieves the zero-based
character index of the first character in line <nLine>, or in other words,
the starting position of the line <nLine> within the editor contents.
Parameters:
<nLine> (Optional - Default = current line)
The line number for which to retrieve the starting position.
Returns:
The zero-based character index of the first character in line nLine.
See also:
getLine,
lineLength
lineLength
Retrieve the length of the line containing the zero-based
character index <nChar>. Or if <nChar> = 1, retrieve the
number of unselected characters in lines containing the selection.
Parameters:
<nChar> (Optional - Default = current character of current line)
The zero-based character index contained in the line for which to retrieve the length.
Returns:
If n # 1, the length of the line containing the zero-based character
index <nChar>.
If n = 1, the number of unselected characters in lines containing the selection.
See also:
getLine,
lineIndex
lineScroll
Scroll the contents vertically <nLines> in the edit control.
Parameters:
<nLines> (Optional - Default = 1)
The number of lines to scroll.
Returns:
True for a multi-line editor.
False for a single-line editor.
See also:
getThumb,
setScrollPos
loadFromFile
Loads <cFilename> into the editor using the parameters specified.
Parameters:
<cFilename> (Optional - Default = user-specified)
If cFilename is not specified, displays the dBL getFile dialog to prompt for the
file to load. Otherwise attempts to load <cFilename>
<lInsert> (Optional - Default = false)
True = Insert the file at the current caret position.
False = Replace any text currently in the editor with the contents of the file.
<cSkeleton> (Optional - Default = false)
Specifies the initial filename skeleton for the getFile dialog.
<cCaption> (Optional - Default = "Open File")
Specifies the caption of the getFile dialog.
<cTypes> (Optional - Default = ".rtf,.txt;")
Specifies the allowable filetypes for the getFile dialog (PLUS v2.02
and above only)
Returns:
True = A file was successfully loaded into the editor.
False = A file was not loaded into the editor due to an error or the
user cancelled the getFile dialog.
See also:
isRTFFile,
saveToFile,
setReadOnly,
streamFromFile,
streamToFile
mBitOr
Performs a multiple bitOr operation on a variable number of parameters passed.
Parameters:
Variable number of numeric parameters to be combined using the bit-wise
bitOr dBL function.
Returns:
The numeric result of the multiple bitOr operation.
pasteSpecial
Insert the clipboard content of the specified format
<nFormat> into the editor at the current caret position.
Parameters:
<nFormat> (Optional - Default = based on formats available in the clipboard)
The format to paste from the clipboard. If nFormat is not specified,
the editor will attempt to paste the most described (most formatted)
format available in the clipboard.
Returns: None
See also:
canPaste,
emptyUndoBuffer,
getPriorityClipboardFormat,
redo,
undo
posFromChar
Retrieve the pixel-based editor client coordinates of the
zero-based character index <nChar>. The horizontal component of the coordinate is saved to
posX,
the vertical component of the coordinate is saved to
posY.
Parameters:
<nChar> (Optional - Default = current caret position)
The zero-based character index for which to retrieve the pixel coordinates for.
Returns:
posX
See also:
charFromPos
print
Prints contents of the editor and set printJob to the identifier handle for the print job.
Parameters:
<lDialog> (Optional - Default = false)
True = Display system Print dialog box to allow user selection of
printer and associated print parameters.
False = Do not display system Print dialog box.
<cName> (Optional - Default = current filename or "New File")
Document name as it will appear in the print spooler window.
<cFile> (Optional - Required if printing to file)
Filename to use if printing to file instead of to printer.
<cType> - (Optional - Required if printing to file)
If printing to file, determines content format of the file. Acceptable
values for cType are "raw" or "emf".
Returns:
True = The print operation was successful.
False = An error was encountered during the print operation.
See also:
printClient,
printPreview
printClient
Print the visible contents in the client area of the editor.
Sets printJob with the identifier handle of the print job.
Parameters:
<cFile> (Optional - Required if printing to file)
Filename to print to if printing to file instead of to printer.
<hDC> (Optional - Default described below)
Handle to a device context to print to. If hDC is not
specified, will print to the current view device context if one exists,
or will print to the system default printer otherwise.
Returns:
True = The print operation was successful.
False = An error was encountered during the print operation.
See also:
print,
printPreview
printPreview
Turns Print Preview on/off.
Parameters:
<lPreview> (Optional - Default = false)
True = Turn Print Preview on.
False = Turn Print Preview off.
<oPreview> - (Optional - Default = editor window)
Object reference to an object to render the Print Priview
to. If oPreview is not passed, Print Preview occurs within the editor
window and auto-scaled to fit within the editor window.
Returns:
True = Print Preview was successful.
False = An error was encountered during the Print Preview operation.
See also:
print,
printClient
redo
Reverse (redo) the most recent undo operation.
Parameters: None
Returns:
True = The redo operation was successful.
False = The redo operation failed or there were no redo actions available.
See also:
canRedo,
emptyUndoBuffer,
getRedoName,
getUndoName,
undo
redraw
Force a repaint of any window represented as hWND.
Parameters:
<hWND> (Optional - Default = the editor window's hWND)
hWND of the window to repaint.
Returns: None
replaceSel
Replace the currently selected text in the editor with <cText>. If there
is no text selected, then insert <cText> at the current caret position.
Parameters:
<cText> (Optional - Default = empty string)
The text to insert into the editor at the current selection position.
<lUndo> (Optional - Default = true)
Specifies whether the operation can be added to the undo buffer.
True = The operation can be undone.
False = the operation cannot be undone.
Returns: None
See also:
exGetSel,
exSetSel,
findDialog,
findTextEx
saveToFile
Write the specified editor contents to a file.
Parameters:
<cFilename> (Required)
Name of the file to write the contents to.
<lSelection> (Optional - Default = false)
True = Write only the selected text in the editor (if any) to the file.
False = Write all editor contents to the file.
<lXlateCR> (Optional - Default = false)
True = Translate CR to CRLF.
False = Do not perform CR translation.
<lUnicode> (Optional - Default = false)
True = Save as unicode text.
False = Save as ANSI text.
Returns:
True = The specified write operation completed without error.
False = An error was encountered during the write operation.
See also:
loadFromFile,
,
streamFromFile,
streamToFile
scroll
Scroll the contents vertically in the edit control.
Parameters:
<nType> (Optional - Default = 0)
Specifies the type of scroll to be performed.
0 = Scroll up 1 line.
1 = Scroll down 1 line.
2 = Scroll up 1 page.
3 = Scroll down 1 page.
Returns:
The actual number of lines scrolled.
See also:
getScrollPos,
getFirstVisibleLine,
getThumb,
lineScroll,
scrollCaret,
setScrollPos
scrollCaret
Scroll the caret into view in the editor.
Parameters: None
Returns: None
See also:
getScrollPos,
getFirstVisibleLine,
getThumb,
lineScroll,
scroll,
setScrollPos
selectionType
Retrieve the content type of the current selection in the editor.
Parameters: None
Returns:
The SEL_* constants in the jsRichEdit.h file.
setCharAttribute
Called by the
setFont*
methods.
Can also be called directly. Sets the character attributes specified in
<nMask> to the values preset in xCHARFORMAT data structure.
Parameters:
<nMask> (Required)
Composite numeric value containing the mask flag bits for the
xCHARFORMAT fields to assign to the current character(s) attributes
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the default editor default.
False = Apply to the current selection.
Returns:
True if successful
False if unsuccessful.
See also:
setFont* methods
setCharFormat
Set the character format (font characteristics) of the text at
the specified position to the this.fontxxx property settings. SetCharFormat is
used internally by other jsRichEdit methods. It should not normally be necessary
to call setCharFormat from dBL application code. Use the
setFont*
methods instead.
Parameters:
<nMask> (Optional - Default = 0xFFFFFFFF)
Composite set of bit flags that determine which font attributes to set.
<lWord> (Optional - Default = false)
True = Set the character format of the word at the caret.
False = (Default) Set the character format of the current selection if there is
a current selection, or the character immediately before the text caret if there
is no text currently selected.
<lDefault> (Optional - Default = false)
True = Set the editor's default character format.
False = (Default) Set the character format of the current word or current
selection according to lWord.
Returns:
True = The font attributes were set successfully.
False = The font attributes were not set.
See also:
setFont* methods
setColorBkgnd
Sets the editor background color to <nColor> and updates
colorBkgnd.
Parameters:
<nColor> (Optional - Default = system window background color)
Color to set for the background color.
NOTE: Colors are in BGR order and numeric.
Examples as hex:
0xFF0000 = bright blue.
0x00FF00 = bright green.
0x0000FF = bright red.
Returns:
The previous background color.
See also:
setColorText,
setColorTextBkgnd
setColorText
Set colorText to the color passed in <nColor> and updates
colorText
to the new text color set in the editor.
Parameters:
<nColor> (Optional - Default = 0 - black)
New color for text.
Color formats are the same as described for
setBkgndColor.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the default editor default.
False = Apply to the current selection.
Returns:
colorText
See also:
getCharFormat,
setColorTextBkgnd
setColorTextBkgnd
Set colorTextBkgnd to the color passed in <nColor> and updates
colorTextBkgnd
to the new text color set in the editor.
Parameters:
<nColor> (Optional - Default = 0xFFFFFF - white)
Color formats are the same as described for
setBkgndColor.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the default editor default.
False = Apply to the current selection.
Returns:
colorTextBkgnd
See also:
getCharFormat,
setColorText
setEditStyle
Set the editor style bits based on the
ses*
properties and update the ses* properties to reflect what
has actually been set in the editor.
Parameters: None
Returns:
The new option flags as a composite numeric value.
See also:
getEditStyle,
getOptions,
getTextMode,
getTypographyOptions,
setOptions,
setTextMode,
setTypographyOptions
setFontBold
Set fontBold to the value passed in <lBold> and update
fontBold
to the new value.
Parameters:
<lBold> (Optional - Default = false)
True = Turn on bold for the currently selected text (if any) or
newly entered text at the current position.
False = Turn off bold for the currently selected text (if any) or newly
entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontBold
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontHidden
Set
fontHidden
to the value passed in <lHidden> and update fontHidden to the new value.
Parameters:
<lHidden> (Optional - Default = false)
True = Turn on the hidden attribute for the currently selected
text (if any) or newly entered text at the current position.
False = Turn off the hidden attribute for the currently selected text (if any)
or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontHidden
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontItalic
Set fontItalic to the value passed in <lItalic> and update
fontItalic
to the new value.
Parameters:
<lItalic> (Optional - Default = false)
True = Turn on italic for the currently selected text (if any) or
newly entered text at the current position.
False = Turn off italic for the currently selected text (if any) or
newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontItalic
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontName
Set fontName to the value passed in <cFont> and update
fontName
to the new value.
Parameters:
<cFont> (Optional - Default = "Arial")
The fontName to apply to the currently selected text (if any) or newly
entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontName
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontProtected
Set
fontProtected
to the value passed in <lProtected> and update fontProtected to the new value.
Parameters:
<lProtected> (Optional - Default = false)
True = Turn on the protected attribute for the currently selected text (if
any) or newly entered text at the current position.
False = Turn off the protected attribute for the currently selected text (if any)
or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontProtected
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontRevised
Set
fontRevised
to the value passed in <lRevised> and update fontRevised to the new value.
Parameters:
<lRevised> (Optional - Default = false)
True = Turn on the revised attribute for the currently selected text (if
any) or newly entered text at the current position.
False = Turn off the revised attribute for the currently selected text (if any)
or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontRevised
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontRevisionAuthor
Set
fontRevisionAuthor
to the value passed in <nAuthor> and update fontRevisionAuthor to the new value.
Parameters:
<nAuthor> (Optional - Default = 0)
The author identifier index (0 - 255) to apply to the currently selected text
(if any) or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontRevisionAuthor
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontSize
Set fontSize to the value passed in <nSize> and update
fontSize
to the new value.
Parameters:
<nSize> (Required)
The size of the font in points to apply to the currently selected text
(if any) or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontSize
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontSizeRelative
Set a new fontSize relative to the
current fontSize by a factor of <n> where <n> = -1637 to +1638.
Negative decreases the size, positive increases the size. This is used for
decreasing/increasing the fontSize of selected text proportionally even
when the selected text contains varying fontSizes.
Parameters:
<n>
The relative sizing factor to apply to the currently selected text (if
any) or newly entered text at the current position.
Returns:
True if no error occurred
False otherwise.
See also:
setFontSize
setFontStrikeOut
Set fontStrikeOut to the value passed in <lStrikeOut> and update
fontStrikeOut
to the new value.
Parameters:
<lStrikeout> (Optional - Default = false)
True = Turn on StrikeOut for the currently selected text (if any)
or newly entered text at the current position.
False = Turn off StrikeOut for the currently selected text (if any) or
newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontStrikeOut
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontSubScript
Set
fontSubScript
to the value passed in <lSubScript> and update fontSubScript to the new value.
Parameters:
<lSubScript> (Optional - Default = false)
True = Turn on SubScript for the currently selected text (if any)
or newly entered text at the current position.
False = Turn off SubScript for the currently selected text (if any) or
newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontSubScript
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontSuperScript
Set
fontSuperScript
to the value passed in <lSuperScript> and update fontSubScript to the new value.
Parameters:
<lSuperScript> (Optional - Default = false)
True = Turn on SuperScript for the currently selected text (if any)
or newly entered text at the current position.
False = Turn off SuperScript for the currently selected text (if any) or
newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontSuperScript
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontUnderline
Set fontUnderline to the value passed in <lUnderline> and update
fontUnderline
and fontUnderlineType
to the new value.
Parameters:
<lUnderline> (Optional - Default = false)
True = Turn on underline for the currently selected text (if any)
or newly entered text at the current position.
False = Turn off underline for the currently selected text (if any) or
newly entered text at the current position.
<nType> (Default = 1)
Type of underlining.
0 = None
1 = Underline
2 = Word - Displays as normal underline in rich edit
3 = Double - Displays as normal underline in rich edit
4 = Dotted
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontUnderline
See also:
getCharFormat,
setCharAttribute,
setCharFormat
setFontYOffset
Set fontYOffset to the value passed in <nSize> and update
fontYOffset
to the new value.
Parameters:
<nOffset> (Required)
The vertical offset of the font in points to apply to the currently selected text
(if any) or newly entered text at the current position.
<lWord> (Optional - Default = false)
True = Apply to the current word only.
False = Apply to the current selection.
<lDefault> (Optional - Default = false)
True = Apply as the editor default.
False = Apply to the current selection.
Returns:
fontYOffset
See also:
setFontSubScript,
setFontSuperScript
setMarginLeft
Set the left margin to <nWidth> in pixels and updates the
marginLeft
property member. The left margin is the space between the left edge of
the editor and the beginning of the text.
Parameters:
<nWidth> (Optional - Default = 0)
The new width in pixels for the left margin.
Returns: None
See also:
setMarginRight
setMarginRight
Set the right margin to <nWidth> in pixels and updates the
marginRight
property member. The right margin is the space
between the right edge of the text and the right edge of the editor.
Parameters:
<nWidth> (Optional - Default = 0)
The new width in pixels for the right margin.
Returns: None
See also:
setMarginLeft
setModify
Set the modify flag on or off according to <lModify>.
The modify flag is used to indicate whether the user has made any changes to the
contents in the editor. The editor automatically sets this flag to true when the
user makes any changes to the contents of the editor. The jsRichEdit class resets
this flag when the editor's contents are saved.
Parameters:
<lModify> (Optional - Default = false)
True = The user has modified the contents in the editor.
False = The user has not modified the contents in the editor.
Returns:
The new modify state of the editor.
See also:
getModify
setOptions
Set the editor option bits based on the current settings of the
eco*
properties and update the eco* properties to reflect what has actually been set
in the editor.
Parameters: None
Returns:
The new option flags as a composite numeric value.
See also:
getOptions
setParaAlignment
Sets the paragraph alignment to the value of <nAlign>.
Parameters:
<nAlign> (Optional - Default = 1)
1 = Left
2 = Right
3 = Center
4 = Justify
Note: Option 4 (Justify) requires advancedTypography to be set to true also.
Returns:
The new paragraph alignment set in the editor.
See also:
advancedTypography,
getTypographyOptions,
setTypographyOptions
setParaFormat
Called by other SetPara* methods to set individual paragraph
formatting options. Can also be called externally if the correct xPARAFORMAT
member(s) are set prior to calling. See the jsRichEdit.CC source code for
details regarding how to call this method.
Parameters:
<nMask> (Required)
Composite numeric mask indicating which members of the xPARAFORMAT
structure contain values to be set. The <nMask> value will be
placed in the xPARAFORMAT.dwMask member.
Returns:
True = The setting was sucessfully changed.
False = An error occurred.
See also:
getParaFormat
setParaLineSpacing
Sets the spacing between lines within a paragraph to <nSpace>.
Used in conjunction with
paraLineSpacingRule.
Parameters:
<nSpace> (Optional - Default = 0)
The amount of vertical space in twips (1/1440th inch) between lines
within the current paragraph.
Returns:
paraLineSpacing
See also:
getParaFormat,
paraLineSpacing,
paraLineSpacingRule,
setParaFormat,
setParaLineSpacingRule
setParaLineSpacingRule
Sets the rule for the vertical spacing between the lines of text
within the current paragraph in the editor to <nRule>. Used in conjunction with
paraLineSpacing.
Parameters:
<nRule> (Optional - Default = 0)
0 = Single-spaced lines
1 = 1.5 spaced lines
2 = Double-spaced lines
3 = Use paraLineSpacing value in twips for line spacing but single-spaced is minimum.
4 = Use paraLineSpacing value in twips for line spacing as absolute (no minimum).
5 = Use paraLineSpacing value / 20 (essentially points) for line
spacing as absolute (no minimum).
Returns:
The line spacing rule value actually set in the editor.
See also:
getParaFormat,
paraLineSpacing,
paraLineSpacingRule,
setParaFormat,
setParaLineSpacing
setParaNumbering
Sets the paragraph numbering type to the type option specified in <nType>.
Parameters:
<nType> (Optional - Default = 0)
0 = None
1 = Bullets
2 = Numbers (1, 2, 3,...)
3 = Lowercase letters (a, b, c,...)
4 = Uppercase letters (A, B, C,...)
5 = Lowercase Roman numerals (i, ii, iii,...)
6 = Uppercase Roman numerals (I, II, III,...)
Returns:
The new numbering type option actually set in the editor.
See also:
getParaFormat,
paraNumbering,
paraNumberingStart,
paraNumberingStyle,
paraNumberingTab,
setParaNumberingStart,
setParaNumberingStyle,
setParaNumberingTab
setParaNumberingStart
Sets the paragraph numbering start to <nStart>.
Parameters:
<nStart> (Optional - Default = 1)
The starting number for paragraph numbering. Note that this affects
numbered as well as lettered paragraphs.
Returns:
The new starting number actually set in the editor.
See also:
getParaFormat,
paraNumbering,
paraNumberingStart,
paraNumberingStyle,
paraNumberingTab,
setParaNumbering,
setParaNumberingStyle,
setParaNumberingTab
setParaNumberingStyle
Sets the paragraph numbering style (delimiter characters)
to the style option specified in <nStyle>.
Parameters:
<nStyle> (Optional - Default = 2)
0 = Display as: n)
1 = Display as: (n)
2 = Display as: n.
3 = Display as: n
4 = Hide numbers.
Returns:
The new numbering style option actually set in the editor.
See also:
getParaFormat,
paraNumbering,
paraNumberingStart,
paraNumberingStyle,
paraNumberingTab,
setParaNumbering,
setParaNumberingStart,
setParaNumberingTab
setParaNumberingTab
Sets the tab position for where the text
starts after the paragraph numbering to the position in <nPos>.
Parameters:
<nPos> (Optional - Default = 0)
The position in twips (1/1440th inch) after the paragraph numbering
where the left edge of the text should start.
Returns:
The new numbering tab position actually set in the editor.
See also:
getParaFormat,
paraNumbering,
paraNumberingStart,
paraNumberingStyle,
paraNumberingTab,
setParaNumbering,
setParaNumberingStart,
setParaNumberingStyle
setParaOffset
Sets the indenting/outdenting of the lines of text after the
first line of text in the current paragraph in the editor to <nOffset>.
Parameters:
<nOffset> (Optional - Default = 0)
If <nOffset> is positive, the second and subsequent lines are
outdented. If <nOffset> is negative, the second and subsequent
lines are indented. This value is in twips (1/1440th inch).
Returns:
The new offset value actually set in the editor.
See also:
getParaFormat,
paraOffset,
paraRightIndent,
paraStartIndent,
setParaRightIndent,
setParaStartIndent
setParaRightIndent
Sets the indentation of the right edge of the text in the
current paragraph relative to the right margin in the editor window to <nIndent>.
Parameters:
<nIndent> (Optional - Default = 0)
The amount of indentation in twips (1/1440th inch) of the right edge of the text.
Returns:
The new indentation value actually set in the editor.
See also:
getParaFormat,
paraOffset,
paraRightIndent,
paraStartIndent,
setParaOffset,
setParaStartIndent
setParaSpaceAfter
Sets the amount of vertical space after the paragraph end
for the current paragraph in the editor to <nSpace>.
Parameters:
<nSpace> (Optional - Default = 0)
The amount of vertical space in twips (1/1440th inch) after the current paragraph.
Returns:
The new space after value actually set in the editor.
See also:
getParaFormat,
paraSpaceAfter,
paraSpaceBefore,
setParaSpaceBefore
setParaSpaceBefore
Sets the amount of vertical space before the paragraph start
for the current paragraph in the editor to <nSpace>.
Parameters:
<nSpace> (Optional - Default = 0)
The amount of vertical space in twips (1/1440th inch) before the current paragraph.
Returns:
The new space before value actually set in the editor.
See also:
getParaFormat,
paraSpaceAfter,
paraSpaceBefore,
setParaSpaceAfter
setParaStartIndent
Sets the indenting/outdenting of the first line of text in
the current paragraph in the editor to <nOffset>.
Parameters:
<nOffset> (Optional - Default = 0)
The amount to indent the first line of the paragraph. This value is in
twips (1/1440th inch).
Returns:
The new offset value actually set in the editor.
See also:
getParaFormat,
paraOffset,
paraRightIndent,
paraStartIndent,
setParaOffset,
setParaRightIndent
setPasswordChar
Sets the editor's password character to <xChar>.
Parameters:
<xChar> (Optional)
Can be any displayable single character. If <xChar> is an empty string (""),
the password character function is turned off and the actual text is displayed.
Or <xChar> can be the numeric ASCII value of the character, or 0
to turn off the password character.
If no parameter is passed, turn off the password character.
Returns:
The new password character currently set in the editor as a string.
See also:
getPasswordChar
setReadOnly
Sets the editor's contents as readonly according to <lReadOnly>.
Parameters:
<lReadOnly> (Optional - Default = false)
True = The editor's contents are readonly.
False = The editor's contents can be changed by the user.
Returns:
True = The flag was set successfully.
False = An error occurred when attempting to set the flag.
See also:
saveToFile,
streamOut,
streamToFile
setRect
Sets the viewing rectangle position and size within the editor and sets
rectLeft,
rectTop,
rectRight,
and rectBottom
to the values actually set in the editor.
Parameters:
<nLeft> (Optional - Default = 0)
The position of the left edge of the viewing rectangle relative to the
left edge of the editor window.
<nTop> (Optional - Default = 0)
The position of the top edge of the viewing rectangle relative to the
top edge of the editor window.
<nRight> (Optional - Default = right edge of editor window)
The position of the right edge of the viewing rectangle relative to the
left edge of the editor window.
<nBottom> (Optional - Default = bottom edge of the editor window)
The position of the bottom edge of the viewing rectangle relative to
the top edge of the editor window.
Returns:
rectLeft
See also:
getRect
setScrollPos
Scrolls the editor viewing window horizontally
by <nX> and vertically by <nY> in pixels and updates
scrollX
and scrollY
to
the new values actually set in the editor.
Parameters:
<nX> (Optional - Default = 0)
The horizontal scroll amount.
<nY> (Optional - Default = 0)
The vertical scroll amount.
Returns:
scrollY
See also:
getScrollPos
setTabStops
Sets tabstops in the editor according to the variable number of parameters passed.
Parameters:
If no parameters are passed, tabstops are set at every 32 dialog units.
If one numeric parameter is passed, tabstops are set at every nParm dialog units.
If more than one numeric parameters are passed, tabstops are set at the
specified dialog units.
Returns:
True = The specified tabstops were successfully set in the editor.
False = The specified tabstops were not set in the editor.
See also:
tabDialog
setTextEx
Loads the text <cText> into the editor.
Parameters:
<cText> (Required)
The text to load into the editor.
<lSelection> (Optional - Default = false)
False = The existing text in the editor (if any) is deleted and the new
text cText is inserted in its place.
True = The selected text is replaced with the text in cText. If
no text is currently selected, the text in cText is inserted at the
current caret position.
<nCP> (Optional - Default = CP_ACP - ANSI codepage)
The codepage assigned to cText.
Returns:
0 if the operation failed.
If setting all of the text in the editor and the operation succeeds,
the return value is 1.
If setting the selection in the editor and the operation succeeds, the
return value is the number of characters set in the editor.
See also:
exGetSel,
getTextEx
setTextMode
Sets the text mode of the editor.
Parameters:
<lRT> (Optional - Default = false)
False = Richtext mode is turned off. The editor is placed in plaintext mode.
True = Richtext mode is turned on.
<lMC> (Optional - Default = false)
False = Text from multiple code pages is not allowed.
True = Text from multiple code pages is allowed.
Returns:
True = The new mode is successfully set.
False = An error occurred while trying to change the text mode.
See also:
getTextMode
setTypographyOptions
Sets the typography option for advanced or simple according to <lAdvanced>.
Parameters:
<lAdvanced> (Optional - Default = false)
False = Simple line wrap and justification are used.
True = Advanced line wrap and justification are used.
Note: Advanced typography must be set to true to display text justified
between the editor's borders.
Returns:
The new setting actually set in the editor.
See also:
getEditStyle,
getOptions,
getTextMode,
getTypographyOptions,
setEditStyle,
setOptions,
setTextMode
setUndoLimit
Sets the limit for the number of undo operations that can
be buffered to <nLimit> actions and store the new limit to
undoLimit.
Parameters:
<nLimit> (Optional - Default = 100)
The new undo limit.
Returns:
undoLimit.
NOTE: The return value may be less than requested in n if memory is
currently constrained.
See also:
emptyUndoBuffer,
redo,
stopGroupTyping,
undo
setView
Sets the editor editing display mode (view) to the mode specified in <nView>.
Parameters:
<nView> (Optional - Default = 1)
0 = Unwrapped view. The text is not formatted.
1 = Normal view. The text is formatted to the editing rectangle size.
2 = Page Layout view. The text in the editor is formatted as it will
appear when printed as text is being entered and modified.
Returns:
True = The requested view was successfully set.
False = An error was encountered when attempting to set the requested view.
setZoom
Sets the current editor display
zoom factor as a percentage according to <nZoom> and update
zoom
to the new value actually set in the editor.
Parameters:
<nZoom> (Optional - Default = 100)
The percentage zoom factor to apply. If nZoom is not passed or is 100,
then turn off zoom.
Returns:
zoom
See also:
getZoom
showScrollBar
Shows or hides the horizontal or vertical ScrollBar in the editor.
Parameters:
<nSB> (Optional - Default = 0)
0 = Horizontal ScrollBar
1 - Vertical ScrollBar
<lShow> (Optional - Default = false)
True = Show the scrollbar specified in nSB.
False = Hide the scrollbar specified in nSB.
Returns: None
See also:
setScrollPos
stopGroupTyping
Tell the editor to stop collecting typing into the
current undo action start another undo action.
Parameters: None
Returns: None
See also:
setUndoLimit,
redo,
undo
streamFromFile
Loads a plaintext or richtext file into the editor with an
optional Open File dialog, and either replaces all text or the selected text in
the editor with the new text from the file.
Note: This method requires jsUtils.dll to be available in the standard
system dll load path. See the dBASE online help topic for LOAD DLL for
information regarding the system dll load path search sequence.
Parameters:
<lInsert> (Optional - Default = false)
True = Insert the file contents at the current caret position and
replace selected text (if any) with the file contents.
False = Remove any existing text in the editor and load the file
contents into the editor.
<cFilename> (Optional - user-selected file)
The filename to load. If an empty string is passed for
<cFilename>, a Open File (getFile) dialog is opened to allow the
user to select the file to open.
<cSkeleton> (Optional - Default = "*.txt;*.rtf")
Initial filename skeleton for the File Open dialog.
<cCaption> (Optional - Default = "Open File")
Caption for Open File dialog.
<cTypes> (Optional - Default = ".rtf,.txt")
This parameter is only functional on PLUS v2.02 and above.
The list of allowable filetypes that the user can select.
Returns:
True = A file was successfully loaded into the editor.
False = The user clicked the Cancel PushButton in the Open File dialog,
or an error occurred when loading the file into the editor.
See also:
loadFromFile,
saveToFile,
setReadOnly
streamIn,
streamOut,
streamToFile
streamIn
Streams text into the editor from the source specified in hSource.
Note: This method requires jsUtils.dll to be available in the standard
system dll load path. See the dBASE online help topic for LOAD DLL for
information regarding the system dll load path search sequence.
Parameters:
<hSource> (Required)
The handle to use as the source. This can be a file handle returned
from the WinAPI or from the dBL fOpen() function. Or it can be 0xFFFFFFFF
if streaming from a dBL text string memory variable used as a buffer.
<lInsert> (Optional - Default = false)
Tells the editor to insert into the existing contents or delete
existing text and start anew with the new source text.
True - The source text is inserted at the current position within
the existing text contents if any.
False - The existing text is deleted and replaced by the new source text.
<lRTF> (Optional - Default = false)
Tells the editor whether the source is RTF or plaintext.
False - The source is plaintext.
True - The source is RTF.
<lType> (Optional - Default = false)
If lRTF = true and lType = false - Stream all RTF keywords.
If lRTF = true and lType = true - Stream only RTF keywords that
are common to all languages.
If lRTF = false and lType = false - The text is ANSI.
If lRTF = false and lType = true - The text is Unicode.
Returns:
The byte count that was actually streamed into the editor or -1 if an
error occurs.
See also:
streamFromFile,
streamOut,
streamToFile
streamOut
Streams text from the editor to the target specified in hTarget.
Note: This method requires jsUtils.dll to be available in the standard
system dll load path. See the dBASE online help topic for LOAD DLL for
information regarding the system dll load path search sequence.
Parameters:
<hTarget> (Required)
The handle to use as the target. This can be a file handle returned from the
WinAPI or from the dBL fOpen() function. Or it can be 0xFFFFFFFF if streaming
to a dBL text string memory variable used as a buffer.
<lSelection> (Optional - Default = false)
True = Stream only the current selection in the editor (if any).
False = Stream the entire editor contents.
<lRTF> (Optional - Default = false)
True = Stream as richtext.
False = Stream as plaintext.
<lType> (Optional - Default = false)
If lRTF = true and lType = false - Stream all RTF keywords.
If lRTF = true and lType = true - Stream only RTF keywords that
are common to all languages.
If lRTF = false and lType = false - Stream out ANSI text.
If lRTF = false and lType = true - Stream out unicode text.
If lRTF = true and nCP # 0 - Stream using codepage specified in <nCP>.
<nCP> - (Optional)
The codepage to be used for streaming.
Returns:
The number of characters written to the data stream.
See also:
setModify,
streamFromFile,
streamIn,
streamToFile
streamToFile
Streams the specified editor contents to a file.
Note: This method requires jsUtils.dll to be available in the standard
system dll load path. See the dBASE online help topic for LOAD DLL for
information regarding the system dll load path search sequence.
Parameters:
<cFilename> (Required)
Filename to stream the editor contents to.
<lSelection> (Optional - Default = false)
True = Stream only the selected contents in the editor (if any) to the file.
False = Stream the entire contents in the editor to the file.
<lUnicode> (Optional - Default = false)
True = Stream as unicode text.
False = Stream as ANSI text.
Returns:
True = The streaming operation completed successfully.
False = An error was encountered during the streaming operation.
See also:
loadFromFile,
saveToFile,
setModify,
streamIn,
streamOut,
streamFromFile
tabDialog
Displays a Tabs dialog box for the user to view and set tabstops in the editor.
If the user cancels out of the Tab dialog, nothing is done. If the user does not
cancel out of the Tab dialog, the editor tabs are set according to the user's selections.
Parameters: None
Returns:
True = The user clicked the OK PushButton in the Tabs dialog and
the tab settings were set in the editor.
False = The user clicked the Cancel PushButton in the Tabs dialog or an
error occurred.
Returns:
True = The user did not cancel out of the Tab dialog and the editor tabs
were set to the user's tab settings.
False = The user cancelled out of the Tab dialog.
See also:
setTabStops
toDBCS
Converts a string containing single-byte characters to a string containing double-byte characters.
Parameters:
<xSB> (Required)
The single-byte string to convert.
<lTerminate> (Optional - Default = false)
True = Add terminating null (chr(0)) character to the end of the returned double-byte string.
False = Do not add a terminating null character to the end of the returned double-byte string.
<nLen> (Optional - Default = Convert all characters.
The number of characters in <xSB> to convert.
<nCP> (Optional - Default = CP_ACP - ANSI codepage)
The codepage to use for the conversion.
Returns:
The double-byte representation of the character string.
See also:
toSBCS
toSBCS
Converts a string containing double-byte characters to a string containing
single-byte characters.
Parameters:
<xSB> (Required)
The double-byte string to convert.
<lTerminate> (Optional - Default = false)
True = Add terminating null (chr(0)) character to the end of the returned single-byte string.
False = Do not add a terminating null character to the end of the returned single-byte string.
<nLen> (Optional = Default = Convert all characters.
The number of characters in <xSB> to convert.
<nCP> (Optional - Default = CP_ACP - ANSI codepage)
The codepage to use for the conversion.
Returns:
The single-byte representation of the character string.
See also:
toDBCS
undo
Undo the most recent user edit operation.
Parameters: None
Returns:
For multi-line editors, returns true if successful, false otherwise.
For single-line editors, always returns true.
See also:
canRedo,
canUndo,
emptyUndoBuffer,
getRedoName,
getUndoName,
stopGroupTyping