Class: cTextEdit

Properties  Events  Methods    Index of Classes

Allows the user to enter and edit text

Hierarchy

cObject
---cUIObject
------DfBaseObject
---------DfBaseWindow
------------DfBaseUIWindow
---------------DfBaseControl
------------------DfBaseTextEdit
---------------------cTextEdit
------------------------cDbTextEdit_

Library: Windows Application Class Library

Package: cTextEdit.pkg

Mixins: cEdit_Mixin Standard_Object_Mixin Dflabel_Mixin Shadow_Mixin ToolTip_Support_Mixin RGB_Support_Temp_Mixin Help_Mixin

Description

The cTextEdit class allows the user to enter and edit text.

The cDbTextEdit class is a data-aware class similar to the cTextEdit class.
The cRichEdit class is a rich-text (RTF) class similar to the cTextEdit class.

The default maximum number of characters for the control is 64 KB (65536 bytes or characters). This can be changed or retrieved via piMaxChars.

Sample

Object oTextEdit1 is a cTextEdit
    Set Size to 168 276
    Set Location to 6 10
    Set peAnchors to anAll
End_Object    // oTextEdit1


Syntax

Use cTextEdit.pkg
 
Object oObjectName is a cTextEdit
    Set Size to iHeight iWidth
    Set Location to iRow iColumn
 
    Set Label to sLabelText
    Set Label_Justification_Mode to jMode
    Set Label_Row_Offset to iOffset
    Set Label_Col_Offset to iOffset
 
    Set Status_Help to sStatusHelpText
    Set Enabled_State to True | False
End_Object  // oObjectName


Current Selection in a Rich Edit Control

The user can select text in a rich edit control by using the mouse or the keyboard. The current selection is the range of selected characters, or the position of the insertion point if no characters are selected. An application can get information about the current selection, set it, determine when it changes, and show or hide the selection highlight.

Word and Line Breaks

A rich edit control calls a function called a word-break procedure to find breaks between words and to determine where it can break lines. The control uses this information when performing word-wrap operations and when processing CTRL+LEFT ARROW key and CTRL+RIGHT ARROW key combinations. An application can send messages to a rich edit control to replace the default word-break procedure, to retrieve word-break information, and to determine what line a given character falls on.

A linefeed (LF) character can be added to text programmatically by adding ASCII character 10 to a string using the character function. A carriage return (CR) character can be added to text programmatically by adding ASCII character 13 to a string using the character function. Either a LF or CR character will break the current line in the control. Also see AppendTextLn.

Text Edit Shortcut Keys

Text edit controls support the following shortcut keys.

KeysOperationsComments
Shift+BackspaceGenerate a LRM/LRM on a bidi keyboardBiDi specific
Ctrl+TabTab
Ctrl+ClearSelect all
Ctrl+Number Pad 5Select all
Ctrl+ASelect all
Ctrl+CCopy
Ctrl+VPaste
Ctrl+XCut
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+' (apostrophe)Accent acuteAfter pressing the short cut key, press the appropriate letter (for example a, e, or u). This applies to English, French, German, Italian, and Spanish keyboards only.
Ctrl+` (grave)Accent graveSee Ctrl+' comments.
Ctrl+~ (tilde)Accent tildeSee Ctrl+' comments.
Ctrl+; (semicolon)Accent umlautSee Ctrl+' comments.
Ctrl+Shift+6Accent caret (circumflex)See Ctrl+' comments.
Ctrl+, (comma)Accent cedillaSee Ctrl+' comments.
Ctrl+Shift+' (apostrophe)Activate smart quotes
BackspaceIf text is protected, beep and do not delete it. Otherwise, delete previous character.
Ctrl+BackspaceDelete previous word. This generates a VK_F16 code.
F16Same as Backspace.
Ctrl+InsertCopy
Shift+InsertPaste
InsertOverwriteDBCS (double-byte character set) does not overwrite.
Ctrl+Left ArrowMove cursor one word to the left.On bidi keyboard, this depends on the direction of the text.
Ctrl+Right ArrowMove cursor one word to the right.See Ctrl+Left Arrow comments.
Ctrl+Left ShiftLeft alignmentIn BiDi documents, this is for left-to-right reading order.
Ctrl+Right ShiftRight alignmentIn BiDi documents, this is for right-to-left reading order.
Ctrl+Up ArrowMove to the line above.
Ctrl+Down ArrowMove to the line below.
Ctrl+HomeMove to the beginning of the document.
Ctrl+EndMove to the end of the document.
Ctrl+Page UpMove one page up.If in SystemEditMode and Single Line control, do nothing.
Ctrl+Page DownMove one page down.See Ctrl+Page Up comments.
Ctrl+DeleteDelete the next word or selected characters.
Shift+DeleteCut the selected characters.
EscStop drag-drop.While doing a drag-drop of text.
Alt+EscChange the active application.
Alt+XConverts the Unicode hexadecimal value preceding the insertion point to the corresponding Unicode character.
Alt+Shift+XConverts the Unicode character preceding the insertion point to the corresponding Unicode hexadecimal value.
Alt+0xxx (Number Pad)Inserts Unicode values if xxx is greater than 255. When xxx is less than 256, ASCI range text is inserted based on the current keyboard.Must enter decimal values.
Alt+Shift+Ctrl+F12Hex to Unicode.In case Alt+X is already taken for another use.