Difference between revisions of "Lazarus Tutorial/de"

From Lazarus wiki
Jump to navigationJump to search
m (→‎Das Hauptmenü: Fix typo)
 
(184 intermediate revisions by 23 users not shown)
Line 1: Line 1:
 
{{Lazarus Tutorial}}
 
{{Lazarus Tutorial}}
 +
Zurück zu den [[Additional information/de|Zusätzlichen Informationen]].<br>
 +
<br>
 +
''Dies ist der Anfang eines Lazarus Tutorials. Bitte fühlen Sie sich frei, Ihre Erfahrungen hinzuzufügen.''
 +
== Überblick ==
 +
Lazarus ist ein freies und Open-Source Entwicklungswerkzeug für den FreePascal Compiler, der ebenfalls frei und als Open Source verfügbar ist. Die Lazarus IDE (Integrated Development Environment - [[Screenshots]]) ist eine stabile und feature-reiche Entwicklungsumgebung für die Programmierung eigenständiger interaktiver (grafischer) und einfacher batchorientierter  Konsolenanwendungen. Lazarus läuft gegenwärtig auf Linux, FreeBSD und Win32 und bietet einen anpassbaren Quelltext-Editor, interaktive Gestaltung von Bildschirmoberflächen, einen Package Manager, Debugger und die komplette GUI-Integration mit dem FreePascal Compiler (FPC).
  
''Dies ist der Anfang eines Lazarus Tutorials. Bitte fühlen sie sich frei um ihre Erfahrungen hinzuzufügen.''
+
== Los gehts ==
==Überblick==
 
Lazarus ist ein freies und Open Source Entwicklungs Werkzeug für den FreePascal Compiler (Object Pascal), welcher auch frei und Open Source ist. Die Lazarus IDE ([http://lazarus-ccr.sourceforge.net/kbdata/lazide.jpg Screenshot]) ist eine stabile und Feature reiche Programmierumgebung für die Erzeugung selbständiger graphischer und Konsole Anwendungen. Es läuft gegenwärtig unter Linux, FreeBSD und Win32 und bietet einen anpassbaren Quelltext Editor und visual form creation environment zusammen mit einem Package Manager, Debugger und komplette GUI Integration mit dem FreePascal Compiler.
 
 
 
==Getting Started - Ihr erstes Lazarus Programm!==
 
  
 
(Dank an [[User:Kirkpatc]])
 
(Dank an [[User:Kirkpatc]])
  
Holen, installieren ([[Installing Lazarus]]) und starten von Lazarus wird auch den FreePascal Compiler verfügbar machen.
+
Besorgen Sie sich, installieren Sie (siehe [[Installing Lazarus/de|Installieren von Lazarus]]) und starten Sie Lazarus. Dadurch steht Ihnen auch der Free Pascal Compiler zur Verfügung.
 
 
Verschiedene Fenster werden auf dem Desktop erscheinen: oben das Hauptmenü, der Objektinspektor auf der Linken, der Lazarus Quelltext Editor belegt den größten Teil des Desktop, und ein gebrauchsfertiges Form1 Fenster überlagert den Quelltext Editor.
 
  
Auf dem Menü Fenster, underneath the menu line, is a row of tabs.  If the 'Standard' tab is not already selected, select it by clicking with the mouse. Then find the Button icon (a rectangle with 'OK' on it) and click on that with the mouse.  Then click on the Form1 window, somewhere to the left of the middle.  A shadowed rectangle labelled 'Button1' will appear.  Click again on the Button icon in the Standard tab, and click on the Form1 somewhere to the right of centre: a rectangle labelled 'Button2' will appear.
+
Anmerkung: Zumindest unter Linux Ubuntu, ist der Befehl zum Starten von Lazarus aus einer Konsole "startlazarus". Ansonsten, wenn Sie es von einem Debian-Package installiert haben, sollten Sie einen Menüeintrag "Lazarus" unter Anwendungen / Programmentwicklung haben.
 +
(Problem: In Debian und Ubuntu wurden das Programm und das Package umbenannt zu "lazarus-ide", weil das "tct"-Package bereits ein Hilfsprogramm namens "lazarus" enthielt.)
  
Now click on Button1 to select it. The Object Inspector will display the properties of the object Button1. Near the top is a property named 'Caption', with the displayed value 'Button1'. Click on that box, and change 'Button1' to 'Press'. If you hit ENTER or click in another box, you will see the label of the first button on Form1 change to 'Press'.  Now click on the Events tab on the Object Inspector, to see the various events that can be associated with the button.  These include OnClick, OnEnter, OnExit etc. Select the box to the right of OnClick: a smaller box with three dots (... ellipsis) appears.  When you click on this, you are taken automatically into the Source Editor and your cursor will be placed in a piece of code starting:
+
===  Ihr erstes Lazarus Programm! ===
 +
Wählen Sie aus dem Hauptmenü den Menüpunkt "Projekt --> Neues Projekt --> Anwendung". Eine neu GUI-Anwendung wird erstellt, siehe auch [[Form_Tutorial/de|Form Tutorial]].  
 +
Mehrere Fenster erscheinen auf dem Desktop: das Hauptmenü am oberen Rand, der Objektinspektor links, der Lazarus Quelltexteditor nimmt den größten Teil des Desktops ein, und ein vorgefertigtes Fenster([[TForm/de |Formular]]) namens "Form1" liegt auf dem Quelltexteditor.
 +
Auf dem Menü 'Fenster', unterhalb der Haupt-Menüzeile, ist eine Reihe von Tabs angezeigt. Falls der Tab 'Standard' nicht schon ausgewählt ist, dann wählen Sie ihn mit einem Mausklick aus. Jetzt suchen Sie das [[TButton/de|TButton]]-Symbol (rechteckiges Symbol mit 'OK') und aktivieren es durch einen Mausklick. Dann klicken Sie in das 'Form1' Fenster, irgendwo links der Mitte, und eine Schaltfläche namens 'Button1' wird dort eingesetzt. Klicken Sie erneut auf das Button-Symbol und dann in 'Form1' irgendwo rechts der Mitte: eine zweite Schaltfläche namens 'Button2' wird eingesetzt.
  
 +
Wählen Sie jetzt 'Button1' aus. Der 'Objektinspektor' (links) zeigt die Eigenschaften des Objekts 'Button1' an. Ziemlich weit oben in der Liste steht die Eigenschaft 'Caption' mit dem angezeigten Wert 'Button1'. Klicken Sie in das Feld und ändern Sie 'Button1' zu 'Press'. Wenn Sie die ENTER-Taste drücken oder in ein anderes Feld klicken, ändert sich die Beschriftung des ersten Buttons auf 'Press'. Nun klicken Sie auf den Tab 'Ereignisse' im Objektinspektor, um verfügbare Ereignisse zu sehen, die mit dem Button verbunden werden können. Diese Ereignisse sind OnClick, OnEnter, OnExit, usw. Wählen Sie das Feld rechts von 'OnClick': eine kleinere Schaltfläche mit drei Punkten (... Ellipse) erscheint. Wenn Sie darauf klicken, springt die IDE automatisch in den Quelltext-Editor und der Cursor wird in folgendem Code platziert:
 +
<syntaxhighlight lang=pascal>
 
   procedure TForm1.Button1Click(Sender: TObject);
 
   procedure TForm1.Button1Click(Sender: TObject);
 
   begin
 
   begin
     {now type:}    Button1.caption := 'Press again';
+
     {jetzt tippen Sie:}    Button1.caption := 'Press again';
     {the editor has already completed the procedure with}
+
     {der Editor hat die Procedure bereits komplettiert mit}
 
   end;
 
   end;
 +
</syntaxhighlight>
 +
Drücken Sie {{keypress|F12}}, um das Fenster 'Form1' anstelle des Quelltext-Editors auszuwählen.
  
Press F12 to select the Form1 window instead of the Source Editor.
+
Jetzt bearbeiten Sie die Eigenschaften von 'Button2': klicken Sie in 'Form1' darauf, um seine Eigenschaften im Objektinspektor zu sehen. Ändern Sie das Attribut 'Caption' auf 'Exit' (an Stelle von 'Button2'.) Nun wählen Sie den Tab 'Ereignisse' und klicken in das Feld für 'OnClick'. Klicken Sie auf die '... Ellipse', und Sie werden in den Quelltext-Editor mitgenommen, in die Mitte einer anderen Prozedur:
 
+
<syntaxhighlight lang=pascal>
Now edit the properties of Button2: click on Button2 to display its properties in the Object Inspector. Change its Caption property to 'Exit' instead of 'Button2'. Now select the Events tab, and click on the box for OnClick. Click on the ... ellipsis, and you will be taken into the Source Editor, in the middle of another procedure:
 
 
 
 
   procedure TForm1.Button2Click(Sender: TObject);
 
   procedure TForm1.Button2Click(Sender: TObject);
 
   begin
 
   begin
  {now type:}  Close;
+
    {jetzt tippen Sie:}  Close;
  {the editor has already completed the procedure with}  
+
    {der Editor hat die Procedure bereits komplettiert mit}  
 
   end;
 
   end;
 +
</syntaxhighlight>
 +
Sie sollten Ihre Arbeit jetzt (überhaupt: häufiger!!) speichern durch Auswahl von 'Projekt speichern unter...' mit 'ihr_gewählter_Datei_Name.pas'
  
Now Press F12 to see the Form1 window again. You are now ready to try to compile. The simplest way to do this is to select 'Run' from the main menu at the top, and then the 'Run' option on the sub-menu. Alternatively you could simply type F9. This will first compile and then (if all is well) link and execute your program.
+
Jetzt drücken Sie {{keypress|F12}}, um wieder das Fenster 'Form1' zu sehen. Sie sind jetzt bereit, die Kompilierung zu versuchen. Der einfachste Weg, dies zu tun, ist 'Start' aus dem Hauptmenü zu wählen, und dort wieder die 'Start' Option im Untermenü. Alternativ können Sie einfach {{keypress|F9}} drücken. Dies wird zuerst kompilieren und dann, wenn alles gut geht, Ihr Programm linken und ausführen.
  
Several text windows will appear and all sorts of compiler messages will be typed, but eventually your Form1 window will re-appear, but without the grid of dots;  this is the actual main window of your application, and it is waiting for you to push buttons or otherwise interact with it.
+
Verschiedene Textfenster werden erscheinen und einige Compiler-Meldungen werden geschrieben. Erscheint dann das Fenster 'Form1' ohne das Punktegitter, dann, "Hurra", sehen Sie das aktuelle Hauptfenster ihrer Anwendung. Es wartet darauf, dass die Buttons gedrückt werden.
  
Try clicking on the button labelled 'Press'. You will notice that it changes to 'Press again'. If you press it again, it will still say 'Press again'!!
+
Versuchen Sie auf den Button mit der Beschriftung 'Press' zu klicken. Sie werden bemerken, dass er sich zu 'Press again' ändert. Wenn Sie ihn erneut drücken, wird er immer noch 'Press again' sagen!!
  
Now click on the button marked 'Exit'.  The window will close and the program will exit. The original Form1 window with the grid of dots will reappear, ready to accept more editing activity.
+
Jetzt klicken Sie auf den Button mit 'Exit'.  Das Fenster wird sich schließen und das Programm wird beendet. Das Entwurfs-Fenster 'Form1' mit dem Punktegitter wird wieder angezeigt, bereit, um weitere Bearbeitungsschritte zu akzeptieren.
  
You should save your work now (and frequently!!) by selecting Project > Save As > your_selected_file_name.pas
+
=== Modifizieren Sie Ihr Programm ===
 
+
Öffnen Sie Ihr gespeichertes Projekt wieder.
===Zweite Session.===
+
Im Fenster 'Form1' klicken Sie auf die 'Press' Schaltfläche (Button1), um sie auszuwählen.
Re-open your saved Project.
+
Springen Sie im Quelltext-Editor in die Procedure, die auf den Klick auf Button1 ('Press') reagiert: Wählen Sie dazu den Tab 'Ereignisse' im Objektinspektor aus, klicken in das Feld rechts von 'OnClick', klicken auf die '... Ellipse', und Sie sind an der entsprechenden Stelle im Quelltext-Editor angekommen.
On the Form1 window click on the 'Press' button (Button1) to select it.
 
Select the 'Events' tab on the Object Inspector, click on the right side box next to OnClick, click on the ... ellipsis, to go back to the appropriate point in the Source Editor.
 
 
 
Edit your code to read as follows:
 
  
 +
Verändern Sie Ihren Code wie folgt, achten Sie dabei auf sauberes Setzen der ''';''' und der '''begin ... end''' Strukturen (Sie können den Code auch hier markieren und per Copy-Paste in den Quelltext-Editor kopieren):
 +
<syntaxhighlight lang=pascal>
 
   procedure TForm1.Button1Click(Sender: TObject);
 
   procedure TForm1.Button1Click(Sender: TObject);
{Makes use of the Tag property, setting it to either 0 or 1}
+
  // Machen Sie Gebrauch von der Tag Eigenschaft, setzen Sie sie entweder auf 0 oder 1
 
   begin
 
   begin
     if Button1.tag =0 then
+
     if Button1.tag = 0 then begin
    begin
 
 
       Button1.caption := 'Press again';
 
       Button1.caption := 'Press again';
 
       Button1.tag := 1
 
       Button1.tag := 1
     end else
+
     end else begin
    begin
 
 
       Button1.caption := 'Press';
 
       Button1.caption := 'Press';
 
       Button1.tag := 0
 
       Button1.tag := 0
 
     end
 
     end
 
   end;
 
   end;
 +
</syntaxhighlight>
 +
Speichern Sie Ihre Arbeit, kompilieren und starten Sie neu {{keypress|F9}}. Der linke Button wird jetzt zwischen zwei alternativen Botschaften hin- und herschalten.
  
Save your work, re-compile and run.  The left button will now toggle between two alternative messages.
+
Der Rest liegt an Ihnen!
 
 
The rest is up to you!
 
 
 
If you prefer to write Console- or text-based Pascal programs (for example if you are following a basic Pascal programming course, or you need to write programs to use in batch mode or for system programming), you can still use Lazarus to edit, compile and run your programs.  It make an ideal environment for Pascal development. See [[Console Mode Pascal]].
 
  
==Der Editor==
+
Wenn Sie das Schreiben von Konsole- oder Text-basierten Pascal Programmen bevorzugen (zum Beispiel wenn Sie einem einfachen Pascal Programmierkurs folgen, oder Sie Programme schreiben müssen für die Verwendung im Batchmodus oder für die Systemprogrammierung), können Sie dennoch Lazarus benutzen zum Bearbeiten, Kompilieren und Starten Ihrer Programme. Es bildet eine ideale Umgebung für die Pascal Entwicklung. Siehe [[Console Mode Pascal]].
When you launch Lazarus for the first time, a series of separate disconnected or 'floating' windows will appear on your desk-top.
 
  
The first, running right along the top of the desk-top, is titled '''Lazarus Editor vXXXXXX - project1''' (which will subsequently be modified to reflect the name of your currently-open project).  This is the main controlling window for your project, and contains the Main Menu and the Component Palette.
+
== Der Editor ==
 +
Wenn Sie Lazarus zum ersten Mal starten, wird eine Reihe von separaten getrennten oder 'schwebenden' Fenstern auf Ihrem Desktop erscheinen.
  
<center>[[Image:Lazmain.jpg]]</center>
+
Das erste, gleich oben auf dem Desktop, trägt den Titel '''Lazarus Editor vXXXXXX - project1''' (welches anschließend modifiziert wird um den Namen Ihres gegenwärtig geöffneten Projekt widerzuspiegeln). Dies ist das Hauptsteuerungs Fenster für Ihr Projekt und enthält das Hauptmenü und die Komponentenpalette.
  
On the line below the title bar is the ''Main Menu'' with the usual entries for File, Edit, Search, View functions and so on, with a few selections that are specific to Lazarus.
+
<center>[[Image:Laz de editor1.jpg]]</center>
Below this on the left is a set of BitButtons (which take you rapidly to particular Main Menu options) and on the right is the Component Palette.
 
  
Under the Lazarus Editor window will appear the '''[http://lazarus-ccr.sourceforge.net/kbdata/objinsp.jpg Object Inspector]''' window on the left, and the '''[http://lazarus-ccr.sourceforge.net/kbdata/editor.jpg Lazarus Source Editor]''' on the right.  There may be another smaller window, labelled '''[http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg Form1]''', overlying the Lazarus Source Editor window.  If this is not visible immediately, it can be made to appear by pressing the '''F12''' key, which toggles between the Source Editor view and the Form view.  The Form window is the one on which you will construct the graphical interface for your application, while the Source Editor is the window which displays the Pascal code associated with the application which you are developing. The operation of the Object Inspector is discussed in more detail below while the Component Palette is described.
+
In der Zeile unter der Titelleiste befindet sich das ''Hauptmenü'' mit den üblichen Einträgen für Datei, Bearbeiten, Suche, Ansichtfunktionen und so weiter, mit einigen Auswahlen, die spezifisch für Lazarus sind.
 +
Darunter auf der Linken ist eine Gruppe von BitButtons (welche Sie rasch zu den jeweiligen Hauptmenü Optionen bringen) und auf der Rechten ist die Komponentenpalette.
  
When you start a new project (or when you first launch Lazarus) a default Form will be constructed, which consists of a box in which there is a grid of dots to help you to position the various components of the form, and a bar along the top which contains the usual '''Minimise''', '''Maximise''' and '''Close buttons'''. If you click with your mouse cursor anywhere in this box, you will see the properties of this form displayed in the Object Inspector on the left side of the desk-top.
+
Unter dem Lazarus Editor Fenster wird das '''[http://wiki.lazarus.freepascal.org/Image:ObjectInspector.jpg Objektinspektor]''' Fenster auf der Linken erscheinen, und der '''[http://lazarus-ccr.sourceforge.net/kbdata/editor.jpg Lazarus Quelltext Editor]''' auf der Rechten. Es gibt noch ein anderes kleineres Fenster, beschriftet mit '''[http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg Form1]''', über dem Lazarus Quelltext Editor Fenster. Wenn dieses nicht sogleich sichtbar ist, kann man es durch drücken der {{keypress|F12}} Taste hervorholen, welche zwischen der Quelltext Editor Ansicht und der Formular Ansicht umschaltet. Das Formularfenster ist dasjenige, auf dem Sie das grafische Interface für Ihre Anwendung erstellen, während der Quelltext Editor das Fenster ist, welches den Pascal Code zeigt, der mit der Anwendung verbunden ist, welche Sie gerade entwickeln. Die Bedienung des Objektinspektors wird weiter unten detaillierter behandelt, während die Komponentenpalette beschrieben wird.
  
Other windows that may become visible during your work:  the '''[http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg Project Inspector]''', which contains details of the files included in your project, and allows you to add files to or delete files from your project;  the '''Messages''' window, which displays compiler messages, errors or progress reports on your project;  if Lazarus was launched from a terminal window, the original terminal remains visible and detailed compiler messages are also printed there.
+
Wenn Sie ein neues Projekt starten (oder wenn Sie zuerst Lazarus starten), wird ein vorgegebenes Formular erstellt, welches zusammengesetzt ist aus einem Feld, in dem ein Punktegitter ist, welches Ihnen hilft, die verschiedenen Komponenten des Formulars zu positionieren, und einer Leiste am oberen Rand, welche die üblichen '''Minimieren''', '''Maximieren''' und '''Beenden Buttons''' enthält. Wenn Sie mit Ihrer Maus irgendwo in diesem Feld klicken, werden Sie die Eigenschaften dieses Formulars sehen, angezeigt im Objektinspektor auf der linken Seite des Desktops.
  
 +
Andere Fenster, die während Ihrer Arbeit sichtbar werden könnten: der '''[http://wiki.lazarus.freepascal.org/Image:Lazarus_IDE_ProjectInspector.jpg Projektinspektor]''', welcher Details der Dateien enthält, die in Ihrem Projekt inbegriffen sind, und Ihnen erlaubt, Dateien hinzuzufügen oder zu löschen aus Ihrem Projekt, das '''Nachrichten''' Fenster, welches Compilermeldungen anzeigt, Fehler oder Fortschrittsberichte über Ihr Projekt; wenn Lazarus von einem Terminalfenster gestartet wird, bleibt das orginale Terminal sichtbar und detaillierte Compilermeldungen werden auch dort ausgegeben.
  
===Das Hauptmenü===
+
== Das Hauptmenü ==
  
 
Die Hauptmenü Linie enthält die folgenden Einträge:
 
Die Hauptmenü Linie enthält die folgenden Einträge:
 
<u>D</u>atei  <u>B</u>earbeiten  <u>S</u>uche  <u>A</u>nsicht  <u>P</u>rojekt  Sta<u>r</u>t  <u>K</u>omponenten  <u>W</u>erkzeuge  Ei<u>n</u>stellungen  <u>F</u>enster  <u>H</u>ilfe
 
<u>D</u>atei  <u>B</u>earbeiten  <u>S</u>uche  <u>A</u>nsicht  <u>P</u>rojekt  Sta<u>r</u>t  <u>K</u>omponenten  <u>W</u>erkzeuge  Ei<u>n</u>stellungen  <u>F</u>enster  <u>H</u>ilfe
  
Wie gewöhnlich, können die Optionen gewählt werden entweder durch platzieren des Mauscursors über der Menü Option und klicken der linken Maustaste, oder durch eingeben von Alt-F auf der Tastatur (sofern das Hauptmenü den Fokus hat:  wenn nicht, dann drücken sie TAB mehrmals um den Fokus durch die verschiedenen Fenster zu bewegen bis das gewünschte Fenster mit seiner Titelleiste farbig hervorgehüben ist).
+
Wie gewöhnlich, können die Optionen gewählt werden entweder durch Platzieren des Mauscursors über der Menü Option und klicken der linken Maustaste, oder durch Eingeben von Alt-F auf der Tastatur (sofern das Hauptmenü den Fokus hat:  wenn nicht, dann drücken Sie TAB mehrmals um den Fokus durch die verschiedenen Fenster zu bewegen, bis das gewünschte Fenster mit seiner Titelleiste farbig hervorgehoben ist).
 
 
====Das Datei Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/FileMenuSnapshot.png </div>
 
* '''Neue Unit''': Erzeugt eine neue Unit Datei (Pascal Quelle).
 
* '''Neues Formular''': Erzeugt ein neues Formular:  beide, das visuelle Bildschirmfenster und die verbundene Pascal Quelltext Datei.
 
* '''Neu ...''': Bietet eine pop-up Menü Box ([http://lazarus-ccr.sourceforge.net/kbdata/menu-new.jpg Screenshot]) mit einer Auswahl von neuen Dokumenttypen zum Erzeugen.
 
* '''Öffnen''': Bietet eine pop-up Dialog Box, welche die Navigation durch das Dateisystem ermöglicht und eine existierende Datei zu öffnen.
 
* '''Wiederherstellen''': Abbrechen der Editieränderungen und Wiederherstellen der Datei zu ihrem anfänglichen Status.
 
* '''Wieder öffnen''': Zuletzt geöffnete Dateien wieder öffnen.
 
* '''Speichern''': Speichert die aktuelle Datei, unter Verwendung des originalen Dateinamens. Wenn es noch keinen Namen gibt, wird das System danach fragen (wie bei Speichern unter).
 
* '''Speichern unter''': Erlaubt ihnen, ein Verzeichnis und den Dateinamen zu wählen, um die aktuelle Datei zu speichern.
 
* '''Alles speichern''': Speichert alle geöffneten Dateien.
 
* '''Schließen''': Schließt die aktuelle Datei, fragt ob alle Änderungen gespeichert werden sollen.
 
* '''Alle Editorfenster schließen''': Schließt alle im Editor geöffneten Dateien. Fragt ob Änderungen gespeichert werden sollen.
 
* '''Verzeichnis säubern''': Bietet einen Dialog mit einer Reihe von editierbaren Filtern, um Dateien aus dem gegenwärtigen Verzeichnis zu entfernen.  Nützlich zum Entfernen von .bak Dateien und Überresten von früheren Delphi Projekten.
 
* '''Neustart''': Dürfte selbsterklärend sein.
 
* '''Beenden''': Beendet Lazarus, nachdem gefragt wurde, die editierten Dateien zu speichern.
 
<div style="clear:both;"></div>
 
====Das Bearbeiten Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/EditMenuSnapshot.png </div>
 
* '''Undo''': Undo the last edit action, leaving the Editor in the state just before the last action.
 
* '''Redo''': Re-instates the last action that was reversed by Undo.
 
* '''Cut''': Remove the selected text or other item and place it on the Clipboard.
 
* '''Copy''': Make a copy of the selected text, leaving the original in place, and placing the copy on the Clipboard.
 
* '''Paste''': Places the contents of the Clipboard at the cursor position. If text has been selected at the cursor position, the contents of the Clipboard will replace the selected text.
 
* '''Indent selection''': Move the selected text to the right by the amount specified in Environment -> Editor options -> General -> Block indent.  This feature is useful for formatting your Pascal source code to show the underlying Block structure.
 
* '''Unindent selection''': Removes one level of indenting, moving the text to the left by the amount specified in Block indent.
 
* '''Enclose selection''': Provides a pop-up menu with a number of options for logically enclosing the selected text (begin ... end; try ... except; try ... finally; repeat ... until; { ... } etc).
 
* '''Uppercase selection''': Convert selected text to uppercase.
 
* '''Lowercase selection''': Convert selected text to lowercase.
 
* '''Tabs to spaces in selection''': Converts any tabs in the selected text to the number of spaces specified by Environment -> Editor options -> General -> Tab widths.  The number of spaces is not a fixed quantity, but is the number needed to fill the remaining width of the tab.
 
* '''Break lines in selection''': If any lines in the selected text are longer than 80 characters or the number specified in Environment -> Editor options -> Display -> Right Margin, then the line is broken at a word boundary and continued on the next line.
 
* '''Comment selection''': Makes the selected text into comments  by inserting // on each line.
 
* '''Uncomment selection''': Removes comment marks.
 
* '''Sort selection''': Sort lines (or words or paragraphs) alphabetically;  options for ascending or descending order, case sensitive or insensitive.  In the middle of program source code, of course, it makes no sense, but if you have a list you need to have sorted this will do the trick.
 
* '''Select''': Allows selection of blocks of text.  Options include select all, select to brace, select paragraph or line etc.
 
* '''Insert from character map''': Allows insertion of non-keyboard symbols such as accented characters, picked from a pop-up character map.
 
* '''Insert text''': Displays pop-up menu to allow insertion of standard text such as CVS keywords (Author, Date, Header etc) or GPL notice, username or Current date and time.
 
* '''Complete code''': Completes the code at the cursor. It is context sensitive and saves you a lot of time. For example: it completes classes, by adding private variables, Get and Set property access methods and adding method bodies. On variable assignments (e.g. i:=3;) it adds the variable declarations. On forward defined procedures it adds the procedure bodies. On event assignments (OnClick:=) it adds the method definition and the method body. See [[Lazarus IDE Tools]].
 
* '''Extract procedure''': Uses the selected text (a statement or series of statements) to build a new procedure.
 
<div style="clear:both;"></div>
 
 
 
====Das Suche Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/SearchMenuSnapshot.png </div>
 
* '''Find''': Similar to the facility in almost all graphic text editors:  a pop-up dialog box appears allowing entry of a search text string, with options such as case sensitivity, whole words, origin, scope and direction of search.
 
* '''Find Next, Find previous''': Search again for the previously entered text string, in the specified direction.
 
* '''Find in files''': Search for text string in files:  pop-up dialog with options all open files, all files in project, or all directories;  masks available for selecting file types.
 
* '''Replace''': Similar to '''Find''';  shows pop-up dialog with place to enter search text string and replacement text, and options for case sensitivity, direction etc.
 
* '''Incremental find''': Search for the string while you are entering the search string. Example: after you choose "Incremental Find" if you press "l" the first "l" will be highlighted. If then you press "a", the editor will find the next "la" and so on.
 
* '''Goto line''': Move editing cursor to specified line in file.
 
* '''Jump back''': Move back in file to next Bookmark (need to have used '''Add jump point to history''').  Will move to Bookmarks in other files open in the Editor.
 
* '''Jump forward''': Move forward to next Bookmark.
 
* '''Add jump point to history''': Add Bookmarks or jump points to file.
 
* '''View Jump-History''': Look at list of bookmarks in file: '''Not implemented yet'''.
 
* '''Find other end of code block''': If positioned on a '''begin''', finds the corresponding '''end''' or vice versa.
 
* '''Find code block start''': Moves to the '''begin''' of the procedure or function in which the cursor is placed.
 
* '''Find Declaration at cursor''': Finds the place at which the selected identifier is declared.  This may be in the same file or another file already open in the Editor;  if the file is not open, it will be opened (so if a procedure or function is declared, for example, in <u>classesh.inc </u>, this will be opened in the Editor).
 
* '''Open filename at cursor''': Opens the file whose name is selected at the cursor.  Useful for looking at <u>Include </u> files or the files containing other <u>Units </u> used in the project.
 
* '''Goto include directive''': If the cursor is positioned in a file which is <u>Included</u> in another file, goes to the place in the other file that called the <u>Include</u> file.
 
'''<div style="clear:both;"></div>
 
  
====Das Ansicht Untermenü====
+
Die Hilfe zu einzelnen Menüpunkten finden Sie [[Main menu/de|hier]].
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/ViewMenuSnapshot.png </div>
 
Controls the display of various windows and panels on the screen.
 
* '''Object Inspector''': The window that usually occupies the left side of the Desktop, and displays the features of the Form which is on the desktop.  Clicking with the mouse on any component of the form will cause the details of that component to be displayed in the Object Inspector.  There is a panel at the top which shows the tree-structure of the current project, and the components of the form may optionally be selected in this panel:  this will also cause the corresponding details to be displayed in the Object Inspector.  The main lower panel has two tabs which allow selection of either '''Properties''' or '''Events''' to be displayed.  Selection of '''Properties''' causes features such as name, colour, caption, font, size etc to be displayed:  there are two columns, the left showing the property, and the right showing the value associated with that property. Selection of '''Events''' displays two columns:  the left lists the possible events such as MouseClick or KeyDown associated with that component, and the right shows the action that results from that event.  If there is no action defined, then clicking in the appropriate box or on the <div class="box">...</div> button causes the Source Editor to be displayed, with the cursor already positioned in a dummy Procedure declaration, waiting for event-defining code to be typed in.
 
* '''Source Editor''': The main window in which source code is edited.  Its behaviour is very like that of most other graphical text editors, so that the mouse can move the cursor over the displayed text, and clicking with the left mouse button while dragging the mouse will select and highlight text.  Right clicking with the mouse displays a pop-up menu, but if you are familiar with Windows, Gnome or KDE editors, you will find that the pop-up menu DOES NOT include the usual Edit Cut, Copy or Paste functions, but does include options like Find Declaration or Open File at Cursor.  The top of the Source Editor window has a number of tabs, corresponding to the files that are open for the current project;  clicking on any tab makes that file visible, and you can move easily from file to file, copying and pasting between files and performing most of the normal editing functions.  The Source Editor performs colour syntax highlighting on the code, with different colours for punctuation marks, comments, string constants etc.  It will also maintain the level of indentation from line to line as you type in code, until you change the indentation.  The function and appearance of the Source Editor are very configurable from the Main Menu by selecting Environment -> Editor options and then selecting one of several tabs in the pop-up dialog box.
 
* '''Code Explorer''': A window usually placed on the right of the Desktop which displays, in tree form, the structure of the code in the current unit or program.  It usually opens with just the Unit name and branches for Interface and Implementation sections, but clicking on the <div class="box">+</div> box to the left of any branch will open up its sub-branches or twigs, in more and more detail until individual constants, types and variables are displayed as well as procedure and function declarations.  If you change the file displayed in the main Source Editor window, you need to click on the Refresh button of the Code Explorer to display the structure of the new file.
 
* '''Units...''': Opens a pop-up dialog window with a list of the unit files in the current project.Clicking with the mouse on a filename selects that file; click on Open to display that file in the Source Editor.  Checking the Multi box allows several files to be selected simultaneously, and they will all be opened in the Source Editor (but only one at a time will be displayed).  This Menu Option is rather like the Project -> Project Inspector option, but only displays the list of Unit files and allows them to be opened.
 
* '''Forms...''': Opens a pop-up dialog window with a list of the Forms in the current project, and allows the selection of one or more of them for display.
 
* '''View Unit Dependencies''': Opens a pop-up dialog window that shows, in a tree-like manner, the structure of dependencies of the currently open unit file. Most of the files listed as dependencies will have their own <div class="box">+</div> boxes, which allow the dependencies of the individual files to be explored, often in a highly recursive manner.
 
* '''Toggle form / unit view  F12''': Toggles whether the Source Editor or the current Form is placed on the top layer of the Desktop, and given focus.  If the Source Editor has focus, then you can edit the source code;  if the Form is given focus, you can manipulate the components on the desktop and edit the appearance of the Form.  The easiest way to toggle the display between Editor and Form is to use the F12 key on the keyboard, but the same effect is achieved by selecting this option on the Main Menu.
 
* '''Messages''': A window that displays compiler messages, showing the progress of a successful compilation or listing the errors found.
 
* '''Search Results''': A window that displays the results of find in files.
 
* '''Debug windows''': Opens a pop-up menu with several options for operating and configuring the Debugger.  See below where the [[#The_Debugger|debugger]] is described.
 
<div style="clear:both;"></div>
 
  
====Das Projekt Untermenü====
+
== Die Button-Leiste ==
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/ProjectMenuSnapshot.png </div>
+
Eine kleiner Symbolleisten Bereich links im Haupt Editor Fenster, genau unter dem Hauptmenü und links von der Komponenten Palette, enthält eine Gruppe von Schaltflächen, welche häufig genutzte Hauptmenü Auswahlen wiederholt:
* '''New Project''': Create a new project.  A pop-up dialog window appears offering a choice of types of project to create.
+
: '''Neue Unit''', '''Öffnen''' (mit einem Pfeil zur Anzeige einer drop-down Liste der zuletzt geöffneten Dateien), '''Speichern''', '''Alles speichern''', '''Neues Formular''', '''Formular/Unit wechseln''' (zeigt entweder das Formular oder den Quellcode der Unit), '''Units anzeigen''', '''Formulare anzeigen''', '''Start''', '''Pause''', '''Einzelschritt hinein''', '''Einzelschritt darüber''' (die letzten beiden sind Debugger-Funktionen).
* '''New Project from file''': A Navigation dialog window appears, alowing selection of a file from which to create a new project.
 
* '''Open Project''' Open a project which has already been created and saved.  A navigation dialog appears with a list of Lazarus Project Information (.lpi) files from which a project may be chosen.
 
* '''Open Recent Project''': Displays a pop-up list of recent projects on which you have been working, and allows selection of one of these.
 
* '''Save Project''': Similar to File -> Save:  all the files of the current project are saved;  if they have not previously been saved, there is a prompt for filename(s)-  similar to Save Project As...
 
* '''Save Project As...''': Prompts for filename to save project.  A default filename of Project1.lpi is offered, but you should choose your own filename.  Lazarus will not permit you to use the same name for the Project file and the Unit File (see [[Lazarus Tutorial#The_Lazarus_files| below]]).
 
* '''Publish Project''': Creates a copy of the whole project. If you want to send someone just the sources and compiler settings of your code, this function is your friend. A normal project directory contains a lot of information. Most of it is not needed to be published: the .lpi file contains session information (like caret position and bookmarks of closed units) and the project directory contains a lot of .ppu, .o files and the executable. To create a lpi file with only the base information and only the sources, along with all sub directories use "Publish Project". In the dialog you can setup the exclude and include filter, and with the command after you can compress the output into one archive. See [[Lazarus IDE Tools]]
 
* '''Project Inspector''': Opens a pop-up dialog with a tree-like display of the files in the current project.  Allows you to add, remove or open selected files, or change options of the project.
 
* '''Project Options...''': Opens a pop-up dialog window with tabs for setting options for Application (Title, Output Target file name), Forms (allowing you to select among the available forms, make them Auto-create) and Info (specifying whether editor information should be saved for closed files, or only for project files).  '''I'M NOT REALLY VERY SURE WHAT IS THE SIGNIFICANCE OF THIS:  HELP!!'''
 
* '''Compiler options ...''': (Recently moved here from the Run Menu). Opens a multi-page tabbed window which allows configuration of the compiler.  Tabs include '''Paths''' which allows definition of search paths for units, include files, libraries etc as well as allowing choice of widget type for the forms (gtk, gnome, win32); '''Parsing''' which allows choice of rules for parsing source programs, '''Code''' which allows choice of optimisation for faster or smaller programs, choice of target processor, types of checks, heap size etc; '''Linking''' allowing choice of whether or how to use debugging, static or dynamic libraries, and whether to pass options through to the linker; '''Messages''' to define what type of messages should be generated during error conditions; '''Other''' which allows decision to use default configuration file (fpc.cfg) or some other file; '''Inherited''' which shows a tree structure diagram to indicate how options have been inherited from units already incorporated; '''Compilation''' which allows definition of commands to be executed before or after the compiler is launched and can allow use of Make files.
 
* '''Add editor file to Project''': Add the file currently being edited to the Project
 
* '''Remove from Project''': Gives a pop-up menu of files available for removal from project.
 
* '''View Source''': No matter which file you are editing, takes you back to the main program file (.lpr)or the main .pas file if there is no .lpr.
 
* '''View ToDo List''':Opens a dialog box with a list of ToDo items associated with this project. This will list any ToDo comments in your project (lines commencing //TODO), and any others in the Lazarus units you have used. You need to Refresh the ToDo items in the dialog (using arrow symbol button of toolbar) before new 'ToDos' appear. The first column of the ToDo list contains numbers you have allocated to your ToDo comments; a simple //TODO comment will appear as a zero, but a comment of //TODO999 (for example) will place the number 999 in the first column. Remember there should be no spaces on the line before //TODO and ToDo comments added after the last save will not be shown!
 
  
====Das Start Untermenü====
+
== Die Komponentenpalette ==
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/RunMenuSnapshot.png </div>
+
Eine tabbed Symbolleiste, welche eine große Anzahl von Icons anzeigt, die üblich genutzte Komponenten für die Formularerstellung vertreten.
* '''Build''': Causes Lazarus to build (ie compile) any files in the project that have been changed since the last build.
 
* '''Build all''': Builds all files in the project, whether or not there have been any changes.
 
* '''Abort build''': Stop the build process once it is running - either you have remembered that you did something silly and want to stop the build, or the system seems to be taking far too long and something is obviously wrong.
 
  
* '''Run''': This is the usual way to  launch the compiler and, if compilation is successful, to start execution of the applicationWhat actually happens is that Lazarus saves a copy of your files, then starts the compiler and linker, then begins execution of the final linked binary program.
+
Jeder tab bewirkt die Anzeige von verschiedenen Gruppen von Icons, die eine zweckmäßige Gruppe von Komponenten vertretenDas ganz linke Icon in jeder tabbed Gruppe ist ein schräger linksgerichteter Pfeil, genannt das Auswahlwerkzeug.
* '''Pause''': Suspend execution of the currently running program.  This may allow you to inspect any output that has been generated; execution may be resumed by selecting '''Run''' again.
 
* '''Step into''': Used in conjunction with the debugger, causes execution of the program    one step at a time up to a bookmarked point in the source.
 
* '''Step over''': Causes stepwise execution up to the statement marked, then skips the marked statement, and continues execution at normal speed. Useful in trying to isolate a statement that introduces a logical error.
 
* '''Run to cursor''': Causes execution at normal speed (ie NOT one statement at a time) until the statement is reached where the cursor is located;  then stops.  Resume execution at normal speed by selecting '''Run'''.
 
* '''Stop''': Cease execution of the running program.  Cannot be resumed by selecting '''Run''';  this will start the program again from the beginning (re-compiling if necessary).
 
  
* '''Run Parameters''': Opens a multi-page pop-up window which allows command-line options and parameters to be passed to the program to be executed;  allows selection of display to run program (eg a remote X terminal may be used in Linux);  some system Environment variables may be overridden.
+
Wenn Sie den Mauszeiger über irgendein Icon der Komponentenpalette bewegen, ohne auf das Icon zu klicken, wird der Titel dieser Komponente aufpoppen.  Beachten Sie, dass jeder Titel mit einem 'T' beginnt - das bedeutet 'Typ' oder richtiger 'Klasse' der Komponente. Wenn Sie eine Komponente für die Verwendung in einem Formular auswählen, wird die Klasse zum '''type''' Abschnitt des '''interface''' Teils der Unit hinzugefügt (üblicherweise als Teil des gesamten TForm1), und eine '''instance''' dieser Klasse wird zum '''var''' Abschnitt hinzugefügt (üblicherweise als Variable Form1).  Jede '''Methode''' die Sie design to be used by the Formular oder seine Komponenten (d.h. Prozeduren oder Funktionen) wird im '''implementation''' Teil der Unit platziert.
: One very important use of this sub-menu is to activate a terminal window in which conventional Pascal console input/output is displayed.  If you are developing a console-mode Pascal program (ie one that doesn't use the Graphical User Interface with its forms, buttons and boxes) then you should check the box for "Use launching application". The first time you do this and try the Compile/Run sequence, you will probably get a rude message to say
 
"xterm: Can't execvp /usr/share/lazarus//tools/runwait.sh: Permission denied". 
 
: If this happens, you need to change the permissions on the appropriate file (for example using chmod +x ''filename'', or using the Windows utility for changing permissions); you might have to do this as root. After this, each time you launch you program, a console box will appear and all your text i/o (readln, writeln etc) will appear in it.
 
: After your program has finished execution, a message "Press enter" appears on the screenThus any output your program generated will remain on the screen until you have had a chance to read it;  after you press 'enter' the console window closes.
 
: See the separate tutorial on [[Console Mode Pascal]] programming.
 
* '''Reset debugger''': Restores the debugger to its original state, so that breakpoints and values of variables etc are forgotten.
 
  
* '''Build file''': Compile (build) just the file that is currently open in the Editor.
+
In der folgenden Liste der Komponenten werden Sie Links zu Dateien finden, die Beschreibungen der Units enthalten, in denen sie vorkommen. Wenn Sie etwas über die Eigenschaften einer bestimmten Komponente herausfinden wollen, lohnt es sich oft, auf die Vererbung dieser Komponente zu schauen und dann die Eigenschaften des Basistyps anschauen, von dem sie abgeleitet ist. Zum Beispiel, um TMaskEdit zu verstehen ist es auch hilfreich, TCustomMaskEdit zu untersuchen.
* '''Run file''': Compile, link and execute just the currently open file.
 
* '''Configure Build + Run File''': Opens a multi-page tabbed window with options to allow for build of just this file when '''Build Project''' is selected, allows selection of the working directory, the use of various Macros, etc.  Then Builds and Runs the file.
 
:These last three options enable you to open (and maintain) a test project. Use File -> Open to open an .lpr file, pressing cancel on the next dialog to open this file as "normal source" file.
 
 
 
<div style="clear:both;"></div>
 
 
 
====Das Komponenten Untermenü====
 
* '''Open Package''': Displays a [http://lazarus-ccr.sourceforge.net/kbdata/OpenPackageSnapshot.png list of installed packages], with an invitation to [http://lazarus-ccr.sourceforge.net/kbdata/PackageContentsSnapshot.png open one or more of them], or to select various general or compiler options.
 
* '''Open Package File''': Open one of the files in the selected package.
 
* '''Open Recent Package''': Open a package that was opened recently.
 
* '''Add Active Unit to Package''': Place the unit file (currently in the editor) into a package.
 
* '''Package Graph''': Displays a [http://lazarus-ccr.sourceforge.net/kbdata/PackageGraphSnapshot.png graph] showing the relationships of the packages currently being used (if you aren't using any other packages, the Lazarus package and the FCL and LCL will be displayed).
 
* '''Configure custom components''': If you have created some components, allows you to configure them.
 
 
 
====Das Werkzeuge Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/ToolsMenuSnapshot.png </div>
 
* '''Configure custom tools''': Allows the user to add various external tools (usually macros) to the toolkit
 
* '''Quick syntax check''': Perform a quick check of the syntax in your source file without actually compiling anything.  Essential step in developing long or complicated programs, where you don't want to waste time compiling if the code is wrong.
 
* '''Guess unclosed block''': useful utility if you have a complex nested block structure and you have left out an 'end' somewhere
 
* '''guess misplaced IFDEF/ENDIF''': useful if there is a complex or nested macro structure and you think you have left out an ENDIF directive
 
* '''Make resource string''': Makes the selected string a resource string by placing it in the resourcestrings section. An advantage of resource strongs is you can change them without the need to recompile your project!
 
* '''Diff''': Allows comparison between two files (or, usually, two versions of the same file) to find differences.  Options to ignore white space at beginning or end of lines or differences in line termination:  CR+LF versus LF).  Useful for checking if there have been changes since last CVS update etc.
 
* '''Check LFM file in editor''': Allows inspection of the LFM file which contains the settings that describe the current form
 
* '''Convert Delphi unit to Lazarus unit''': Helps in porting Delphi applications to Lazarus;  makes the necessary changes to the source file.  See [[Lazarus For Delphi Users]] and [[Code Conversion Guide]].
 
* '''Convert DFM file to LFM''': For porting from Delphi to Lazarus:  converts the Form Description files from Delphi to Lazarus.  See [[Lazarus For Delphi Users]] and [[Code Conversion Guide]].
 
* '''Build Lazarus''': Launches a re-build of Lazarus from the most recently downloaded or updated CVS files.  Hit the button and sit back to watch it happen! (track the process on your '''Messages''' window).
 
* '''Configure "Build Lazarus"''': Allows the user to determine which parts of Lazarus should be re-built, and how.  For example, you could select to have just the LCL re-built, or to have everything except the examples built;  you can select which LCL interface to use (ie which set of widgets), and you can select the target operating system and specify a different target directory.
 
<div style="clear:both;"></div>
 
 
 
====Das Einstellungen Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/EnvironmentMenuSnapshot.png </div>
 
* '''Environment options''': Displays a multi-page window with tabs for
 
** '''Files''' - allowing the user to specify path to default directory, compiler, source directory and temporary directory for compilation;
 
** '''Desktop''' - options for Language, Auto save behaviour, saving desktop properties, hints for component palette and speed buttons;
 
** '''Windows''', to allow specification of size and behaviour of the various windows;
 
** '''Form Editor''' - choose colours for editing forms;
 
** '''Object Inspector''' - choose colour and height of items;
 
** '''Backup''' - specify how to backup files when editing;
 
** '''Naming''' - specify what extension to use in naming pascal files ('.pp' or '.pas'), whether to save files with names in lowercase, whether to perform auto-delete or auto-rename.
 
* '''Editor options''': Multi-page window, with tabs for
 
** '''General''' - determines behaviour like auto-indent, bracket highlighting, drag-drop editing, scrolling, syntax highlighting, showing hints, size of block indent and tabs, limit of Undo;
 
** '''Display''' - options for showing line numbers, presence of gutters, size and type of font for editor, and contains a preview panel showing the colours of the various syntax features such as comments, directives, punctuation, errors and breakpoints; 
 
** '''Key Mappings''' - options to select Lazarus or Turbo Pascal scheme;
 
** '''Color''' - allows choice of colour scheme for text features, for a number of language types such as Object Pascal, C++, Perl, HTML, XML and shell scripts. It shows preview panel again (for whichever language is selected);
 
** '''Code Tools''' - allows selection of features like Identifier Completion, tooltips, specification of template file names, specific templates for code completion.
 
* '''Debugger Options''': Multi-page window with tabs for
 
** '''General''' - choose debugger: none, GNU debugger (gdb) or gdb through SSH, specify search paths for debuggers,and specific options for chosen debugger;
 
** '''Event log''' - specify whether to clear log on run, and which messages to display;
 
** '''Language Exceptions''' - select which exceptions can be ignored;
 
** '''OS Exceptions''' - allows user to add certain signals which apply to current operating system (not implemented).
 
* '''Code Tool Options''': Multi-page window, tabs for 
 
** '''General''' - Allows entry of additional source search paths, specify Jumping Method;
 
** '''Code Creation''' - determines whether created code is added before or after certain features;
 
** '''Words''' - determines whether Pascal keywords are to be entered in upper or lower case, or as Capitalised Words;
 
** '''Line Splitting''' - establish rules about where lines are allowed to be split (before or after punctuation, after keywords etc);
 
** '''Space''' - decide whether a space is to be added automatically before or after certain syntactic features such as keywords or punctuation marks.
 
* '''Code Tools Defines Editor''': I NEED SOME HELP IN DESCRIBING THIS, AS I HAVEN'T A CLUE WHAT THIS ITEM IS FOR!  [[User:Kirkpatc]]
 
 
 
 
 
* '''Re-scan FPC Source directory''' Looks through the directory again. Lazarus uses the fpc sources to generate correct event handlers and while looking for declarations. If somebody changes the directory in the environment options, then this directory is rescanned, to make sure lazarus uses the version stored in that location. But if this directory has changed without lazarus noticing, then you may get some errors when designing forms or doing "Find declaration". If you get such an error, you can do two things:
 
*# Check the fpc source directory setting in the environment option.
 
*# Re-scan FPC source directory.
 
 
 
====Das Fenster Untermenü====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/WindowsMenuSnapshot.png </div>
 
Contains a list of the currently opened files and the available windows such as '''Source Editor''', '''Object Inspector''' and '''Project Inspector'''.  Clicking on the name of one of the windows brings it to the foreground and gives it focus.
 
<div style="clear:both;"></div>
 
 
 
====Das Hilfe Untermenü====
 
 
 
At present this has three selections:
 
* '''Online Help''' which at present opens a browser window that contains a picture of the running cheetah and a few links to the Lazarus, FreePascal  and WiKi websites
 
* '''Configure Help''' which opens a pop-up menu with options to select viewers and databases from which to read Help information.  This option allows the user to specify either the on-line documents section of the Lazarus-CCR website, some other website containing the documents, or a local store for the documentation (this would eventually become the default, when the Help system is fully developed).
 
At present by default, if you place your Editor cursor over any keyword from the FreePascal Components Library FCL or the RunTime Library RTL (but not the Lazarus Components Library LCL) and then press <<F1>> you will be taken to the appropriate definition on the website.  THIS SECTION STILL REPRESENTS WORK IN PROGRESS
 
 
 
* '''About Lazarus''' Displays a pop-up box with some information about Lazarus.
 
 
 
Eventually there will be a full on-line Help service, with information about Pascal syntax, the use of the IDE, how to use, modify or create Components, and hints on how to perform certain tasks.  This part of the Documentation section (the thing you are currently reading) represents the beginning of the process. '''We need contributions from anyone who feels able to provide them: the WiKi is very easy to edit.'''
 
 
 
===The Button bar===
 
A small toolbar area on the left of the main editor window, just below the Main Menu and to the left of the Component Palette, contains a set of buttons which replicate frequently-used Main Menu selections:
 
: '''New unit''',  '''Open''' (with a down-arrow to display a drop-down list of recently used files), '''Save''', '''Save all''', '''New Form''', '''Toggle Form/Unit''' (ie show either form or source code of Unit), '''View Units''', '''View Forms''', '''Run''' (ie compile and Run), '''Pause''', '''Step Into''', '''Step over''' (the last two are Debugger functions).
 
 
 
==Die Komponentenpalette==
 
A Tabbed toolbar which displays a large number of icons representing commonly used components for building Forms.
 
 
 
Each tab causes the display of a different set of icons, representing a functional group of components.  The left-most icon in each tabbed group is an obliquely leftward-facing arrow, called the Selection Tool.
 
 
 
If you allow the mouse cursor to hover over any of the icons on the Component Palette, without clicking on the icon, the title of that component will pop-up. Note that each title begins with a 'T' - this signifies 'Type' or more accurately 'Class' of the component.  When you select a component for inclusion in a form, the Class is added to the '''type''' section of the '''interface''' part of the Unit (usually as part of the overall TForm1), and an '''instance''' of that class is added to the '''var''' section (usually as the variable Form1).  Any '''Methods''' that you design to be used by the Form or its Components (ie Procedures or Functions) will be placed in the '''implementation''' part of the Unit
 
 
 
In the following list of the Components, you will find links to files that contain descriptions of the Units in which they are found. If you want to find out about the properties of a particular component, it is often worth looking at the Inheritance of that component and then inspecting the properties of the base type from which it is derived.  For example, to understand TMaskEdit it is also useful to examine TCustomMaskEdit.
 
 
   
 
   
'''TABS''' (the names are largely self-explanatory):
+
'''TABS''' (Die Namen sind größtenteils selbstbeschreibend.):
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=StdCtrls Standard]'''
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=StdCtrls Standard]'''
<center> [http://wiki.lazarus.freepascal.org/index.php/Image:Laz_de_comp_stand.jpg Abbildung] </center>
+
<center> [[Image:Laz de comp stand.jpg]] </center>
:''Frequently used components:'' [http://lazarus-ccr.sourceforge.net/index.php?wiki=MenuUnit TMainMenu], [http://lazarus-ccr.sourceforge.net/index.php?wiki=MenuUnit TPopupMenu], [http://lazarus-ccr.sourceforge.net/index.php?wiki=ButtonsTxt TButton], TLabel, TEdit, TMemo, TToggleBox, TCheckBox, TRadioButton, TListBox, TComboBox, TScrollBar, TGroupBox, TStaticText, [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TRadioGroup], TCheckGroup, [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TPanel], TActionList
+
:''Oft benutzte Komponenten:'' [[TMainMenu/de|TMainMenu]], [[TPopupMenu/de|TPopupMenu]], [[TButton/de|TButton]], [[TLabel/de|TLabel]], [[TEdit/de|TEdit]], TMemo, TToggleBox, TCheckBox, TRadioButton, TListBox, TComboBox, TScrollBar, TGroupBox, [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TRadioGroup], TCheckGroup, [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TPanel], TActionList
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls Additional]'''
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls Additional]'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/7/7d/Component_Palette_Additional.png</center>
+
<center> [[Image:Laz de comp addit.jpg]] </center>
:''More, often-used components:'' [http://lazarus-ccr.sourceforge.net/index.php?wiki=ButtonsTxt TBitBtn], [http://lazarus-ccr.sourceforge.net/index.php?wiki=ButtonsTxt TSpeedButton], [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TImage], TShape, TBevel, TPaintBox, TNotebook, TLabeledEdit, TSplitter, [http://lazarus-ccr.sourceforge.net/index.php?wiki=MaskEdit TMaskEdit], TCheckListBox, [http://lazarus-ccr.sourceforge.net/index.php?wiki=FormsTxt TScrollBox], [http://lazarus-ccr.sourceforge.net/index.php?wiki=FormsTxt TApplicationProperties], TStringGrid, TDrawGrid, TPairSplitter
+
:''weitere, oft benutzte Komponenten:'' [http://lazarus-ccr.sourceforge.net/index.php?wiki=ButtonsTxt TBitBtn], [http://lazarus-ccr.sourceforge.net/index.php?wiki=ButtonsTxt TSpeedButton], TStaticText, [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TImage], TShape, TBevel, TPaintBox, TNotebook, TLabeledEdit, TSplitter, TTrayIcon, [http://lazarus-ccr.sourceforge.net/index.php?wiki=MaskEdit TMaskEdit], TCheckListBox, [http://lazarus-ccr.sourceforge.net/index.php?wiki=FormsTxt TScrollBox], [http://lazarus-ccr.sourceforge.net/index.php?wiki=FormsTxt TApplicationProperties], TStringGrid, TDrawGrid, TPairSplitter, TColorBox, TColorListBox, TChart
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ComCtrls Common Controls]'''
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ComCtrls Common Controls]'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/4/4a/Component_Palette_Common_Controls.png</center>
+
<center> [[Image:Laz de comp common.jpg]] </center>
: TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TImageList
+
: TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TTabControl, TImageList
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt Dialogs]'''
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt Dialogs]'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/7/72/Component_Palette_Dialogs.png</center>
+
<center> [[Image:Laz de comp dialog.jpg]] </center>
: TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog
+
: TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog (wenn Printer4Lazarus installiert ist auch TPrinterSetupDialog, TPrintDialog und TPageSetupDialog)
  
Several useful '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogExamples Dialog]''' procedures or functions don't appear on the Palette, but are easily used as direct calls from your source program.
+
Verschiedene hilfreiche '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogExamples Dialog]''' Prozeduren oder Funktionen erscheinen nicht auf der Palette, sind aber einfach zu nutzen als direkte Aufrufe von ihrem Quellprogramm.
  
For several good examples of the use of Components see the $LazarusPath/lazarus/examples subdirectory of your source installation. Many of the programs show how to use dialogs and other components directly without using the IDE and component palette or having a separate form definition file:  all the components are fully and explicitly defined in the main Pascal program. Other example programs make full use of the IDE.
+
Für verschiedene gute Beispiele der Benutzung der Komponenten schauen Sie im $LazarusPath/lazarus/examples Unterverzeichnis ihrer Quellen Installation nach. Viele der Programme zeigen, wie man Dialoge und andere Komponenten direkt verwendet, ohne Benutzung der IDE und der Komponentenpalette oder die eine separate Formulardefinitionsdatei haben. Alle Komponenten sind vollständig und ausdrücklich definiert im Haupt-Pascalprogramm. Andere Beispielprogramme machen völlig Gebrauch von der IDE.
  
Some examples don't work straight away: you may need to play about with paths and permissions of files or directories. If you want to compile any of the examples, make sure that you have read/write/execute permissions for the files and directories, or copy the files to a directory where you do have the appropriate permissions.
+
Einige Beispiele arbeiten nicht sofort: Sie müssen möglicherweise mit den Pfaden und Zugriffsrechten von Dateien oder Verzeichnissen spielen. Wenn Sie einige der Beispiele kompilieren wollen stellen Sie sicher, dass Sie Lese-/Schreibrechte für die Dateien und Verzeichnisse haben, oder Sie kopieren die Dateien in ein Verzeichnis, für das Sie die entsprechenden Rechte haben.
  
Try running the 'testall' program to see a menu of the available components together with small example test forms for most of themthen inspect the code to find out how they work!
+
Versuchen Sie das 'testall' Programm zu starten, um ein Menü der verfügbaren Komponenten zusammen mit kleinen Beispiel Testformularen für die meisten von ihnen zu sehendann kontrollieren Sie den Code um herauszufinden, wie sie funktionieren!
 
* '''Misc'''
 
* '''Misc'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/8/8e/Component_Palette_Misc.png</center>
+
<center> [[Image:Laz de comp misc.jpg]] </center>
: [http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt TColorButton], TSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox  
+
: [http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt TColorButton], TSpinEdit, TFloatSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox, TXMLPropStorage, TIniPropStorage, TbarChart, TButtonPanel, TIDEDialogLayoutStorage 
 
* '''Data Controls'''
 
* '''Data Controls'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/6/62/Component_Palette_DataControls.png</center>
+
<center> [[Image:Laz de comp data con.jpg]] </center>
: ''Data-aware components, which largely replicate the Standard and Additional groups but are applicable to Databases:'' TDBNavigation, TDBText, TDBEdit, TDBMemo, TDBImage, TDBListBox,TDBComboBox, TDBCheckBox, TDBRadioGroup, TDBCalendar, TDBGroupBox, TdbGrid
+
: ''Datensensitive Komponenten, welche weitgehend die Standard und Additional Gruppen wiederholen aber einsetzbar sind für Datenbanken:'' TDBNavigation, TDBText, TDBEdit, TDBMemo, TDBImage, TDBListBox,TDBComboBox, TDBCheckBox, TDBRadioGroup, TDBCalendar, TDBGroupBox, TDBGrid
 
* '''Data Access'''
 
* '''Data Access'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/c/cc/Component_Palette_DataAccess.png</center>
+
<center> [[Image:Laz de comp data acc.jpg]] </center>
: TDatasource
+
: TDatasource, TSdfDataSet (Package SDFLaz), TFixedFormatDataSet (Package SDFLaz), TMemDataset (Package MemDSLaz), TDbf (Package DBFLaz)
 
* '''System'''
 
* '''System'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/f/fe/Component_Palette_System.png</center>
+
<center> [[Image:Laz de comp syste.jpg]] </center>
: [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TTimer], TIdleTimer, TProcess
+
: [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TTimer], TIdleTimer, TLazComponentQueue, THTMLHelpDatabase, THTMLBrowserHelpViewer, TProcess, TSimpleIPCClient, TSimpleIPCServer, TXMLConfig
 
* '''SynEdit'''
 
* '''SynEdit'''
<center>http://lazarus-ccr.sourceforge.net/kb/images/2/22/Component_Palette_SynEdit.png</center>
+
<center> [[Image:Laz de comp syned.jpg]] </center>
: ''A group of components to help interfacing with other languages and software tools. SynEdit is an advanced multi-line edit control, for Borland Delphi, Kylix  and C++Builder. It supports Syntax Highlighting and code completion, and includes exporters for html, tex and rtf. It is a full-VCL/CLX control, meaning it is not a wrapper for Microsoft Windows controls, and no run-time library is required; this make SynEdit a crossplatform component. Compatibility with FreePascal is also planned, and SynEdit is the edit component in Lazarus IDE.'' see [http://synedit.sourceforge.net synedit at sourceforge]. TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynMultiSyn
+
: ''Eine Gruppe von Komponenten to help interfacing with other languages and software tools. SynEdit is an advanced multi-line edit control, for Borland Delphi, Kylix  and C++Builder. It supports Syntax Highlighting and code completion, and includes exporters for html, tex and rtf. It is a full-VCL/CLX control, meaning it is not a wrapper for Microsoft Windows controls, and no run-time library is required; this make SynEdit a crossplatform component. Compatibility with FreePascal is also planned, and SynEdit is the edit component in Lazarus IDE.'' see [http://synedit.sourceforge.net synedit at sourceforge]. TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynMultiSyn
 +
 
 +
Um die Komponentenpalette zu nutzen, muss ein Formular im Editor geöffnet sein (falls nicht wählen Sie Datei -> Neues Formular). Klicken Sie auf das Icon im geeigneten Tab der Palette für die Komponente, die Sie verwenden wollen, dann klicken Sie auf das Formular, in der Nähe wo die Komponente erscheinen soll. Wenn die gewünschte Komponente erscheint, dann können Sie sie durch klicken mit der Maus auswählen, an die exakte Stelle auf dem Formular verschieben und ihre Größe anpassen.  Adjustments can be made to the appearance either by altering the picture itself on the Form using the mouse, oder durch Änderung der relevanten Eigenschaft im Objekteditor für diese Komponente.
  
To use the Palette, there must be an open form on view in the editor (if there isn't one, select File -> New Form). Click on the icon in the appropriate tab of the Palette for the component you want to use, then click on the Form, near where you want the component to appear.  When the desired component appears, you can select it by clicking with the mouse, then move it to the exact place on the Form where you want it and adjust its size. Adjustments can be made to the appearance either by altering the picture itself on the Form using the mouse, or by changing the relevant Property in the Object Editor for that component.
+
Wenn Sie zusätzliche Komponenten installieren, entweder jene, die Sie selbst geschrieben haben, oder einige, die als Package von einer anderen Quelle kommen, dann werden extra tabs mit den relevanten Icons in ihrer Komponentenpalette erscheinen. Diese neuene Komponenten können ausgewählt und in ihrem Formularen verwendet werden auf die selbe Weise, wie die mit Lazarus gelieferten Komponenten.
  
If you install additional components, either those you have written yourself, or some coming as a package from some other source, then extra tabs with the relevant icons will appear in your Component Palette. These new components can be selected and used on your forms in the same way as those supplied by default.
+
== Der Debugger ==
 +
: ''Ist noch zu schreiben''.
  
==Der Debugger==
+
siehe auch [[:Category:IDE Window - Debug/de|IDE Fenster - Debuggen]]
: ''Still to be written''.
 
  
==Die Lazarus Dateien==
+
== Die Lazarus-Dateien ==
 
     (Dank an Kevin Whitefoot.)
 
     (Dank an Kevin Whitefoot.)
 
     (Hinzufügungen von Giuseppe Ridinò, [[User:Kirkpatc]] und Tom Lisjac)
 
     (Hinzufügungen von Giuseppe Ridinò, [[User:Kirkpatc]] und Tom Lisjac)
Wenn sie speichern werden sie eigentlich nur zwei Dateien speichern:  
+
Wenn Sie speichern, wählen Sie eigentlich nur zwei Dateien aus:  
  
 
   xxx.pas und yyy.lpr  
 
   xxx.pas und yyy.lpr  
(You save more than that but those are the ones you get to name). The project file (lpr) and the unit file (pas) must not have the same name because Lazarus will helpfully rename the unit (inside the source code) to the same as the unit file name and the program to the name of the project file (it needs to do this or the compiler will probably not be able to find the unit later when referred to in the project file). Of course to be consistent it changes all the occurrences of unit1 to xxx.
+
(Sie speichern mehr als das, aber die beiden sind diejenigen, die Sie benennen müssen). Die Projektdatei (lpr) und die Unitdatei (pas) müssen nicht denselben Namen haben, weil Lazarus freundlicherweise der Unit (im Quellcode) den selben Namen gibt wie den Dateinamen, unter dem Sie speichern. Genauso bekommt ein Programm den Namen der Projektdatei (Das muss so sein, weil ansonsten der Compiler möglicherweise die Unit später nicht finden könnte, wenn sie in der Projektdatei verwendet wird). Natürlich werden aus Konsistenzgründen ''alle'' Verweise auf unit1 auf xxx geändert.
  
So if you are saving a project called '''again''', trying to save again.pas and again.lpr fails because unit names and program names are in the same name space resulting in a duplicate name error.
+
Wenn Sie also versuchen, ein Projekt mit Namen ''again'' zu speichern - dabei wird versucht, again.pas und again.lpr anzulegen - wird das schiefgehen, weil Unit-Namen und Programmnamen denselben Namensraum verwenden. Die doppelten Namen werden abgelehnt.  
  
So here is what I ended up with:
+
So, das kommt dabei heraus:
  
e:/lazarus/kj/lazhello:
+
e:/lazarus/kj/lazhello:
 
  total 4740  free 76500
 
  total 4740  free 76500
 
  -rwxrwxrwx  1 kjwh    root  4618697 Mar 24 11:19 again.exe
 
  -rwxrwxrwx  1 kjwh    root  4618697 Mar 24 11:19 again.exe
Line 367: Line 180:
 
  -rwxrwxrwx  1 kjwh    root      335 Mar 24 11:07 ppas.bat
 
  -rwxrwxrwx  1 kjwh    root      335 Mar 24 11:07 ppas.bat
  
Note that there are many more files than the two that I thought I was saving.
+
Haben Sie gemerkt, dass viel mehr Dateien entstanden sind, als die beiden, die wir eigentlich speichern wollten?
  
Here is a brief note about each file:
+
Hier ist eine kurze Bemerkung über jede Datei:
  
 
'''again.exe:'''
 
'''again.exe:'''
The main program binary executable. Win32 adds an "exe" extension. Linux has none. This file will be huge on Linux due to the inclusion of debugging symbols. Run the "strip" utility to remove them and substantially shrink the executable size.
+
Das ausführbare Hauptprogramm. Unter Windows wird eine "exe"-Erweiterung hinzugefügt. Unter Linux gibt es keine Dateierweiterung. Im Normalfall ist diese Datei riesig, da viele Debugging-Symbole in der Programmdatei enthalten sind. Starten sie das "strip" Dienstprogramm, um sie zu entfernen und die Größe des ausführbaren Programms wesentlich zu schrumpfen.
  
 
'''again.lpi:'''
 
'''again.lpi:'''
This is the main file of a Lazarus project (Lazarus Project Information); the equivalent Delphi main file of an application will be the .dpr file. It is stored in an XML format.
+
Dies ist die Haupdatei eines Lazarus Projekts (Lazarus Project Information); die equivalente Delphi Hauptdatei einer Anwendung ist die .dpr Datei. Sie wird in einem XML Format gespeichert.
  
 
'''again.lpr:'''
 
'''again.lpr:'''
The main program source file. Despite its lazarus specific extension it is in fact a perfectly normal Pascal source file. It has a uses clause that lets the compiler find all the units it needs. Note that the program statement does not have to name the program the same as the file name.
+
Die Hauptprogramm Quelldatei. Trotz seiner Lazarus-spezifischen Erweiterung ist es eigentlich eine völlig normale Pascal Quelldatei. Sie hat eine ''uses'' Anweisung, die dem Compiler angibt, welche Units er braucht. Beachten Sie, dass das ''Program'' Statement das Programm nicht notwendigerweise gleich nennen muss wie den Dateinamen.
  
 
'''againu.lfm:'''
 
'''againu.lfm:'''
This is where Lazarus stores the layout of the form unit. Lazarus uses this to generate a resource file that is included in the initialisation section of the againu.pas unit. Delphi dfm files can be converted to lfm format in the Lazarus IDE using the Tools->Convert DFM file to LFM utility.
+
Hier speichert Lazarus das Layout der Formularunit. Lazarus braucht das, um eine Resourcen-Datei zu erzeugen, die im Initialisierungsteil der againu.pas Unit verwendet wird. Es ist möglich, Delphi .dfm -Dateien in der IDE in das .lfm-Format zu wandeln. Verwenden Sie dazu ''Werkzeuge''->''DFM in LFM-Datei konvertieren''.
  
 
'''again.lrs:'''
 
'''again.lrs:'''
Dies ist die erzeugte Ressourcen Datei. Beachten sie, daß dies keine Windows Ressourcen Datei ist.
+
Dies ist die erzeugte Ressourcen Datei. Beachten sie, dass dies keine Windows Ressourcen Datei ist.
  
 
'''againu.pas:'''
 
'''againu.pas:'''
Line 393: Line 206:
  
 
'''ppas.bat:'''
 
'''ppas.bat:'''
This is a simple script that links the program to produce the executable. If compilation is successfull, it is deleted by the compiler.
+
Dies ist ein einfaches Script zum Linken des Programms in eine ausführbare Datei. Wenn die Kompilierung erfolgreich war, wird es vom Compiler gelöscht.
  
==Mitwirkende und Änderungen==
+
== Mitwirkende und Änderungen ==
This page has been imported from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial version].
+
Diese Seite wurde importiert von der epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial Version].
 
* Created initial page and template. T. Lisjac - 11/04/2003 [[User:Tom | VlxAdmin]]
 
* Created initial page and template. T. Lisjac - 11/04/2003 [[User:Tom | VlxAdmin]]
 
* Inserted a note containing instructions for writing your first Lazarus Program. Suggest an administrator places it in the appropriate place on the Tutorial menu. 3/09/2004 [[User:Kirkpatc]]
 
* Inserted a note containing instructions for writing your first Lazarus Program. Suggest an administrator places it in the appropriate place on the Tutorial menu. 3/09/2004 [[User:Kirkpatc]]
Line 407: Line 220:
 
* More material added to Editor section of tutorial. 26 Mar 2004 [[User:Kirkpatc]]
 
* More material added to Editor section of tutorial. 26 Mar 2004 [[User:Kirkpatc]]
 
* More material added describing the Main Menu. Renamed 'Hello World' to 'Getting Started' and moved it to nearer the top. 31 March 2004 [[User:Kirkpatc]]
 
* More material added describing the Main Menu. Renamed 'Hello World' to 'Getting Started' and moved it to nearer the top. 31 March 2004 [[User:Kirkpatc]]
* Inserted section on Run sub-menu. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 [[User:Kirkpatc]]
+
* Abschnitt einegfügt zum Start Untermenü. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 [[User:Kirkpatc]]
 
* Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 [[User:Kirkpatc]]
 
* Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 [[User:Kirkpatc]]
* Deleted the section on MySQL from here: it has been copied to Lazarus Database section of tutorial. 14 Apr 2004 [[User:Kirkpatc]]
+
* Abschnitt über MySQL von hier gelöscht: er wurde in den Lazarus Datenbanken Abschnitt des Tutorials kopiert. 14 Apr 2004 [[User:Kirkpatc]]
 
* Added some more to the description of the Editor Main Menu. 18 Apr 2004 [[User:Kirkpatc]]
 
* Added some more to the description of the Editor Main Menu. 18 Apr 2004 [[User:Kirkpatc]]
* Added section on Environment sub-menu. 19 Apr 2004 [[User:Kirkpatc]]
+
* Abschnitt zum Einstellungen Untermenü hinzugefügt. 19 Apr 2004 [[User:Kirkpatc]]
* Added section on Components sub-menu. 4 May 2004 [[User:Kirkpatc]]
+
* Abschnitt zum Komponenten Untermenü hinzugefügt. 4 May 2004 [[User:Kirkpatc]]
* Adding Tools sub-menu description (incomplete). 7 May 2004 [[User:Kirkpatc]]
+
* Werkzeuge Untermenü Beschreibung hinzugefügt (unvollständig). 7 May 2004 [[User:Kirkpatc]]
* Added some screenshots to Menu descriptions. 9 May 2004 [[User:Kirkpatc]]
+
* Einige Screenshots hinzugefügt zu den Menü Beschreibungen. 9 May 2004 [[User:Kirkpatc]]
 
* Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 [[User:Kirkpatc]]
 
* Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 [[User:Kirkpatc]]
* More additions to Tools sub-menu. 19 May 2004 [[User:Kirkpatc]]
+
* Mehr Hinzufügungen zum Werkzeuge Untermenü. 19 May 2004 [[User:Kirkpatc]]
 
* Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 [[User:Kirkpatc]]
 
* Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 [[User:Kirkpatc]]
 
* Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 [[User:Kirkpatc]]
 
* Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 [[User:Kirkpatc]]
Line 422: Line 235:
 
* Expanding on the Components Palette. 5 June 2004 [[User:Kirkpatc]]
 
* Expanding on the Components Palette. 5 June 2004 [[User:Kirkpatc]]
 
* Added a lot to the DialogExamples page. 10 June 2004 [[User:Kirkpatc]]
 
* Added a lot to the DialogExamples page. 10 June 2004 [[User:Kirkpatc]]
* Considerable revision of the StdCtrls page, hopefully making it clearer and encouraging people to contribute - particularly in the 'Description' sections. 14 June 2004 [[User:Kirkpatc]]
+
* Beachtliche Revision der StdCtrls Seite, hopefully making it clearer and encouraging people to contribute - particularly in the 'Description' sections. 14 June 2004 [[User:Kirkpatc]]
 
* Added pages for Menus and Dialogs units (linked to Component Palette description) - please feel free to add to these pages. 14 June 2004 [[User:Kirkpatc]]
 
* Added pages for Menus and Dialogs units (linked to Component Palette description) - please feel free to add to these pages. 14 June 2004 [[User:Kirkpatc]]
* Added page for Common Controls (linked to Component Palette). 16 June 2004 [[User:Kirkpatc]]
+
* Seite für Common Controls hinzugefügt (linked to Component Palette). 16 June 2004 [[User:Kirkpatc]]
* Added MaskEdit page (linked to Component Palette). 17 June 2004 [[User:Kirkpatc]]
+
* MaskEdit Seite hinzugefügt (linked to Component Palette). 17 June 2004 [[User:Kirkpatc]]
* Added Buttons, ExtCtrls pages (linked to Component Palette). 17 June 2004 [[User:Kirkpatc]]
+
* Buttons und ExtCtrls Seiten hinzugefügt (linked to Component Palette). 17 June 2004 [[User:Kirkpatc]]
 
* Edited MainMenu component description page. 23 June 2004 [[User:Kirkpatc]]
 
* Edited MainMenu component description page. 23 June 2004 [[User:Kirkpatc]]
 
* Some additions to Common Controls. 28 June 2004 [[User:Kirkpatc]]
 
* Some additions to Common Controls. 28 June 2004 [[User:Kirkpatc]]
 
* A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 [[User:Kirkpatc]]
 
* A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 [[User:Kirkpatc]]
* Minor changes to ComCtrls, ExtCtrls, Environment Menu. 10 July [[User:Kirkpatc]]
+
* Kleinere Änderungen an ComCtrls, ExtCtrls, Environment Menu. 10 July [[User:Kirkpatc]]
 
* Added FormsTxt, component description page for Component Palette. 20 July 2004 [[User:Kirkpatc]]
 
* Added FormsTxt, component description page for Component Palette. 20 July 2004 [[User:Kirkpatc]]
* Some corrections to ConsoleModePascal. 21 July 2004 [[User:Kirkpatc]]
+
* Einige Korrekturen an ConsoleModePascal. 21 July 2004 [[User:Kirkpatc]]
* Some small changes to ComponentPalette. 22 July 2004 [[User:Kirkpatc]]
+
* Einige kleine Änderungen an ComponentPalette. 22 July 2004 [[User:Kirkpatc]]

Latest revision as of 02:12, 8 December 2021

Deutsch (de) English (en) español (es) suomi (fi) français (fr) magyar (hu) italiano (it) 日本語 (ja) македонски (mk) Nederlands (nl) português (pt) русский (ru) slovenčina (sk) shqip (sq) 中文(中国大陆)‎ (zh_CN) 中文(台灣)‎ (zh_TW)
Zurück zu den Zusätzlichen Informationen.

Dies ist der Anfang eines Lazarus Tutorials. Bitte fühlen Sie sich frei, Ihre Erfahrungen hinzuzufügen.

Überblick

Lazarus ist ein freies und Open-Source Entwicklungswerkzeug für den FreePascal Compiler, der ebenfalls frei und als Open Source verfügbar ist. Die Lazarus IDE (Integrated Development Environment - Screenshots) ist eine stabile und feature-reiche Entwicklungsumgebung für die Programmierung eigenständiger interaktiver (grafischer) und einfacher batchorientierter Konsolenanwendungen. Lazarus läuft gegenwärtig auf Linux, FreeBSD und Win32 und bietet einen anpassbaren Quelltext-Editor, interaktive Gestaltung von Bildschirmoberflächen, einen Package Manager, Debugger und die komplette GUI-Integration mit dem FreePascal Compiler (FPC).

Los gehts

(Dank an User:Kirkpatc)

Besorgen Sie sich, installieren Sie (siehe Installieren von Lazarus) und starten Sie Lazarus. Dadurch steht Ihnen auch der Free Pascal Compiler zur Verfügung.

Anmerkung: Zumindest unter Linux Ubuntu, ist der Befehl zum Starten von Lazarus aus einer Konsole "startlazarus". Ansonsten, wenn Sie es von einem Debian-Package installiert haben, sollten Sie einen Menüeintrag "Lazarus" unter Anwendungen / Programmentwicklung haben. (Problem: In Debian und Ubuntu wurden das Programm und das Package umbenannt zu "lazarus-ide", weil das "tct"-Package bereits ein Hilfsprogramm namens "lazarus" enthielt.)

Ihr erstes Lazarus Programm!

Wählen Sie aus dem Hauptmenü den Menüpunkt "Projekt --> Neues Projekt --> Anwendung". Eine neu GUI-Anwendung wird erstellt, siehe auch Form Tutorial. Mehrere Fenster erscheinen auf dem Desktop: das Hauptmenü am oberen Rand, der Objektinspektor links, der Lazarus Quelltexteditor nimmt den größten Teil des Desktops ein, und ein vorgefertigtes Fenster(Formular) namens "Form1" liegt auf dem Quelltexteditor. Auf dem Menü 'Fenster', unterhalb der Haupt-Menüzeile, ist eine Reihe von Tabs angezeigt. Falls der Tab 'Standard' nicht schon ausgewählt ist, dann wählen Sie ihn mit einem Mausklick aus. Jetzt suchen Sie das TButton-Symbol (rechteckiges Symbol mit 'OK') und aktivieren es durch einen Mausklick. Dann klicken Sie in das 'Form1' Fenster, irgendwo links der Mitte, und eine Schaltfläche namens 'Button1' wird dort eingesetzt. Klicken Sie erneut auf das Button-Symbol und dann in 'Form1' irgendwo rechts der Mitte: eine zweite Schaltfläche namens 'Button2' wird eingesetzt.

Wählen Sie jetzt 'Button1' aus. Der 'Objektinspektor' (links) zeigt die Eigenschaften des Objekts 'Button1' an. Ziemlich weit oben in der Liste steht die Eigenschaft 'Caption' mit dem angezeigten Wert 'Button1'. Klicken Sie in das Feld und ändern Sie 'Button1' zu 'Press'. Wenn Sie die ENTER-Taste drücken oder in ein anderes Feld klicken, ändert sich die Beschriftung des ersten Buttons auf 'Press'. Nun klicken Sie auf den Tab 'Ereignisse' im Objektinspektor, um verfügbare Ereignisse zu sehen, die mit dem Button verbunden werden können. Diese Ereignisse sind OnClick, OnEnter, OnExit, usw. Wählen Sie das Feld rechts von 'OnClick': eine kleinere Schaltfläche mit drei Punkten (... Ellipse) erscheint. Wenn Sie darauf klicken, springt die IDE automatisch in den Quelltext-Editor und der Cursor wird in folgendem Code platziert:

  procedure TForm1.Button1Click(Sender: TObject);
  begin
    {jetzt tippen Sie:}    Button1.caption := 'Press again';
    {der Editor hat die Procedure bereits komplettiert mit}
  end;

Drücken Sie F12, um das Fenster 'Form1' anstelle des Quelltext-Editors auszuwählen.

Jetzt bearbeiten Sie die Eigenschaften von 'Button2': klicken Sie in 'Form1' darauf, um seine Eigenschaften im Objektinspektor zu sehen. Ändern Sie das Attribut 'Caption' auf 'Exit' (an Stelle von 'Button2'.) Nun wählen Sie den Tab 'Ereignisse' und klicken in das Feld für 'OnClick'. Klicken Sie auf die '... Ellipse', und Sie werden in den Quelltext-Editor mitgenommen, in die Mitte einer anderen Prozedur:

  procedure TForm1.Button2Click(Sender: TObject);
  begin
    {jetzt tippen Sie:}   Close;
    {der Editor hat die Procedure bereits komplettiert mit} 
  end;

Sie sollten Ihre Arbeit jetzt (überhaupt: häufiger!!) speichern durch Auswahl von 'Projekt speichern unter...' mit 'ihr_gewählter_Datei_Name.pas'

Jetzt drücken Sie F12, um wieder das Fenster 'Form1' zu sehen. Sie sind jetzt bereit, die Kompilierung zu versuchen. Der einfachste Weg, dies zu tun, ist 'Start' aus dem Hauptmenü zu wählen, und dort wieder die 'Start' Option im Untermenü. Alternativ können Sie einfach F9 drücken. Dies wird zuerst kompilieren und dann, wenn alles gut geht, Ihr Programm linken und ausführen.

Verschiedene Textfenster werden erscheinen und einige Compiler-Meldungen werden geschrieben. Erscheint dann das Fenster 'Form1' ohne das Punktegitter, dann, "Hurra", sehen Sie das aktuelle Hauptfenster ihrer Anwendung. Es wartet darauf, dass die Buttons gedrückt werden.

Versuchen Sie auf den Button mit der Beschriftung 'Press' zu klicken. Sie werden bemerken, dass er sich zu 'Press again' ändert. Wenn Sie ihn erneut drücken, wird er immer noch 'Press again' sagen!!

Jetzt klicken Sie auf den Button mit 'Exit'. Das Fenster wird sich schließen und das Programm wird beendet. Das Entwurfs-Fenster 'Form1' mit dem Punktegitter wird wieder angezeigt, bereit, um weitere Bearbeitungsschritte zu akzeptieren.

Modifizieren Sie Ihr Programm

Öffnen Sie Ihr gespeichertes Projekt wieder. Im Fenster 'Form1' klicken Sie auf die 'Press' Schaltfläche (Button1), um sie auszuwählen. Springen Sie im Quelltext-Editor in die Procedure, die auf den Klick auf Button1 ('Press') reagiert: Wählen Sie dazu den Tab 'Ereignisse' im Objektinspektor aus, klicken in das Feld rechts von 'OnClick', klicken auf die '... Ellipse', und Sie sind an der entsprechenden Stelle im Quelltext-Editor angekommen.

Verändern Sie Ihren Code wie folgt, achten Sie dabei auf sauberes Setzen der ; und der begin ... end Strukturen (Sie können den Code auch hier markieren und per Copy-Paste in den Quelltext-Editor kopieren):

  procedure TForm1.Button1Click(Sender: TObject);
  // Machen Sie Gebrauch von der Tag Eigenschaft, setzen Sie sie entweder auf 0 oder 1
  begin
    if Button1.tag = 0 then begin
      Button1.caption := 'Press again';
      Button1.tag := 1
    end else begin
      Button1.caption := 'Press';
      Button1.tag := 0
    end
  end;

Speichern Sie Ihre Arbeit, kompilieren und starten Sie neu F9. Der linke Button wird jetzt zwischen zwei alternativen Botschaften hin- und herschalten.

Der Rest liegt an Ihnen!

Wenn Sie das Schreiben von Konsole- oder Text-basierten Pascal Programmen bevorzugen (zum Beispiel wenn Sie einem einfachen Pascal Programmierkurs folgen, oder Sie Programme schreiben müssen für die Verwendung im Batchmodus oder für die Systemprogrammierung), können Sie dennoch Lazarus benutzen zum Bearbeiten, Kompilieren und Starten Ihrer Programme. Es bildet eine ideale Umgebung für die Pascal Entwicklung. Siehe Console Mode Pascal.

Der Editor

Wenn Sie Lazarus zum ersten Mal starten, wird eine Reihe von separaten getrennten oder 'schwebenden' Fenstern auf Ihrem Desktop erscheinen.

Das erste, gleich oben auf dem Desktop, trägt den Titel Lazarus Editor vXXXXXX - project1 (welches anschließend modifiziert wird um den Namen Ihres gegenwärtig geöffneten Projekt widerzuspiegeln). Dies ist das Hauptsteuerungs Fenster für Ihr Projekt und enthält das Hauptmenü und die Komponentenpalette.

Laz de editor1.jpg

In der Zeile unter der Titelleiste befindet sich das Hauptmenü mit den üblichen Einträgen für Datei, Bearbeiten, Suche, Ansichtfunktionen und so weiter, mit einigen Auswahlen, die spezifisch für Lazarus sind. Darunter auf der Linken ist eine Gruppe von BitButtons (welche Sie rasch zu den jeweiligen Hauptmenü Optionen bringen) und auf der Rechten ist die Komponentenpalette.

Unter dem Lazarus Editor Fenster wird das Objektinspektor Fenster auf der Linken erscheinen, und der Lazarus Quelltext Editor auf der Rechten. Es gibt noch ein anderes kleineres Fenster, beschriftet mit Form1, über dem Lazarus Quelltext Editor Fenster. Wenn dieses nicht sogleich sichtbar ist, kann man es durch drücken der F12 Taste hervorholen, welche zwischen der Quelltext Editor Ansicht und der Formular Ansicht umschaltet. Das Formularfenster ist dasjenige, auf dem Sie das grafische Interface für Ihre Anwendung erstellen, während der Quelltext Editor das Fenster ist, welches den Pascal Code zeigt, der mit der Anwendung verbunden ist, welche Sie gerade entwickeln. Die Bedienung des Objektinspektors wird weiter unten detaillierter behandelt, während die Komponentenpalette beschrieben wird.

Wenn Sie ein neues Projekt starten (oder wenn Sie zuerst Lazarus starten), wird ein vorgegebenes Formular erstellt, welches zusammengesetzt ist aus einem Feld, in dem ein Punktegitter ist, welches Ihnen hilft, die verschiedenen Komponenten des Formulars zu positionieren, und einer Leiste am oberen Rand, welche die üblichen Minimieren, Maximieren und Beenden Buttons enthält. Wenn Sie mit Ihrer Maus irgendwo in diesem Feld klicken, werden Sie die Eigenschaften dieses Formulars sehen, angezeigt im Objektinspektor auf der linken Seite des Desktops.

Andere Fenster, die während Ihrer Arbeit sichtbar werden könnten: der Projektinspektor, welcher Details der Dateien enthält, die in Ihrem Projekt inbegriffen sind, und Ihnen erlaubt, Dateien hinzuzufügen oder zu löschen aus Ihrem Projekt, das Nachrichten Fenster, welches Compilermeldungen anzeigt, Fehler oder Fortschrittsberichte über Ihr Projekt; wenn Lazarus von einem Terminalfenster gestartet wird, bleibt das orginale Terminal sichtbar und detaillierte Compilermeldungen werden auch dort ausgegeben.

Das Hauptmenü

Die Hauptmenü Linie enthält die folgenden Einträge: Datei Bearbeiten Suche Ansicht Projekt Start Komponenten Werkzeuge Einstellungen Fenster Hilfe

Wie gewöhnlich, können die Optionen gewählt werden entweder durch Platzieren des Mauscursors über der Menü Option und klicken der linken Maustaste, oder durch Eingeben von Alt-F auf der Tastatur (sofern das Hauptmenü den Fokus hat: wenn nicht, dann drücken Sie TAB mehrmals um den Fokus durch die verschiedenen Fenster zu bewegen, bis das gewünschte Fenster mit seiner Titelleiste farbig hervorgehoben ist).

Die Hilfe zu einzelnen Menüpunkten finden Sie hier.

Die Button-Leiste

Eine kleiner Symbolleisten Bereich links im Haupt Editor Fenster, genau unter dem Hauptmenü und links von der Komponenten Palette, enthält eine Gruppe von Schaltflächen, welche häufig genutzte Hauptmenü Auswahlen wiederholt:

Neue Unit, Öffnen (mit einem Pfeil zur Anzeige einer drop-down Liste der zuletzt geöffneten Dateien), Speichern, Alles speichern, Neues Formular, Formular/Unit wechseln (zeigt entweder das Formular oder den Quellcode der Unit), Units anzeigen, Formulare anzeigen, Start, Pause, Einzelschritt hinein, Einzelschritt darüber (die letzten beiden sind Debugger-Funktionen).

Die Komponentenpalette

Eine tabbed Symbolleiste, welche eine große Anzahl von Icons anzeigt, die üblich genutzte Komponenten für die Formularerstellung vertreten.

Jeder tab bewirkt die Anzeige von verschiedenen Gruppen von Icons, die eine zweckmäßige Gruppe von Komponenten vertreten. Das ganz linke Icon in jeder tabbed Gruppe ist ein schräger linksgerichteter Pfeil, genannt das Auswahlwerkzeug.

Wenn Sie den Mauszeiger über irgendein Icon der Komponentenpalette bewegen, ohne auf das Icon zu klicken, wird der Titel dieser Komponente aufpoppen. Beachten Sie, dass jeder Titel mit einem 'T' beginnt - das bedeutet 'Typ' oder richtiger 'Klasse' der Komponente. Wenn Sie eine Komponente für die Verwendung in einem Formular auswählen, wird die Klasse zum type Abschnitt des interface Teils der Unit hinzugefügt (üblicherweise als Teil des gesamten TForm1), und eine instance dieser Klasse wird zum var Abschnitt hinzugefügt (üblicherweise als Variable Form1). Jede Methode die Sie design to be used by the Formular oder seine Komponenten (d.h. Prozeduren oder Funktionen) wird im implementation Teil der Unit platziert.

In der folgenden Liste der Komponenten werden Sie Links zu Dateien finden, die Beschreibungen der Units enthalten, in denen sie vorkommen. Wenn Sie etwas über die Eigenschaften einer bestimmten Komponente herausfinden wollen, lohnt es sich oft, auf die Vererbung dieser Komponente zu schauen und dann die Eigenschaften des Basistyps anschauen, von dem sie abgeleitet ist. Zum Beispiel, um TMaskEdit zu verstehen ist es auch hilfreich, TCustomMaskEdit zu untersuchen.

TABS (Die Namen sind größtenteils selbstbeschreibend.):

Laz de comp stand.jpg
Oft benutzte Komponenten: TMainMenu, TPopupMenu, TButton, TLabel, TEdit, TMemo, TToggleBox, TCheckBox, TRadioButton, TListBox, TComboBox, TScrollBar, TGroupBox, TRadioGroup, TCheckGroup, TPanel, TActionList
Laz de comp addit.jpg
weitere, oft benutzte Komponenten: TBitBtn, TSpeedButton, TStaticText, TImage, TShape, TBevel, TPaintBox, TNotebook, TLabeledEdit, TSplitter, TTrayIcon, TMaskEdit, TCheckListBox, TScrollBox, TApplicationProperties, TStringGrid, TDrawGrid, TPairSplitter, TColorBox, TColorListBox, TChart
Laz de comp common.jpg
TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TTabControl, TImageList
Laz de comp dialog.jpg
TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog (wenn Printer4Lazarus installiert ist auch TPrinterSetupDialog, TPrintDialog und TPageSetupDialog)

Verschiedene hilfreiche Dialog Prozeduren oder Funktionen erscheinen nicht auf der Palette, sind aber einfach zu nutzen als direkte Aufrufe von ihrem Quellprogramm.

Für verschiedene gute Beispiele der Benutzung der Komponenten schauen Sie im $LazarusPath/lazarus/examples Unterverzeichnis ihrer Quellen Installation nach. Viele der Programme zeigen, wie man Dialoge und andere Komponenten direkt verwendet, ohne Benutzung der IDE und der Komponentenpalette oder die eine separate Formulardefinitionsdatei haben. Alle Komponenten sind vollständig und ausdrücklich definiert im Haupt-Pascalprogramm. Andere Beispielprogramme machen völlig Gebrauch von der IDE.

Einige Beispiele arbeiten nicht sofort: Sie müssen möglicherweise mit den Pfaden und Zugriffsrechten von Dateien oder Verzeichnissen spielen. Wenn Sie einige der Beispiele kompilieren wollen stellen Sie sicher, dass Sie Lese-/Schreibrechte für die Dateien und Verzeichnisse haben, oder Sie kopieren die Dateien in ein Verzeichnis, für das Sie die entsprechenden Rechte haben.

Versuchen Sie das 'testall' Programm zu starten, um ein Menü der verfügbaren Komponenten zusammen mit kleinen Beispiel Testformularen für die meisten von ihnen zu sehen; dann kontrollieren Sie den Code um herauszufinden, wie sie funktionieren!

  • Misc
Laz de comp misc.jpg
TColorButton, TSpinEdit, TFloatSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox, TXMLPropStorage, TIniPropStorage, TbarChart, TButtonPanel, TIDEDialogLayoutStorage
  • Data Controls
Laz de comp data con.jpg
Datensensitive Komponenten, welche weitgehend die Standard und Additional Gruppen wiederholen aber einsetzbar sind für Datenbanken: TDBNavigation, TDBText, TDBEdit, TDBMemo, TDBImage, TDBListBox,TDBComboBox, TDBCheckBox, TDBRadioGroup, TDBCalendar, TDBGroupBox, TDBGrid
  • Data Access
Laz de comp data acc.jpg
TDatasource, TSdfDataSet (Package SDFLaz), TFixedFormatDataSet (Package SDFLaz), TMemDataset (Package MemDSLaz), TDbf (Package DBFLaz)
  • System
Laz de comp syste.jpg
TTimer, TIdleTimer, TLazComponentQueue, THTMLHelpDatabase, THTMLBrowserHelpViewer, TProcess, TSimpleIPCClient, TSimpleIPCServer, TXMLConfig
  • SynEdit
Laz de comp syned.jpg
Eine Gruppe von Komponenten to help interfacing with other languages and software tools. SynEdit is an advanced multi-line edit control, for Borland Delphi, Kylix and C++Builder. It supports Syntax Highlighting and code completion, and includes exporters for html, tex and rtf. It is a full-VCL/CLX control, meaning it is not a wrapper for Microsoft Windows controls, and no run-time library is required; this make SynEdit a crossplatform component. Compatibility with FreePascal is also planned, and SynEdit is the edit component in Lazarus IDE. see synedit at sourceforge. TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynMultiSyn

Um die Komponentenpalette zu nutzen, muss ein Formular im Editor geöffnet sein (falls nicht wählen Sie Datei -> Neues Formular). Klicken Sie auf das Icon im geeigneten Tab der Palette für die Komponente, die Sie verwenden wollen, dann klicken Sie auf das Formular, in der Nähe wo die Komponente erscheinen soll. Wenn die gewünschte Komponente erscheint, dann können Sie sie durch klicken mit der Maus auswählen, an die exakte Stelle auf dem Formular verschieben und ihre Größe anpassen. Adjustments can be made to the appearance either by altering the picture itself on the Form using the mouse, oder durch Änderung der relevanten Eigenschaft im Objekteditor für diese Komponente.

Wenn Sie zusätzliche Komponenten installieren, entweder jene, die Sie selbst geschrieben haben, oder einige, die als Package von einer anderen Quelle kommen, dann werden extra tabs mit den relevanten Icons in ihrer Komponentenpalette erscheinen. Diese neuene Komponenten können ausgewählt und in ihrem Formularen verwendet werden auf die selbe Weise, wie die mit Lazarus gelieferten Komponenten.

Der Debugger

Ist noch zu schreiben.

siehe auch IDE Fenster - Debuggen

Die Lazarus-Dateien

   (Dank an Kevin Whitefoot.)
   (Hinzufügungen von Giuseppe Ridinò, User:Kirkpatc und Tom Lisjac)

Wenn Sie speichern, wählen Sie eigentlich nur zwei Dateien aus:

  xxx.pas und yyy.lpr 

(Sie speichern mehr als das, aber die beiden sind diejenigen, die Sie benennen müssen). Die Projektdatei (lpr) und die Unitdatei (pas) müssen nicht denselben Namen haben, weil Lazarus freundlicherweise der Unit (im Quellcode) den selben Namen gibt wie den Dateinamen, unter dem Sie speichern. Genauso bekommt ein Programm den Namen der Projektdatei (Das muss so sein, weil ansonsten der Compiler möglicherweise die Unit später nicht finden könnte, wenn sie in der Projektdatei verwendet wird). Natürlich werden aus Konsistenzgründen alle Verweise auf unit1 auf xxx geändert.

Wenn Sie also versuchen, ein Projekt mit Namen again zu speichern - dabei wird versucht, again.pas und again.lpr anzulegen - wird das schiefgehen, weil Unit-Namen und Programmnamen denselben Namensraum verwenden. Die doppelten Namen werden abgelehnt.

So, das kommt dabei heraus:

e:/lazarus/kj/lazhello:
total 4740  free 76500
-rwxrwxrwx   1 kjwh     root  4618697 Mar 24 11:19 again.exe
-rw-rw-rw-   1 kjwh     root     3002 Mar 24 11:21 again.lpi
-rw-rw-rw-   1 kjwh     root      190 Mar 24 11:18 again.lpr
-rw-rw-rw-   1 kjwh     root      506 Mar 24 11:08 againu.lfm
-rw-rw-rw-   1 kjwh     root      679 Mar 24 11:08 againu.lrs
-rw-rw-rw-   1 kjwh     root      677 Mar 24 11:08 againu.pas
-rw-rw-rw-   1 kjwh     root     2124 Mar 24 11:08 againu.ppu
-rwxrwxrwx   1 kjwh     root      335 Mar 24 11:07 ppas.bat

Haben Sie gemerkt, dass viel mehr Dateien entstanden sind, als die beiden, die wir eigentlich speichern wollten?

Hier ist eine kurze Bemerkung über jede Datei:

again.exe: Das ausführbare Hauptprogramm. Unter Windows wird eine "exe"-Erweiterung hinzugefügt. Unter Linux gibt es keine Dateierweiterung. Im Normalfall ist diese Datei riesig, da viele Debugging-Symbole in der Programmdatei enthalten sind. Starten sie das "strip" Dienstprogramm, um sie zu entfernen und die Größe des ausführbaren Programms wesentlich zu schrumpfen.

again.lpi: Dies ist die Haupdatei eines Lazarus Projekts (Lazarus Project Information); die equivalente Delphi Hauptdatei einer Anwendung ist die .dpr Datei. Sie wird in einem XML Format gespeichert.

again.lpr: Die Hauptprogramm Quelldatei. Trotz seiner Lazarus-spezifischen Erweiterung ist es eigentlich eine völlig normale Pascal Quelldatei. Sie hat eine uses Anweisung, die dem Compiler angibt, welche Units er braucht. Beachten Sie, dass das Program Statement das Programm nicht notwendigerweise gleich nennen muss wie den Dateinamen.

againu.lfm: Hier speichert Lazarus das Layout der Formularunit. Lazarus braucht das, um eine Resourcen-Datei zu erzeugen, die im Initialisierungsteil der againu.pas Unit verwendet wird. Es ist möglich, Delphi .dfm -Dateien in der IDE in das .lfm-Format zu wandeln. Verwenden Sie dazu Werkzeuge->DFM in LFM-Datei konvertieren.

again.lrs: Dies ist die erzeugte Ressourcen Datei. Beachten sie, dass dies keine Windows Ressourcen Datei ist.

againu.pas: Die Unit, welche den Code für das Formular enthält.

again.ppu: Dies ist die kompilierte Unit.

ppas.bat: Dies ist ein einfaches Script zum Linken des Programms in eine ausführbare Datei. Wenn die Kompilierung erfolgreich war, wird es vom Compiler gelöscht.

Mitwirkende und Änderungen

Diese Seite wurde importiert von der epikwiki Version.

  • Created initial page and template. T. Lisjac - 11/04/2003 VlxAdmin
  • Inserted a note containing instructions for writing your first Lazarus Program. Suggest an administrator places it in the appropriate place on the Tutorial menu. 3/09/2004 User:Kirkpatc
  • Per above, moved Chris's writeup to the main body of the tutorial VlxAdmin
  • Began to insert text describing the Lazarus Editor - more to follow! 24 Mar 2004 User:Kirkpatc
  • Added some more to Lazarus Editor section of Tutorial. 25 Mar 2004 User:Kirkpatc
  • Added screenshots and revised some of the page formatting VlxAdmin 3/25/2004
  • Moved some of kwhitefoot's comments into Tutorial section. Formatting not quite right, but have to go to bed now! 26 Mar 2004 User:Kirkpatc
  • Formatted, added credits and comments. Removed original notes. VlxAdmin 3/26/2004
  • More material added to Editor section of tutorial. 26 Mar 2004 User:Kirkpatc
  • More material added describing the Main Menu. Renamed 'Hello World' to 'Getting Started' and moved it to nearer the top. 31 March 2004 User:Kirkpatc
  • Abschnitt einegfügt zum Start Untermenü. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 User:Kirkpatc
  • Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 User:Kirkpatc
  • Abschnitt über MySQL von hier gelöscht: er wurde in den Lazarus Datenbanken Abschnitt des Tutorials kopiert. 14 Apr 2004 User:Kirkpatc
  • Added some more to the description of the Editor Main Menu. 18 Apr 2004 User:Kirkpatc
  • Abschnitt zum Einstellungen Untermenü hinzugefügt. 19 Apr 2004 User:Kirkpatc
  • Abschnitt zum Komponenten Untermenü hinzugefügt. 4 May 2004 User:Kirkpatc
  • Werkzeuge Untermenü Beschreibung hinzugefügt (unvollständig). 7 May 2004 User:Kirkpatc
  • Einige Screenshots hinzugefügt zu den Menü Beschreibungen. 9 May 2004 User:Kirkpatc
  • Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 User:Kirkpatc
  • Mehr Hinzufügungen zum Werkzeuge Untermenü. 19 May 2004 User:Kirkpatc
  • Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 User:Kirkpatc
  • Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 User:Kirkpatc
  • Edited the StdCtrls file, removing a lot of repetitive material and doing some formatting. It is still far too long. 28 May 2004 User:Kirkpatc
  • Expanding on the Components Palette. 5 June 2004 User:Kirkpatc
  • Added a lot to the DialogExamples page. 10 June 2004 User:Kirkpatc
  • Beachtliche Revision der StdCtrls Seite, hopefully making it clearer and encouraging people to contribute - particularly in the 'Description' sections. 14 June 2004 User:Kirkpatc
  • Added pages for Menus and Dialogs units (linked to Component Palette description) - please feel free to add to these pages. 14 June 2004 User:Kirkpatc
  • Seite für Common Controls hinzugefügt (linked to Component Palette). 16 June 2004 User:Kirkpatc
  • MaskEdit Seite hinzugefügt (linked to Component Palette). 17 June 2004 User:Kirkpatc
  • Buttons und ExtCtrls Seiten hinzugefügt (linked to Component Palette). 17 June 2004 User:Kirkpatc
  • Edited MainMenu component description page. 23 June 2004 User:Kirkpatc
  • Some additions to Common Controls. 28 June 2004 User:Kirkpatc
  • A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 User:Kirkpatc
  • Kleinere Änderungen an ComCtrls, ExtCtrls, Environment Menu. 10 July User:Kirkpatc
  • Added FormsTxt, component description page for Component Palette. 20 July 2004 User:Kirkpatc
  • Einige Korrekturen an ConsoleModePascal. 21 July 2004 User:Kirkpatc
  • Einige kleine Änderungen an ComponentPalette. 22 July 2004 User:Kirkpatc