mirror of https://github.com/buggins/dlangui.git
791 lines
27 KiB
HTML
791 lines
27 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
|
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<title>DlangUI - cross platform GUI library for D programming language - dlangui.widgets.editors</title>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<div class="inner">
|
|
<header>
|
|
<h1>DlangUI</h1>
|
|
<h2>Cross Platform GUI for D programming language</h2>
|
|
</header>
|
|
<section id="downloads" class="clearfix">
|
|
<a href="index.html" id="home" class="button"><span>Home</span></a>
|
|
<a href="api.html" id="home" class="button"><span>API Docs</span></a>
|
|
<a href="screenshots.html" id="home" class="button"><span>Screenshots</span></a>
|
|
<a href="https://github.com/buggins/dlangui/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
|
|
<!--a href="https://github.com/buggins/dlangui/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a-->
|
|
<a href="https://github.com/buggins/dlangui" id="view-on-github" class="button"><span>View on GitHub</span></a>
|
|
</section>
|
|
|
|
<hr>
|
|
<section id="main_content">
|
|
<h1>dlangui.widgets.editors</h1>
|
|
<!-- Generated by Ddoc from src\dlangui\widgets\editors.d -->
|
|
This module contains implementation of <u>editors</u>.
|
|
<br><br>
|
|
EditLine - single line editor.
|
|
<br><br>
|
|
|
|
EditBox - multiline editor
|
|
<br><br>
|
|
|
|
|
|
<br><br>
|
|
<b>Synopsis:</b><br>
|
|
<pre class="d_code"><font color=blue>import</font> dlangui.widgets.<u>editors</u>;
|
|
|
|
</pre>
|
|
|
|
<br><br>
|
|
<b>License:</b><br>
|
|
Boost License 1.0
|
|
<br><br>
|
|
<b>Authors:</b><br>
|
|
Vadim Lopatin, coolreader.org@gmail.com<br><br>
|
|
|
|
<dl><dt><big><a name="EditorActions"></a>enum <u>EditorActions</u>: int;
|
|
</big></dt>
|
|
<dd>Editor action codes<br><br>
|
|
|
|
<dl><dt><big><a name="EditorActions.Left"></a><u>Left</u></big></dt>
|
|
<dd>move cursor one char left<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectLeft"></a><u>SelectLeft</u></big></dt>
|
|
<dd>move cursor one char left with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Right"></a><u>Right</u></big></dt>
|
|
<dd>move cursor one char right<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectRight"></a><u>SelectRight</u></big></dt>
|
|
<dd>move cursor one char right with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Up"></a><u>Up</u></big></dt>
|
|
<dd>move cursor one line up<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectUp"></a><u>SelectUp</u></big></dt>
|
|
<dd>move cursor one line up with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Down"></a><u>Down</u></big></dt>
|
|
<dd>move cursor one line down<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectDown"></a><u>SelectDown</u></big></dt>
|
|
<dd>move cursor one line down with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.WordLeft"></a><u>WordLeft</u></big></dt>
|
|
<dd>move cursor one word left<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectWordLeft"></a><u>SelectWordLeft</u></big></dt>
|
|
<dd>move cursor one word left with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.WordRight"></a><u>WordRight</u></big></dt>
|
|
<dd>move cursor one word right<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectWordRight"></a><u>SelectWordRight</u></big></dt>
|
|
<dd>move cursor one word right with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.PageUp"></a><u>PageUp</u></big></dt>
|
|
<dd>move cursor one page up<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectPageUp"></a><u>SelectPageUp</u></big></dt>
|
|
<dd>move cursor one page up with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.PageDown"></a><u>PageDown</u></big></dt>
|
|
<dd>move cursor one page down<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectPageDown"></a><u>SelectPageDown</u></big></dt>
|
|
<dd>move cursor one page down with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.PageBegin"></a><u>PageBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of page<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectPageBegin"></a><u>SelectPageBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of page with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.PageEnd"></a><u>PageEnd</u></big></dt>
|
|
<dd>move cursor to the end of page<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectPageEnd"></a><u>SelectPageEnd</u></big></dt>
|
|
<dd>move cursor to the end of page with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.LineBegin"></a><u>LineBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of line<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectLineBegin"></a><u>SelectLineBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of line with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.LineEnd"></a><u>LineEnd</u></big></dt>
|
|
<dd>move cursor to the end of line<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectLineEnd"></a><u>SelectLineEnd</u></big></dt>
|
|
<dd>move cursor to the end of line with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DocumentBegin"></a><u>DocumentBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of document<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectDocumentBegin"></a><u>SelectDocumentBegin</u></big></dt>
|
|
<dd>move cursor to the beginning of document with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DocumentEnd"></a><u>DocumentEnd</u></big></dt>
|
|
<dd>move cursor to the end of document<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectDocumentEnd"></a><u>SelectDocumentEnd</u></big></dt>
|
|
<dd>move cursor to the end of document with selection<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DelPrevChar"></a><u>DelPrevChar</u></big></dt>
|
|
<dd>delete char before cursor (backspace)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DelNextChar"></a><u>DelNextChar</u></big></dt>
|
|
<dd>delete char after cursor (del key)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DelPrevWord"></a><u>DelPrevWord</u></big></dt>
|
|
<dd>delete word before cursor (ctrl + backspace)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.DelNextWord"></a><u>DelNextWord</u></big></dt>
|
|
<dd>delete char after cursor (ctrl + del key)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.InsertNewLine"></a><u>InsertNewLine</u></big></dt>
|
|
<dd>insert new line (Enter)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.PrependNewLine"></a><u>PrependNewLine</u></big></dt>
|
|
<dd>insert new line after current position (Ctrl+Enter)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ToggleReplaceMode"></a><u>ToggleReplaceMode</u></big></dt>
|
|
<dd>Turn On/Off replace mode<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Copy"></a><u>Copy</u></big></dt>
|
|
<dd><u>Copy</u> selection to clipboard<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Cut"></a><u>Cut</u></big></dt>
|
|
<dd><u>Cut</u> selection to clipboard<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Paste"></a><u>Paste</u></big></dt>
|
|
<dd><u>Paste</u> selection from clipboard<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Undo"></a><u>Undo</u></big></dt>
|
|
<dd><u>Undo</u> last change<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Redo"></a><u>Redo</u></big></dt>
|
|
<dd><u>Redo</u> last undoed change<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.Tab"></a><u>Tab</u></big></dt>
|
|
<dd><u>Tab</u> (e.g., <u>Tab</u> key to insert tab character or indent text)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.BackTab"></a><u>BackTab</u></big></dt>
|
|
<dd>Tab (unindent text, or remove whitespace before cursor, usually Shift+Tab)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.SelectAll"></a><u>SelectAll</u></big></dt>
|
|
<dd>Select whole content (usually, Ctrl+A)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollLineUp"></a><u>ScrollLineUp</u></big></dt>
|
|
<dd>Scroll one line up (not changing cursor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollLineDown"></a><u>ScrollLineDown</u></big></dt>
|
|
<dd>Scroll one line down (not changing cursor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollPageUp"></a><u>ScrollPageUp</u></big></dt>
|
|
<dd>Scroll one page up (not changing cursor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollPageDown"></a><u>ScrollPageDown</u></big></dt>
|
|
<dd>Scroll one page down (not changing cursor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollLeft"></a><u>ScrollLeft</u></big></dt>
|
|
<dd>Scroll window left<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ScrollRight"></a><u>ScrollRight</u></big></dt>
|
|
<dd>Scroll window right<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ZoomIn"></a><u>ZoomIn</u></big></dt>
|
|
<dd>Zoom in editor font<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditorActions.ZoomOut"></a><u>ZoomOut</u></big></dt>
|
|
<dd>Zoom out editor font<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="splitDString"></a>dstring[] <u>splitDString</u>(dstring <i>source</i>, dchar <i>delimiter</i> = EOL);
|
|
</big></dt>
|
|
<dd>split dstring by delimiters<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="concatDStrings"></a>dstring <u>concatDStrings</u>(dstring[] <i>lines</i>, dstring <i>delimiter</i> = SYSTEM_DEFAULT_EOL);
|
|
</big></dt>
|
|
<dd>concat strings from array using <i>delimiter</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="replaceEolsWithSpaces"></a>dstring <u>replaceEolsWithSpaces</u>(dstring <i>source</i>);
|
|
</big></dt>
|
|
<dd>replace end of lines with spaces<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="TextPosition"></a>struct <u>TextPosition</u>;
|
|
</big></dt>
|
|
<dd>text content position<br><br>
|
|
|
|
<dl><dt><big><a name="TextPosition.line"></a>int <u>line</u>;
|
|
</big></dt>
|
|
<dd><u>line</u> number, zero based<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="TextPosition.pos"></a>int <u>pos</u>;
|
|
</big></dt>
|
|
<dd>character position in line (0 == before first character)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="TextPosition.opCmp"></a>const int <u>opCmp</u>(ref const TextPosition <i>v</i>);
|
|
</big></dt>
|
|
<dd>compares two positions<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="TextRange"></a>struct <u>TextRange</u>;
|
|
</big></dt>
|
|
<dd>text content range<br><br>
|
|
|
|
<dl><dt><big><a name="TextRange.empty"></a>const @property bool <u>empty</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if range is <u>empty</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="TextRange.singleLine"></a>const @property bool <u>singleLine</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if start and end located at the same line<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="TextRange.lines"></a>const @property int <u>lines</u>();
|
|
</big></dt>
|
|
<dd>returns count of <u>lines</u> in range<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditAction"></a>enum <u>EditAction</u>: int;
|
|
</big></dt>
|
|
<dd>action performed with editable contents<br><br>
|
|
|
|
<dl><dt><big><a name="EditAction.Replace"></a><u>Replace</u></big></dt>
|
|
<dd>insert content into specified position (range.start)
|
|
<br><br>
|
|
delete content in range
|
|
<br><br>
|
|
|
|
replace range content with new content<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditOperation"></a>class <u>EditOperation</u>;
|
|
</big></dt>
|
|
<dd>edit operation details for EditableContent<br><br>
|
|
|
|
<dl><dt><big><a name="EditOperation.action"></a>@property EditAction <u>action</u>();
|
|
</big></dt>
|
|
<dd><u>action</u> performed<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditOperation.range"></a>@property ref TextRange <u>range</u>();
|
|
</big></dt>
|
|
<dd>source <u>range</u> to replace with new content<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditOperation.newRange"></a>@property ref TextRange <u>newRange</u>();
|
|
</big></dt>
|
|
<dd>new range after operation applied<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditOperation._content"></a>protected dstring[] <u>_content</u>;
|
|
</big></dt>
|
|
<dd>new content for range (if required for this action)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditOperation._oldContent"></a>protected dstring[] <u>_oldContent</u>;
|
|
</big></dt>
|
|
<dd>old content for range<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditOperation.merge"></a>bool <u>merge</u>(EditOperation <i>op</i>);
|
|
</big></dt>
|
|
<dd>try to <u>merge</u> two operations (simple entering of characters in the same line), return <b>true</b> if succeded<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer"></a>class <u>UndoBuffer</u>;
|
|
</big></dt>
|
|
<dd>Undo/Redo buffer<br><br>
|
|
|
|
<dl><dt><big><a name="UndoBuffer.hasUndo"></a>@property bool <u>hasUndo</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if buffer contains any undo items<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer.hasRedo"></a>@property bool <u>hasRedo</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if buffer contains any redo items<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer.saveForUndo"></a>void <u>saveForUndo</u>(EditOperation <i>op</i>);
|
|
</big></dt>
|
|
<dd>adds undo operation<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer.undo"></a>EditOperation <u>undo</u>();
|
|
</big></dt>
|
|
<dd>returns operation to be undone (put it to redo), <b>null</b> if no <u>undo</u> ops available<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer.redo"></a>EditOperation <u>redo</u>();
|
|
</big></dt>
|
|
<dd>returns operation to be redone (put it to undo), <b>null</b> if no undo ops available<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="UndoBuffer.clear"></a>void <u>clear</u>();
|
|
</big></dt>
|
|
<dd>clears both undo and redo buffers<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditableContentListener"></a>interface <u>EditableContentListener</u>;
|
|
</big></dt>
|
|
<dd>Editable Content change listener<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent"></a>class <u>EditableContent</u>;
|
|
</big></dt>
|
|
<dd>editable plain text (singleline/multiline)<br><br>
|
|
|
|
<dl><dt><big><a name="EditableContent.contentChangeListeners"></a>Signal!EditableContentListener <u>contentChangeListeners</u>;
|
|
</big></dt>
|
|
<dd>listeners for edit operations<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.multiline"></a>@property bool <u>multiline</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if miltyline content is supported<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.text"></a>@property dstring <u>text</u>();
|
|
</big></dt>
|
|
<dd>returns all lines concatenated delimited by '\n'<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.text"></a>@property EditableContent <u>text</u>(dstring <i>newContent</i>);
|
|
</big></dt>
|
|
<dd>replace whole <u>text</u> with another content<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.length"></a>@property int <u>length</u>();
|
|
</big></dt>
|
|
<dd>returns line text<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.line"></a>dstring <u>line</u>(int <i>index</i>);
|
|
</big></dt>
|
|
<dd>returns <u>line</u> text by <i>index</i>, "" if <i>index</i> is out of bounds<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.lineEnd"></a>TextPosition <u>lineEnd</u>(int <i>lineIndex</i>);
|
|
</big></dt>
|
|
<dd>returns text position for end of line <i>lineIndex</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.firstNonSpace"></a>TextPosition <u>firstNonSpace</u>(int <i>lineIndex</i>);
|
|
</big></dt>
|
|
<dd>returns position before first non-space character of line, returns 0 position if no non-space chars<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.lastNonSpace"></a>TextPosition <u>lastNonSpace</u>(int <i>lineIndex</i>);
|
|
</big></dt>
|
|
<dd>returns position after last non-space character of line, returns 0 position if no non-space chars on line<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.lineLength"></a>int <u>lineLength</u>(int <i>lineIndex</i>);
|
|
</big></dt>
|
|
<dd>returns text position for end of line <i>lineIndex</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.maxLineLength"></a>int <u>maxLineLength</u>();
|
|
</big></dt>
|
|
<dd>returns maximum length of line<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.rangeText"></a>dstring[] <u>rangeText</u>(TextRange <i>range</i>);
|
|
</big></dt>
|
|
<dd>return text for specified <i>range</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.correctPosition"></a>void <u>correctPosition</u>(ref TextPosition <i>position</i>);
|
|
</big></dt>
|
|
<dd>when <i>position</i> is out of content bounds, fix it to nearest valid <i>position</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.correctRange"></a>void <u>correctRange</u>(ref TextRange <i>range</i>);
|
|
</big></dt>
|
|
<dd>when <i>range</i> positions is out of content bounds, fix it to nearest valid position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.removeLines"></a>protected void <u>removeLines</u>(int <i>start</i>, int <i>removedCount</i>);
|
|
</big></dt>
|
|
<dd>removes <i>removedCount</i> lines starting from <i>start</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.insertLines"></a>protected void <u>insertLines</u>(int <i>start</i>, int <i>count</i>);
|
|
</big></dt>
|
|
<dd>inserts <i>count</i> empty lines at specified position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.replaceRange"></a>protected void <u>replaceRange</u>(TextRange <i>before</i>, TextRange <i>after</i>, dstring[] <i>newContent</i>);
|
|
</big></dt>
|
|
<dd>inserts or removes lines, removes text in range<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.moveByWord"></a>TextPosition <u>moveByWord</u>(TextPosition <i>p</i>, int <i>direction</i>, bool <i>camelCasePartsAsWords</i>);
|
|
</big></dt>
|
|
<dd>change text position to nearest word bound (<i>direction</i> < 0 - back, > 0 - forward)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.performOperation"></a>bool <u>performOperation</u>(EditOperation <i>op</i>, Object <i>source</i>);
|
|
</big></dt>
|
|
<dd>edit content<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.hasUndo"></a>@property bool <u>hasUndo</u>();
|
|
</big></dt>
|
|
<dd>return <b>true</b> if there is at least one operation in undo buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.hasRedo"></a>@property bool <u>hasRedo</u>();
|
|
</big></dt>
|
|
<dd>return <b>true</b> if there is at least one operation in redo buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.undo"></a>bool <u>undo</u>();
|
|
</big></dt>
|
|
<dd>undoes last change<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.redo"></a>bool <u>redo</u>();
|
|
</big></dt>
|
|
<dd>redoes last undone change<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditableContent.clearUndo"></a>void <u>clearUndo</u>();
|
|
</big></dt>
|
|
<dd>clear undo/redp history<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase"></a>abstract class <u>EditWidgetBase</u>: <u>dlangui.widgets.scroll.ScrollWidgetBase</u>, <u>dlangui.widgets.editors.EditableContentListener</u>, <u>dlangui.widgets.menu.MenuItemActionHandler</u>;
|
|
</big></dt>
|
|
<dd>base for all editor widgets<br><br>
|
|
|
|
<dl><dt><big><a name="EditWidgetBase.onMenuItemAction"></a>bool <u>onMenuItemAction</u>(const Action <i>action</i>);
|
|
</big></dt>
|
|
<dd><br><br>
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.canShowPopupMenu"></a>bool <u>canShowPopupMenu</u>(int <i>x</i>, int <i>y</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if widget can show popup (e.g. by mouse right click at point <i>x</i>,<i>y</i>)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.isActionEnabled"></a>bool <u>isActionEnabled</u>(const Action <i>action</i>);
|
|
</big></dt>
|
|
<dd>override to change popup menu items state<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.showPopupMenu"></a>void <u>showPopupMenu</u>(int <i>x</i>, int <i>y</i>);
|
|
</big></dt>
|
|
<dd>shows popup at (<i>x</i>,<i>y</i>)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.getCursorType"></a>uint <u>getCursorType</u>(int <i>x</i>, int <i>y</i>);
|
|
</big></dt>
|
|
<dd>returns mouse cursor type for widget<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.wantTabs"></a>@property bool <u>wantTabs</u>();
|
|
</big></dt>
|
|
<dd>when <b>true</b>, Tab / Shift+Tab presses are processed internally in widget (e.g. insert tab character) instead of focus change navigation.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.wantTabs"></a>@property EditWidgetBase <u>wantTabs</u>(bool <u>wantTabs</u>);
|
|
</big></dt>
|
|
<dd>sets tab size (in number of spaces)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.readOnly"></a>@property bool <u>readOnly</u>();
|
|
</big></dt>
|
|
<dd>readonly flag (when <b>true</b>, user cannot change content of editor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.readOnly"></a>@property EditWidgetBase <u>readOnly</u>(bool <u>readOnly</u>);
|
|
</big></dt>
|
|
<dd>sets readonly flag<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.replaceMode"></a>@property bool <u>replaceMode</u>();
|
|
</big></dt>
|
|
<dd>replace mode flag (when <b>true</b>, entered character replaces character under cursor)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.replaceMode"></a>@property EditWidgetBase <u>replaceMode</u>(bool <u>replaceMode</u>);
|
|
</big></dt>
|
|
<dd>sets replace mode flag<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.useSpacesForTabs"></a>@property bool <u>useSpacesForTabs</u>();
|
|
</big></dt>
|
|
<dd>when <b>true</b>, spaces will be inserted instead of tabs<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.useSpacesForTabs"></a>@property EditWidgetBase <u>useSpacesForTabs</u>(bool <u>useSpacesForTabs</u>);
|
|
</big></dt>
|
|
<dd>set new Tab key behavior flag: when <b>true</b>, spaces will be inserted instead of tabs<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.tabSize"></a>@property int <u>tabSize</u>();
|
|
</big></dt>
|
|
<dd>returns tab size (in number of spaces)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.tabSize"></a>@property EditWidgetBase <u>tabSize</u>(int <i>newTabSize</i>);
|
|
</big></dt>
|
|
<dd>sets tab size (in number of spaces)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.content"></a>@property EditableContent <u>content</u>();
|
|
</big></dt>
|
|
<dd>editor <u>content</u> object<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase._ownContent"></a>protected bool <u>_ownContent</u>;
|
|
</big></dt>
|
|
<dd>when ownContent is <b>false</b>, content should not be destroyed in editor destructor<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.content"></a>@property EditWidgetBase <u>content</u>(EditableContent <u>content</u>);
|
|
</big></dt>
|
|
<dd>set <u>content</u> object<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.text"></a>@property dstring <u>text</u>();
|
|
</big></dt>
|
|
<dd>get widget <u>text</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.text"></a>@property Widget <u>text</u>(dstring <i>s</i>);
|
|
</big></dt>
|
|
<dd>set <u>text</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.text"></a>@property Widget <u>text</u>(UIString <i>s</i>);
|
|
</big></dt>
|
|
<dd>set <u>text</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.caretRect"></a>protected Rect <u>caretRect</u>();
|
|
</big></dt>
|
|
<dd>returns cursor rectangle<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.drawCaret"></a>protected void <u>drawCaret</u>(DrawBuf <i>buf</i>);
|
|
</big></dt>
|
|
<dd>draws caret<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.correctCaretPos"></a>protected void <u>correctCaretPos</u>();
|
|
</big></dt>
|
|
<dd>when cursor position or selection is out of content bounds, fix it to nearest valid position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.spacesForTab"></a>protected dstring <u>spacesForTab</u>(int <i>currentPos</i>);
|
|
</big></dt>
|
|
<dd>generate string of spaces, to reach next tab position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.wholeLinesSelected"></a>protected bool <u>wholeLinesSelected</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if one or more lines selected fully<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.indentLine"></a>protected dstring <u>indentLine</u>(dstring <i>src</i>, bool <i>back</i>);
|
|
</big></dt>
|
|
<dd>change line indent<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.indentRange"></a>protected void <u>indentRange</u>(bool <i>back</i>);
|
|
</big></dt>
|
|
<dd>indent / unindent range<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.findKeyAction"></a>protected Action <u>findKeyAction</u>(uint <i>keyCode</i>, uint <i>flags</i>);
|
|
</big></dt>
|
|
<dd>map key to action<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.onKeyEvent"></a>bool <u>onKeyEvent</u>(KeyEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>handle keys<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditWidgetBase.onMouseEvent"></a>bool <u>onMouseEvent</u>(MouseEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>process mouse <i>event</i>; return <b>true</b> if <i>event</i> is processed by widget.<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditLine"></a>class <u>EditLine</u>: <u>dlangui.widgets.editors.EditWidgetBase</u>;
|
|
</big></dt>
|
|
<dd>single line editor<br><br>
|
|
|
|
<dl><dt><big><a name="EditLine.measure"></a>void <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
|
|
</big></dt>
|
|
<dd><u>measure</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditLine.onKeyEvent"></a>bool <u>onKeyEvent</u>(KeyEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>handle keys<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditLine.onMouseEvent"></a>bool <u>onMouseEvent</u>(MouseEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>process mouse <i>event</i>; return <b>true</b> if <i>event</i> is processed by widget.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditLine.layout"></a>void <u>layout</u>(Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>Set widget rectangle to specified value and <u>layout</u> widget contents. (Step 2 of two phase <u>layout</u>).<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditLine.drawLineBackground"></a>protected void <u>drawLineBackground</u>(DrawBuf <i>buf</i>, Rect <i>lineRect</i>, Rect <i>visibleRect</i>);
|
|
</big></dt>
|
|
<dd>override to custom highlight of line background<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditLine.onDraw"></a>void <u>onDraw</u>(DrawBuf <i>buf</i>);
|
|
</big></dt>
|
|
<dd>draw content<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="EditBox"></a>class <u>EditBox</u>: <u>dlangui.widgets.editors.EditWidgetBase</u>;
|
|
</big></dt>
|
|
<dd>single line editor<br><br>
|
|
|
|
<dl><dt><big><a name="EditBox.updateHScrollBar"></a>protected void <u>updateHScrollBar</u>();
|
|
</big></dt>
|
|
<dd>update horizontal scrollbar widget position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.updateVScrollBar"></a>protected void <u>updateVScrollBar</u>();
|
|
</big></dt>
|
|
<dd>update verticat scrollbar widget position<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.onHScroll"></a>bool <u>onHScroll</u>(ScrollEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>process horizontal scrollbar <i>event</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.onVScroll"></a>bool <u>onVScroll</u>(ScrollEvent <i>event</i>);
|
|
</big></dt>
|
|
<dd>process vertical scrollbar <i>event</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.fullContentSize"></a>Point <u>fullContentSize</u>();
|
|
</big></dt>
|
|
<dd>calculate full content size in pixels<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.measure"></a>void <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
|
|
</big></dt>
|
|
<dd><u>measure</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="EditBox.drawLineBackground"></a>protected void <u>drawLineBackground</u>(DrawBuf <i>buf</i>, int <i>lineIndex</i>, Rect <i>lineRect</i>, Rect <i>visibleRect</i>);
|
|
</big></dt>
|
|
<dd>override to custom highlight of line background<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
|
|
</section>
|
|
<footer>
|
|
Dlangui is maintained by <a href="https://github.com/buggins">buggins</a><br>
|
|
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|