Difference between revisions of "SynEdit/de"

From Free Pascal wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
m
Line 1: Line 1:
 
{{SynEdit}}
 
{{SynEdit}}
 
+
<br /><br />
= Allgemein =
+
__TOC__
 
+
<br />
The SynEdit contained in Lazarus is based on on SynEdit 1.3 [[http://synedit.sourceforge.net/]], and was adapted and extended quite a lot. For example UTF-8 support and code folding were added.
+
=Allgemein=
 
+
Lazarus enthält einen Editor namens TSynEdit. Dieser vielseitige Editor kann in den eigenen Projekten verwendet werden. SynEdit bietet für für die Bearbeitung von Quellcode in unterschiedlichen Programmiersprachen unterschiedliche Syntaxhervorhebungen an.<br />
The package contains a source editor component named TSynEdit, several syntax highlighters and other components used for surce editing.
+
SynEdit findet man in der Programmierumgebung Lazarus und dort in der Komponentenleiste als Register '''SynEdit'''.<br />
 
+
<br />
It is licensed under the same terms as the original SynEdit (MPL or GPL)
+
=Highlighting=
 
+
Benötigen Sie in einer speziellen Programmiersprache eine Syntaxhervorhebung (Highlighting), dann können Sie Ihren eigenen [[SynEdit_Highlighter]] schreiben.<br />
= SynEdit in der IDE =
+
<br />
 
+
=(Auto-)Ergänzung=
The SynEdit in lazarus is a built-in package, because the IDE uses it itself. That's why there is no .lpk file.
+
Es gibt in Synedit zwei Plugins für die Auto-Ergänzung.
The components can be found on the component palette on the 'SynEdit' page.
+
* TSynCompletion
 
 
= Verwendung von SynEdit=
 
 
 
== Highlighting ==
 
 
 
* Use an existing Highlighter or Download more from [http://bugs.freepascal.org/view.php?id=18248 Highlighter for SynEdit]
 
* Use a customizable Highlighter (SynAnySyn or SynPositionSyn) (See Examples for how to use)
 
* Write your own [[SynEdit_Highlighter]]
 
 
 
== (Auto-)Ergänzung ==
 
 
 
There are 2 completion plugins for SynEdit:
 
* TSynCompletion (the one used by the IDE)
 
 
* TSynAutoComplete  
 
* TSynAutoComplete  
 +
<br />
 +
=Beispiele für die Verwendung von SynEdit=
 +
Beispiele für die Verwendung von SynEdit finden sich im Ordner
 +
* Linux: lazarus/examples/synedit
 +
* Windows: lazarus\examples\synedit
 +
<br />
 +
==Wie Sie Unterstützung für Copy, Paste, Cut, Undo, Redo, etc hinzufügen==
 +
Diese Eigenschaften können soweit noch nicht vorhanden unter der Verwendung der SynEditKeyCmds implementiert werden.<br />
 +
<syntaxhighlight>
 +
uses
 +
  ...
  
Note: TSynAutoComplete (from the component palette) is <b>not</b> does not have a drop-down.
+
  SynEdit, SynEditKeyCmds;
 
 
See examples for how to use both.
 
 
 
== Ändern von Text mittels Code ==
 
 
 
Text can be accessed via SynEdit.Lines. Changing text via the Lines property does not work with undo/redo
 
  
Use TextBetweenPoints and TextBetweenPointsEx to change text, if you want undo/redo do work.
 
 
= Beispiele =
 
 
<b>Examples can be found in the folder lazarus/examples/synedit</b>
 
 
== Wie Sie Unterstützung für Copy, Paste, Cut, Undo, Redo, etc hinzufügen ==
 
 
These features can be implemented by using SynEdit commands.
 
 
<syntaxhighlight>uses
 
 
   ...
 
   ...
  SynEdit, SynEditKeyCmds;
 
  
 
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;
 
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;
Line 61: Line 41:
 
     end;
 
     end;
 
   end;
 
   end;
end;</syntaxhighlight>
+
end;
  
= Weitere Entwicklung, Diskussionen =
+
  ...
 
 
* RTL (right-to-left): started by Mazen
 
* automatic monospace font selection: At the moment SynEdit starts with a font 'courier'. But it would be better, if SynEdit would start with a monospace font (meaning: every character has the same width). At the moment the LCL TFont does not provide such a property. At the moment the user has to choose the right font.
 
* automatic UTF-8 font selection: Same as above monospace, but also with an UTF-8 font, so that for example umlaute are shown correctly. At the moment the user has to choose the right font.
 
* Dead keys. Most keyboards support typing two or more keys to create one special character (like accented or umlaut characters).
 
* [[Redesign of the SynEdit component]]. The primary goal is more reliable display and navigation in the text. A more modular approach also allows for better integration of extensions, and for specialized controls, for use outside of Lazarus.
 
  
 +
</syntaxhighlight>
 +
<br />
 
=Siehe auch=
 
=Siehe auch=
 +
* [[SynEdit Highlighter]]
 +
<br>
 +
<br>
  
* [[SynEdit Highlighter]]
+
{{AutoCategory}}[[Category:Components/de]]
  
 
[[Category:Components/de]]
 
[[Category:Components/de]]

Revision as of 07:01, 14 June 2014

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) polski (pl) русский (ru) 中文(中国大陆)‎ (zh_CN)



Allgemein

Lazarus enthält einen Editor namens TSynEdit. Dieser vielseitige Editor kann in den eigenen Projekten verwendet werden. SynEdit bietet für für die Bearbeitung von Quellcode in unterschiedlichen Programmiersprachen unterschiedliche Syntaxhervorhebungen an.
SynEdit findet man in der Programmierumgebung Lazarus und dort in der Komponentenleiste als Register SynEdit.

Highlighting

Benötigen Sie in einer speziellen Programmiersprache eine Syntaxhervorhebung (Highlighting), dann können Sie Ihren eigenen SynEdit_Highlighter schreiben.

(Auto-)Ergänzung

Es gibt in Synedit zwei Plugins für die Auto-Ergänzung.

  • TSynCompletion
  • TSynAutoComplete


Beispiele für die Verwendung von SynEdit

Beispiele für die Verwendung von SynEdit finden sich im Ordner

  • Linux: lazarus/examples/synedit
  • Windows: lazarus\examples\synedit


Wie Sie Unterstützung für Copy, Paste, Cut, Undo, Redo, etc hinzufügen

Diese Eigenschaften können soweit noch nicht vorhanden unter der Verwendung der SynEditKeyCmds implementiert werden.

uses
  ...

  SynEdit, SynEditKeyCmds;

  ...

procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (Shift = [ssCtrl]) then
  begin
    case Key of
    VK_C: synCodigo.CommandProcessor(TSynEditorCommand(ecCopy), ' ', nil);
    VK_V: synCodigo.CommandProcessor(TSynEditorCommand(ecPaste), ' ', nil);
    VK_X: synCodigo.CommandProcessor(TSynEditorCommand(ecCut), ' ', nil);
    end;
  end;
end;

  ...


Siehe auch