This unit contains definition of XEdit control and add-ons, that can
be useful to make it more power. XEdit is very similar to TEdit in VCL and allows to view
and edit single text string in a small edit box. Do not forget to call UseStdKeyboard to
allow editing of text in XEdit control using keyboard.
Four additional add-ons are available to expand behaviour of XEdit: XCaretShower
(painting of blinking caret), XEditMouseSelect (selecting and
scrolling of text and changing caret position with mouse), XEditClibboard
(copy/cut/paste to/from clipboard) and XEditUndo (undo/redo
operations for XEdit). You may use any set of these four, or not use its at all, reducing
size of your executable.
XEdit is derived from XCustomControl (XEdit < XCustomBevel <
XCustomControl), so it is self-painting at all. I.e., XEdit is not MFC-based and has no
handle (is not windowed), and its focusing is emulated by parent XForm.
XEdit
XEdit properties:
eoBlendHighlightNoFocus, | blend highlighting of selected part when XEdit control is not focused; | |
eoRemoveHighlightNoFocus, | remove (visually only) highlighting of selected part when XEdit control is not focused; | |
eoEnterNoFocus, | when ENTER is pressed during editing, XEdit control is loosing focus, passing it to the next focusable control on form; | |
eoAutoSelect, | select all content of XEdit when focus was otained by clickin the mouse left button on it (and SelLength was 0, elsewhere, selection is not changed); | |
eoPassword, | show '*' symbols instead of Text characters; | |
eoUndo1 ) ); | allow undo only to initial (or fixed by call to EditUndo.Fix method) state of XEdit control. |
Also variable StdEditOptions : XEditOptions is
defined in XEdits.pas unit. Its value [ eoBlendHighlightNoFocus, eoAutoSelect,
eoEnterNoFocus ] is assigned to Options of newly created XEdit control by default.
Changing of its value is affecting all XEdit controls created later.
XEdit methods:
XEdit events:
XEdit add-ons
Add-on | Usage |
Definition |
CaretShower : XCaretShower in XCarets.pas |
UseCaret( Use : Boolean ); | - allows to show blinking caret in edit controls (and may be in other self-painting controls, which require caret). |
EditMouseSelect : XEditMouseSelect in XEditMouseSel.pas |
UseEditMouseSelect; | - allows to select parts of XEdit text, repositioning caret and scroll its text using mouse. |
EditClipBoard : XEditClipboard in XEditClipbrd.pas |
UseEditClipboard; | - allows to copy/cut selected part of XEdit text to clipboard and paste clipboard content to XEdit control (using key combinations Ctrl-C, Ctrl-X/Shift-Delete, Ctrl-V/Shift-Insert or by calls to EditClipboard object methods. |