Difference between revisions of "Lazarus Tutorial/nl"

From Free Pascal wiki
Jump to navigationJump to search
(Moved main menu section to page Main menu/nl and inserted link)
 
(48 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{Lazarus Tutorial}}
 
==Inleiding==
 
==Inleiding==
Lazarus is een "vrije" en open source ontwikkelomgeving die gebruik maakt van de FreePascal Compiler (object pascal). De FreePascal Compiler is ook een open source project en "vrije software". De Lazarus IDE ([http://lazarus-ccr.sourceforge.net/kbdata/lazide.jpg schermafdruk]) is een stabiele en complete ontwikkel omgeving waarmee grafische en terminal programma's ontwikkeld kunnen worden. Lazarus draait onder Linux, FreeBSD, Windows, MAC-OS en ook op 64 bits platforms. Naast een instelbare code editor heeft Lazarus ook een grafische tool voor het maken van de programma schermen, alles volledig geïntegreerd met de FreePascal compiler.
+
Lazarus is een "vrije" en opensourceontwikkelomgeving die gebruik maakt van de ''FreePascal'' Compiler (object pascal). De FreePascal Compiler is ook een ''open source project'' en "vrije software". De Lazarus ''Integrated Development Environment'' (IDE) is een stabiele en complete ontwikkelomgeving waarmee grafische en terminalprogramma's ontwikkeld kunnen worden. Lazarus draait onder Linux, FreeBSD, Windows, MAC-OS en ook op 64-bits platforms. Naast een instelbare code-editor heeft Lazarus ook een grafische tool voor het maken van de programmaschermen, alles volledig geïntegreerd met de FreePascal-compiler.
  
 
==Het begin==  
 
==Het begin==  
 
(Thanks to [[User:Kirkpatc]])
 
(Thanks to [[User:Kirkpatc]])
===Je eerste Lazarus programma===
+
===Je eerste Lazarus-programma===
  
Download, [[Installing Lazarus|installeer]] en start Lazarus. Voor een complete handleiding voor de installatie van Lazarus verwijzen we naar deze [[Installing Lazarus|pagina]], hier willen we alleen aantekenen dat bij de windows installer FPC automatisch geïnstalleerd wordt en dat je voor Linux FPC, de FPC-sources en Lazarus apart moet installeren. Let hierbij dat de FPC versie past bij de gekozen Lazarus versie.
+
Download, [[Installing Lazarus|installeer]] en start Lazarus. Voor een complete handleiding voor de installatie van Lazarus verwijzen we naar deze [[Installing Lazarus|pagina]], hier willen we alleen aantekenen dat bij de windows installer FPC automatisch geïnstalleerd wordt en dat je voor Linux FPC, de FPC-broncode en Lazarus apart moet installeren. Let hierbij dat de FPC versie past bij de gekozen Lazarus versie.
  
Nadat je Lazarus gestart hebt, zie je verschillende windows op je scherm: het hoofdmenu bovenin, de "Object Inspector" aan de linkerkant, de source code editor neemt het grootste deel van je scherm in, daar overheen zie je de basis voor je eerste scherm ("Form1").
+
Nadat je Lazarus gestart hebt, zie je verschillende windows op je scherm: het hoofdmenu bovenin, de "Object Inspector" aan de linkerkant, de broncode-editor neemt het grootste deel van je scherm in, daar overheen zie je de basis voor je eerste scherm ("Form1").
  
Het scherm met het hoofdmenu bevat niet alleen een menu, maar ook een aantal knopjes en een rij met "tabs". Als de "Standard" tab nog niet geselecteerd is, doe dat dan door er op te klikken met de muis. Zoek dan de "Button" icon (een rechthoekje met 'OK' erop) en klik daarop. Klik daarna ergens links van het midden op het "Form1" scherm. Hierdoor zal er een rechthoek (een windows knopje) verschijnen met de tekst 'Button1'. Klik nog eens op de "Button" icon op de "Standard" tab en daarna weer op "Form1" rechts van de eerste button. Er zal een tweede knop verschijnen, ditmaal met de tekst 'Button2'.
+
Het scherm met het hoofdmenu bevat niet alleen een menu, maar ook een aantal knopjes en een rij met "tabs". Als de "Standard" tab nog niet geselecteerd is, doe dat dan door er op te klikken met de muis. Zoek dan de "Button" icon (een rechthoekje met 'OK' erop) en klik daarop. Klik daarna ergens links van het midden op het "Form1" scherm. Hierdoor zal er een rechthoek (een windowsknopje) verschijnen met de tekst 'Button1'. Klik nog eens op de "Button" icon op de "Standard" tab en daarna weer op "Form1" rechts van de eerste button. Er zal een tweede knop verschijnen, ditmaal met de tekst 'Button2'.
  
 
Klik nu op Button1 om deze te selecteren. In de Object Inspector worden de eigenschappen (properties) van de Button1 getoond. Bovenin de Object Inspector vind je de property 'Caption', deze heeft nu de waarde 'Button1'. Klik in dit vakje en wijzig de tekst in 'Press'. Als je nu op ENTER drukt of in een andere vakje klikt zul je zien dat de tekst op de knop nu wijzigt in 'Press'. Klik nu op de "Events" tab van de Object Inspector, hierdoor zie je een lijst van de verschillende Events waarop door de knop gereageerd kan worden. Deze Events bevatten onder meer OnClick, OnEnter, OnExit. (Events ontstaan als gevold van akties van de gebruiker van je programma. Wordt er op een knop geklikt dan wordt dus het OnClick event aangeroepen.)
 
Klik nu op Button1 om deze te selecteren. In de Object Inspector worden de eigenschappen (properties) van de Button1 getoond. Bovenin de Object Inspector vind je de property 'Caption', deze heeft nu de waarde 'Button1'. Klik in dit vakje en wijzig de tekst in 'Press'. Als je nu op ENTER drukt of in een andere vakje klikt zul je zien dat de tekst op de knop nu wijzigt in 'Press'. Klik nu op de "Events" tab van de Object Inspector, hierdoor zie je een lijst van de verschillende Events waarop door de knop gereageerd kan worden. Deze Events bevatten onder meer OnClick, OnEnter, OnExit. (Events ontstaan als gevold van akties van de gebruiker van je programma. Wordt er op een knop geklikt dan wordt dus het OnClick event aangeroepen.)
Line 35: Line 36:
 
Je hoeft dus alleen maar <b>Close;</b> in te typen.
 
Je hoeft dus alleen maar <b>Close;</b> in te typen.
  
Je bent nu klaar om je programma te compileren en uit te voeren. De makkelijkste manier is om van het 'Run'-menu de 'Run'-optie te kiezen, je kunt ook op F9 drukken of op het groene driehoekje klikken. In ieder geval zal je programma eerst gecompileerd worden en daarna gelinkt. Uiteindelijk zal je programma uitgevoert worden, als tenminste alles is goed gegaan en er geen fouten in je code zaten.
+
Je bent nu klaar om je programma te compileren en uit te voeren. De makkelijkste manier is om van het 'Run'-menu de 'Run'-optie te kiezen, je kunt ook op F9 drukken of op het groene driehoekje klikken. In ieder geval zal je programma eerst gecompileerd worden en daarna gelinkt. Uiteindelijk zal je programma uitgevoerd worden, als tenminste alles is goed gegaan en er geen fouten in je code zaten.
  
 
Er zal nog een scherm verschijnen waarin allerlei meldingen van de compiler zullen verschijnen, maar uiteindelijk zal je scherm Form1 getoond worden (zonder alle puntjes, die je in de ontwerp fase ziet.) Dit is het "mainwindow" van je applicatie en het wacht op de dingen die komen gaan.
 
Er zal nog een scherm verschijnen waarin allerlei meldingen van de compiler zullen verschijnen, maar uiteindelijk zal je scherm Form1 getoond worden (zonder alle puntjes, die je in de ontwerp fase ziet.) Dit is het "mainwindow" van je applicatie en het wacht op de dingen die komen gaan.
Line 68: Line 69:
 
The rest is up to you!
 
The rest is up to you!
  
===Tekst georienteerde programma's.===
+
===Tekst georiënteerde programma's.===
Als je een console of tekst georienteerde programma moet schrijven (bijvoorbeeld als je een basis cursus pascal volgt, of voor een programma dat door een batch file wordt uitgevoerd), kun je ook Lazarus gebruiken om dit programma te bewerken, compileren en uit te voeren. Lazarus is dus ook een ideale tool om Pascal programma's te schrijven. Zie [[Console Mode Pascal]].
+
Als je een console of tekst georiënteerd programma moet schrijven (bijvoorbeeld als je een basis cursus Pascal volgt, of voor een programma dat door een batch file wordt uitgevoerd), kun je ook Lazarus gebruiken om dit programma te bewerken, compileren en uit te voeren. Lazarus is dus ook een ideale tool om Pascal-programma's te schrijven. Zie [[Console Mode Pascal]].
  
 
==De Editor==
 
==De Editor==
Line 77: Line 78:
 
Het scherm aan de bovenkant van je desktop heeft als titel: '''Lazarus Editor vXXXXXX - project1'''. Hierbij wordt de serie X-en vervangen door het versie nummer van de Lazarus omgeving en zal project1 de naam weergeven van het project waar je op dat moment mee bezig bent. Dit scherm is het hoofdscherm en bevat het hoofdmenu en de componenten pallet.
 
Het scherm aan de bovenkant van je desktop heeft als titel: '''Lazarus Editor vXXXXXX - project1'''. Hierbij wordt de serie X-en vervangen door het versie nummer van de Lazarus omgeving en zal project1 de naam weergeven van het project waar je op dat moment mee bezig bent. Dit scherm is het hoofdscherm en bevat het hoofdmenu en de componenten pallet.
  
<center>[[Image:lazmain.jpg]]</center>
+
<center>[[Image:Lazmain.jpg]]</center>
  
 
Onder de titelbalk zien we het ''Hoofdmenu'', met de gebruikelijke keuze als File, Edit, Search enzovoort. Daarnaast zijn er een aantal keuze specifiek voor Lazarus.
 
Onder de titelbalk zien we het ''Hoofdmenu'', met de gebruikelijke keuze als File, Edit, Search enzovoort. Daarnaast zijn er een aantal keuze specifiek voor Lazarus.
 
Daaronder vinden we aan de linkerkant een aantal knopjes die een snelle en eenvoudige toegang geven tot een aantal belangrijke en veel gebruikte functies. Naast deze knopjes vinden we het componenten palet. Net zoals een schilder gebruik maakt van een palet om een kleur verf te kiezen, hebben we in Lazarus een pallet om een te gebruiken component te kiezen.
 
Daaronder vinden we aan de linkerkant een aantal knopjes die een snelle en eenvoudige toegang geven tot een aantal belangrijke en veel gebruikte functies. Naast deze knopjes vinden we het componenten palet. Net zoals een schilder gebruik maakt van een palet om een kleur verf te kiezen, hebben we in Lazarus een pallet om een te gebruiken component te kiezen.
  
Onder dit hoofdscherm zie je aan de linkerkant de '''[http://lazarus-ccr.sourceforge.net/kbdata/objinsp.jpg Object Inspector]''', en de '''[http://lazarus-ccr.sourceforge.net/kbdata/editor.jpg Lazarus Source Editor]''' aan de rechterkant. Er kan nog een ander kleiner scherm, genaamd '''[http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg Form1]''' zichtbaar zijn, dat over de Lazarus Source Editor scherm ligt. Als dit niet gelijk zichtbaar is, kun je het oproepen door op '''F12''' te drukken. De '''F12''' toets schakelt heen en weer tussen een form en de bijbehorende code unit. Het form is de grafische interface van je programma.
+
Onder dit hoofdscherm zie je aan de linkerkant de '''[http://lazarus-ccr.sourceforge.net/kbdata/objinsp.jpg Object Inspector]''', en de '''[http://lazarus-ccr.sourceforge.net/kbdata/editor.jpg Lazarus Source Editor]''' aan de rechterkant. Er kan nog een ander kleiner scherm, genaamd '''[http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg Form1]''' zichtbaar zijn, dat over de Lazarus Source Editor scherm ligt. Als dit niet gelijk zichtbaar is, kun je het oproepen door op '''F12''' te drukken. De '''F12''' toets schakelt heen en weer tussen een formulier (form) en de bijbehorende code unit. Het formulier is de grafische interface van je programma.
  
Als je een nieuw project start zal er een default Form worden aangemaakt. Dit form is niet meer dan een kaal scherm met titelbalk en op dat scherm een matrix van puntjes die je helpen bij het positioneren van de verschillende componenten. De titelbalk bevat ook de gebruikelijke '''Minimize''', '''Maximize''' en '''Close knopjes'''. Als je op het form klikt, zie je in de Object Inspector aan de linkerkant van je desktop de properties (eigenschappen) van het form.
+
Als je een nieuw project start zal er een standaard "Form" worden aangemaakt. Dit formulier is niet meer dan een kaal scherm met titelbalk en op dat scherm een matrix van puntjes die je helpen bij het positioneren van de verschillende componenten. De titelbalk bevat ook de gebruikelijke '''Minimalisatie-''', '''Maximalisatie-''' en '''Sluitknopjes'''. Als je op het form klikt, zie je in de Object Inspector aan de linkerkant van je desktop de properties (eigenschappen) van het form.
  
 
Er zijn nog meer schermen die je zichtbaar kunt maken of die zichtbaar worden tijdens het werken: de '''[http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg Project Inspector]''', die gegevens laat zien over de bestanden die onderdeel zijn van het project; het '''Messages''' scherm, waarin compiler meldingen, foutmeldingen en voortgang rapportage getoond worden. Als je Lazarus opstart vanuit een terminal scherm, dan blijft dit zichtbaar en worden de compiler meldingen hierin ook weergegeven.
 
Er zijn nog meer schermen die je zichtbaar kunt maken of die zichtbaar worden tijdens het werken: de '''[http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg Project Inspector]''', die gegevens laat zien over de bestanden die onderdeel zijn van het project; het '''Messages''' scherm, waarin compiler meldingen, foutmeldingen en voortgang rapportage getoond worden. Als je Lazarus opstart vanuit een terminal scherm, dan blijft dit zichtbaar en worden de compiler meldingen hierin ook weergegeven.
Line 90: Line 91:
 
===Het Hoofdmenu===
 
===Het Hoofdmenu===
  
Het hoofdmenu bevat de volgende keuzes:
+
For a detailed description of every menu item which is accessible from the Lazarus IDE Main Menu, please refer to the [[Main menu/nl]] page.
<u>F</u>ile  <u>E</u>dit  <u>S</u>earch  <u>V</u>iew  <u>P</u>roject  <u>R</u>un  <u>C</u>omponents  <u>T</u>ools  E<u>n</u>vironment  <u>W</u>indows  <u>H</u>elp
 
  
De keuzes kunnen op de bekende manieren geselecteerd worden, door een klik met de muis of door het gebruik van de '''Alt''' toets in combinatie met de onderstreepte latter. De '''F10''' toets zorgt er ook voor dat het menu actief wordt.
+
===Het knoppenpaneel (Button bar)===
 +
Een kleine "toolbar" met een aantal knopjes, die veelgebruikte menukeuzes snel beschikbaar maken:
 +
: '''New unit''', '''Open''' (met een drop-down lijst van onlangs geopende bestanden), '''Save''', '''Save all''', '''New Form''', '''Toggle Form/Unit''' (Schakelen tussen de unit en het form), '''View Units''', '''View Forms''', '''Run''', '''Pause''', '''Step Into''', '''Step over'''.
  
====Het File menu====
+
==De Componenten Palet==
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/FileMenuSnapshot.png </div>
+
Een toolbar met tabs waarop een groot aantal iconen die de componenten weergeven.
* '''New Unit''': Maakt een nieuwe Unit file aan zonder form (Pascal Source).
 
* '''New Form''': Maakt een nieuw Form: Zowel het zichtbare form als de bijbehorende Pascal source file.
 
* '''New ...''': Laat een pop-up [http://lazarus-ccr.sourceforge.net/kbdata/menu-new.jpg scherm] zien keuzes van verschillende nieuw te maken documenten.
 
* '''Open''': Opent een "Open bestand" dialoog om een bestaand document te openen.
 
* '''Revert''': Maakt alle wijzigingen ongedaan en keert terug naar de laatst opgeslagen versie van het bestand.  
 
* '''Open recent''': Geeft uit keuze uit de laatst geopende bestanden.
 
* '''Save''': Slaat het huidige bestand op onder de bekende naam. Als er nog geen naam bekend is, zal het systeem hier om vragen. (net als 'Save As').
 
* '''Save As''': Stelt je in staat om de file onder een andere naam en of in een andere directory op te slaan.
 
* '''Close''': Sluit de huidige file, en vraagt indien nodig of de wijzigingen moeten worden opgeslagen.
 
* '''Close all editor files''': Sluit alle files in de editor en vraagt eventueel of de wijzigingen moeten worden opgeslagen.
 
* '''Clean directory''': Toont een dialoog waarin een serie van wijzigbare filters getoond worden voor het verwijderen van bepaalde bestanden in de huidige directory. Dit is handig voor het verwijderen van backup files en overblijfselen van oude Delphi projecten.
 
* '''Quit''': Sluit Lazarus af, eventueel na het vragen of wijzigingen moeten worden opgeslagen.
 
<div style="clear:both;"></div>
 
  
====Het Edit menu====
+
De verschillende componenten zijn functioneel gegroepeerd op de tabs. Aan de uiterste linker kant zie je op iedere tab een pijl, genaamd 'Selection Tool'.  
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/EditMenuSnapshot.png </div>
 
* '''Undo''': Draait de laatste actie terug.
 
* '''Redo''': Voert de laatste actie die was terug gedraaid opnieuw uit.
 
* '''Cut''': Verwijdert de geselecteerde tekst en plaatst dit op het Clipboard.
 
* '''Copy''': Plaatst een kopie van de geselecteerde tekst op het Clipboard.
 
* '''Paste''': Plaatst de inhoud van het Clipboard op de cursor positie. Als er tekst is geselecteerd wordt deze tekst vervangen door de tekst op het clipboard.
 
* '''Indent selection''': Verplaats de geselecteerde tekst naar een aantal posities naar rechts. Dit aantal is bepaald in Environment -> Editor options -> General -> Block indent. Dit is een handig tooltje bij het formateren van je source code.
 
* '''Unindent selection''': Het tegengestelde van de vorige menukeuze. Het plaatst de geselecteerde tekst een aantal posities naar links.
 
* '''Enclose selection''': Laat een pop-up schermpje zien waarin een keuze gemaakt kan worden voor een bepaalde blok structuur, zoals bijv.begin ... end; try ... except; en nog een aantal. De geselecteerde tekst wordt dan in de gekozen structuur opgenomen.
 
* '''Uppercase selection''': Zet de geselecteerde tekst om naar uppercase.
 
* '''Lowercase selection''': Zet de geselecteerde tekst om naar lowercase.
 
* '''Tabs to spaces in selection''': Zet tabs om naar spatie in de geselecteerde tekst. Het aantal spaties wordt bepaald in Environment -> Editor options -> General -> Tab widths.
 
* '''Break lines in selection''': Als er regels in de geselecteerde tekst langer zijn dan in Environment -> Editor options -> Display -> Right Margin is ingesteld, worden deze regels afgebroken op een woord grens en vervolgd op de volgende regel.
 
* '''Comment selection''': Maakt van de geseleteerde tekst commentaar door iedere regel te laten beginnen met //.
 
* '''Uncomment selection''': Verwijdert de commentaar markeringen.
 
* '''Sort selection''': Sorteert lijnen (of woorden of paragrafen) alphabetisch, hierbij zijn opties voor oplopend of aflopend, hoofdlettergevoelig of niet.
 
* '''Select''': Hierbij kunnen bepaalde blokken tekst geselecteerd worden. Mogelijkheden hierbij zijn bijvoorbeeld select all, select to brace, select paragraph or line etc.
 
* '''Insert from character map''': Maakt het mogelijk om bijvoorbeeld diakritisch tekens in te voeren, door ze in een popup schermpje te kiezen.
 
* '''Insert text''': Geeft een popup menu voor het invoeren van bepaalde standaard teksten zoals CVS sleutelwoorden (Author, Date, Header etc) of GPL notitie, de gebruikersnaam of de huidige datum en tijd.
 
* '''Complete code''': Complementeert de code waar de cursor staat. Dit is redelijk intelligent en kan je een hoop tijd besparen. Het kan bijvoorbeeld classes complementeren door het toevoeging van "private" variabelen, Getters en Setters en het toevoegen van method bodies. Zie ook [[Lazarus IDE Tools]].
 
* '''Extract procedure''': Van de geselecteerde tekst wordt een nieuwe procedure gemaakt.
 
<div style="clear:both;"></div>
 
  
====Het Search menu====
+
Als je de muis boven een icon houdt verschijnt er een hint met de naam van het component. Je zult zien dat iedere naam begint met een 'T'. De 'T' staat voor 'Type' of eigenlijk 'Class'.  
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/SearchMenuSnapshot.png </div>
+
In de volgende lijst van Componenten zie je links naar bestanden die beschrijvingen bevatten van de units waarin ze gevonden worden. Als je iets wilt weten van een bepaald component is het ook verstandig om te kijken naar het component waarvan het is afgeleid. Zo is bijvoorbeeld een TMaskEdit is afgeleid van TCustomMaskEdit.
* '''Find''': Net als bij alle andere tekstverwerkers, krijg je een popup te zien waarin je zoekcriteria kunt invullen.
 
* '''Find Next, Find previous''': Voert de vorige zoekaktie opnieuw uit in de aangegeven richting. (Next zoekt naar het eind, Previous naar het bein.)
 
* '''Find in files''': Het zelfde als '''Find''' maar nu kun je ook laten zoeken in alle files van het project of alle bestanden in een directorie.
 
* '''Replace''': Vervangt een bepaalde tekst door een andere.
 
* '''Incremental find''': Een zoek functionaliteit die werkt terwijl je de zoekstring invult. Bijvoorbeeld: Nadat je "Incremental Find" hebt gekozen en je typt een "l" zal de eerste "l" worden gehighlight. Typ je daarna een "a" dan zal de eerste "la" getoond worden, etc.
 
* '''Goto line''': Hiermee gaat de cursor naar de aangegeven regel in de file.
 
* '''Jump back''': Gaat terug naar het vorige Bookmark. Dit Bookmark moet eerst met '''Add jump point to history''' gezet zijn. Dit werkt door alle in de editor geopende bestanden.
 
* '''Jump forward''': Ga naar het volgende Bookmark.
 
* '''Add jump point to history''': Plaats een bookmark of "spring"punt.
 
* '''View Jump-History''': Dit moet een lijst van bookmarks laten zien. Maar is helaas '''Not implemented yet'''.
 
* '''Find other end of code block''': Als de cursor bij een '''begin''' staat, springt deze naar de bijbehorende '''end''' of vice versa.
 
* '''Find code block start''': Springt naar het begin van de procedure of functie.
 
* '''Find Declaration at cursor''': Toont de plaats waar een identifier is gedeclareerd. Dit kan in dezelfde file zijn, maar ook in een andere file. Als deze file nog niet in de editor geopend is, zal dat automatisch gebeuren. Als de cursor bijvoorbeeld in TButton staat, zal de file buttons.pp geopend worden. (Dezelfde functionaliteit krijg je met een ctrl + muisklik.
 
* '''Open filename at cursor''': Opent de file waarvan de naam onder de cursor staat. Kun je bijvoorbeeld gebruiken voor het zoeken van <u>Include </u> files.
 
* '''Goto include directive''': Als het actieve bestand ge-include wordt in een ander bestand, wordt dit andere bestand geopend, met de cursor op de plaats van het include directive.
 
'''<div style="clear:both;"></div>
 
 
 
====Het View menu====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/ViewMenuSnapshot.png </div>
 
Geeft je de controle over welk van de verschillende schermen op je desktop actief wordt.
 
* '''Object Inspector''': Standaard staat dit scherm aan de linkerkant van de desktop. Het toont de eigenschappen van het control dat op dat moment geselecteerd is. Als je dus op een component op je form klikt worden de eigenschappen (properties) daarvan in de object inspector getoond.
 
Bovenin de object inspector zie je een boom-structuur waarin de componenten van het actieve form te zien zijn. Je kunt ook in deze boom-structuur klikken om de eigenschappen van een bepaald component te laten zien. Het onderste deel van de Object Inspector heeft twee tabs. De eerste bevat alle '''Properties''' en de tweede alle '''Events'''. Onder '''Properties''' vinden we de eigenschappen zoals name, colour, caption, font, size.Er zijn twee kolommen. In de linker kolom staat de naam van het property, in de rechter kolom wordt de toegekende waarde getoond. Ook de '''Events'''-tab kent twee kolommen. De linker kolom toont de verschillende events die het component kent en de tweede de naam van de aan dat event toegekende procedure. Als er nog geen procedure aan een event is toegekend, kun je dat doen
 
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>
 
 
 
====The Project sub-menu====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/ProjectMenuSnapshot.png </div>
 
* '''New Project''': Create a new project.  A pop-up dialog window appears offering a choice of types of project to create.
 
* '''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 (.dpr)or the main .pas file if there is no .dpr.
 
* '''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.
 
 
 
====The Run sub-menu====
 
<div class="floatright"> http://lazarus-ccr.sourceforge.net/kbdata/RunMenuSnapshot.png </div>
 
* '''Build''': Causes Lazarus to build (ie compile) any files in the project that have been changes 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 application.  What 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.
 
* '''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.
 
: 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 screen.  Thus 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.
 
* '''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.
 
 
 
'''NOTE: I AM NOT REALLY CLEAR IN WHAT CIRCUMSTANCES YOU WOULD USE THESE LAST THREE SELECTIONS;  IN PARTICULAR, WHAT HAPPENS TO OTHER FILES THAT ARE USED BY THE PROGRAM?''' [[User:Kirkpatc]]
 
<div style="clear:both;"></div>
 
 
 
====The Components sub-menu====
 
* '''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.
 
 
 
====The Tools sub-menu====
 
<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''': '''I NEED SOME HELP IN DESCRIBING THE FUNCTION OF THIS SELECTION:  I HAVE NEVER USED IT MYSELF AND DON'T REALLY KNOW WHAT IT DOES.''' [[User:Kirkpatc]]
 
* '''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>
 
 
 
====The Environment sub-menu====
 
<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.
 
* '''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.
 
 
 
====The Windows sub-menu====
 
<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>
 
 
 
====The Help sub-menu====
 
 
 
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).
 
 
 
==The Component Palette==
 
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''' (de namen zijn over het algemeen veelzeggend genoeg.):
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=StdCtrls Standard]''': ''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
+
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=StdCtrls Standard]''': ''Veel gebruikte componenten:'' [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
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls Additional]''': ''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
+
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls Additional]''': ''Regelmatig gebruikte componenten:'' [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
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ComCtrls Common Controls]''': TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TImageList
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=ComCtrls Common Controls]''': TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TImageList
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt Dialogs]''': TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog
 
* '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt Dialogs]''': TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog
  
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.
+
Een aantal veel gebruikte '''[http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogExamples Dialoog]''' procedures en functions zie je niet op de componenten palet, maar kunnen eenvoudig gebruikt worden met aanroep vanuit je eigen programma.
 +
 
 +
Bij de installatie van Lazarus zijn een aantal voorbeelden meegenomen, deze voorbeelden staan in de $LazarusPath/examples subdirectory. Veel van deze voorbeelden laten het gebruik van dialog en andere componenten zien zonder het gebruik van de IDE en de Componenten Palet, de gebruikte componenten worden expliciet gedefinieerd in het hoofd pascalunit. Andere voorbeelden maken weer wel gebruik van de IDE.
  
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.
+
Waarschijnlijk zullen niet alle voorbeelden gelijk werken en zul je het een en ander moeten wijzigen aan toegangsrechten tot bestanden of directories. Het eenvoudigste is waarschijnlijk om de sources te kopieren naar een directory waar je volledige rechten hebt en van daaruit de projecten te compileren en runnen.
  
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.
+
Kijk eens naar het 'testall' programma. Je kunt hiermee via de menukeuze Components bijna alle componenten aan het werk zien. Daarna kun je de source eens bestuderen om te zien hoe ze werken en hoe je ze kunt gebruiken.
  
Try running the 'testall' program to see a menu of the available components together with small example test forms for most of them;  then inspect the code to find out how they work!
 
 
* '''Misc''': [http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt TColorButton], TSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox  
 
* '''Misc''': [http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt TColorButton], TSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox  
* '''Data Controls''': ''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
+
* '''Data Controls''': ''Een aantal data-aware uitvoeringen van componenten die op the Standard en Additional tab staan:'' TDBNavigation, TDBText, TDBEdit, TDBMemo, TDBImage, TDBListBox,TDBComboBox, TDBCheckBox, TDBRadioGroup, TDBCalendar, TDBGroupBox, TdbGrid
 
* '''Data Access''': TDatasource
 
* '''Data Access''': TDatasource
 
* '''System''': [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TTimer], TIdleTimer, TProcess
 
* '''System''': [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtCtrls TTimer], TIdleTimer, TProcess
* '''SynEdit''': ''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
+
* '''SynEdit''': ''SynEdit bevat een set van componenten voor Delphi, Kylix, CB en Lazarus waaronder een edit control. Het ondersteunt Syntax Highlighting, Code Completion en heeft exportfuncties naar HTML, tex en RTF. Het is geen wrapper om een bestaand MS control maar een volledig losstaand component.'' Zie ook [http://synedit.sourceforge.net synedit op sourceforge]. TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynMultiSyn
 
 
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.
 
  
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.
+
Om de componenten van de palet te gebruiken moet er natuurlijk een form zijn om ze op te plaatsen. Als er nog geen form is kun je via File -> New Form een nieuw formulier laten aanmaken. Klik dan op het icoontje van het component dat je wilt gebruiken en klik daarna op het formulier op de plek waar je het component ongeveer wilt hebben. Daarna kun je het met de muis op de juiste plaats slepen en de gewenste afmetingen geven. Deze aanpassingen kun je natuurlijk ook maken door de relevante properties in de Object Inspector te wijzigen.
  
==The Debugger==
+
Als je aanvullende componenten installeert (zelfgemaakte of uit een package van een andere bron) kunnen deze op nieuwe tab getoond worden. Deze kunnen dan op dezelfde wijze gebruikt worden als de standaardcomponenten. Zie [[Install Packages]].
: ''Still to be written''.
 
  
==The Lazarus files==
+
==De Debugger==
    (Thanks to Kevin Whitefoot.)
+
: ''Moet nog geschreven worden''.
    (Additions by Giuseppe Ridinò, [[User:Kirkpatc]] and Tom Lisjac)
 
When you save you will actually be saving two files:
 
  
   xxx.pas and yyy.lpr  
+
==De Lazarusbestanden==
(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.
+
Een Lazarusproject voor een grafisch programma bestaat uit minimaal twee bestanden:
 +
   xxx.pas (of xxx.pp) en yyy.lpr  
 +
Eigenlijk worden er meer aangemaakt, maar dit zijn de bestanden die je een naam geeft. Het project bestand (lpr) en het unit bestand (pas of pp) mogen niet dezelfde naam hebben, omdat Lazarus de bijbehorende unit in de sources dezelfde naam zal geven.
  
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.
+
Dus als je een project genaamd '''again''' opslaat, kun je de form unit niet meer als again.pas opslaan. Er zijn dan twee objecten met dezelfde naam. Dit kan niet en zal een "duplicate name" melding geven.
  
So here is what I ended up with:
+
Uiteindelijk was dit mijn resultaat:
  
 
e:/lazarus/kj/lazhello:
 
e:/lazarus/kj/lazhello:
Line 351: Line 152:
 
  -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.
+
Zoals je ziet zijn het een paar meer dan je in eerste instantie dacht op te slaan.  
  
Here is a brief note about each file:
+
Hieronder voor elk bestand een kleine beschrijving::
  
 
'''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.
+
Het uitvoerbare binaire bestand. Onder Windows zal het de ".exe"-extensie krijgen, onder Linux krijgt het geen extensie. In eerste instantie zullen deze bestanden erg groot zijn, omdat ze de volledige debug informatie bevatten. Met behulp van de "strip"-tooltje kan deze informatie verwijderd worden en zal het bestand aanzienlijk kleiner worden.
  
 
'''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.
+
Dit is een bestand met informatie met betrekking tot je project, vergelijk baar met de .dsk file in Delphi. Het wordt opgeslagen in XML-formaat en bevat informatie over de plaats van de verschillende schermen, informatie over welke bestanden waren geopend in de editor, de cursorpositie in de verschillende bestanden, etc etc.
  
 
'''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.
+
De broncode van het programma. Dit is een gewoon Pascal-bestand en wordt volledig door Lazarus onderhouden. Het is over het algemeen niet nodig dat je in deze file zelf wijzigingen aanbrengt.
  
 
'''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.
+
Dit is een tekstbestand met daarin de beschrijving van je form. Het wordt gebruikt om de resource file te genereren die in de initialisation sectie van againu.pas wordt ge-include. Delphi dfm-bestanden kunnen naar het Lazarus formaat worden omgezet met behulp van de Tools->Convert DFM file to LFM utility.
  
 
'''again.lrs:'''
 
'''again.lrs:'''
This is the generated resource file. Note that it is not a Windows resource file.
+
Dit is dan de door Lazarus gegenereerde en gebruikte resource-file. NB: Het is geen Windows resource file!
  
 
'''againu.pas:'''
 
'''againu.pas:'''
The unit that contains the code for the form.
+
Het bestand dat de broncode bevat van het formulier. Dit is dus het bestand dat je in de source editor bewerkt.
  
 
'''again.ppu:'''
 
'''again.ppu:'''
This is the compiled unit.
+
De gecompileerde versie van agianu.pas.
  
 
'''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.
+
Dit is een script dat er voor zorgt dat je programma gelinkt wordt zodat er een uitvoerbaar bestand ontstaat. Als dit laatste succesvol was wordt het automatisch verwijderd.
 
 
==Medewerkers en wijzigingen==
 
Dit is een vertaling van [[Lazarus Tutorial]]
 
 
 
Aanvang vertaling op 25 maart 2005 door [[User:Matthijs|Matthijs Willemstein]]
 

Latest revision as of 13:25, 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)

Inleiding

Lazarus is een "vrije" en opensourceontwikkelomgeving die gebruik maakt van de FreePascal Compiler (object pascal). De FreePascal Compiler is ook een open source project en "vrije software". De Lazarus Integrated Development Environment (IDE) is een stabiele en complete ontwikkelomgeving waarmee grafische en terminalprogramma's ontwikkeld kunnen worden. Lazarus draait onder Linux, FreeBSD, Windows, MAC-OS en ook op 64-bits platforms. Naast een instelbare code-editor heeft Lazarus ook een grafische tool voor het maken van de programmaschermen, alles volledig geïntegreerd met de FreePascal-compiler.

Het begin

(Thanks to User:Kirkpatc)

Je eerste Lazarus-programma

Download, installeer en start Lazarus. Voor een complete handleiding voor de installatie van Lazarus verwijzen we naar deze pagina, hier willen we alleen aantekenen dat bij de windows installer FPC automatisch geïnstalleerd wordt en dat je voor Linux FPC, de FPC-broncode en Lazarus apart moet installeren. Let hierbij dat de FPC versie past bij de gekozen Lazarus versie.

Nadat je Lazarus gestart hebt, zie je verschillende windows op je scherm: het hoofdmenu bovenin, de "Object Inspector" aan de linkerkant, de broncode-editor neemt het grootste deel van je scherm in, daar overheen zie je de basis voor je eerste scherm ("Form1").

Het scherm met het hoofdmenu bevat niet alleen een menu, maar ook een aantal knopjes en een rij met "tabs". Als de "Standard" tab nog niet geselecteerd is, doe dat dan door er op te klikken met de muis. Zoek dan de "Button" icon (een rechthoekje met 'OK' erop) en klik daarop. Klik daarna ergens links van het midden op het "Form1" scherm. Hierdoor zal er een rechthoek (een windowsknopje) verschijnen met de tekst 'Button1'. Klik nog eens op de "Button" icon op de "Standard" tab en daarna weer op "Form1" rechts van de eerste button. Er zal een tweede knop verschijnen, ditmaal met de tekst 'Button2'.

Klik nu op Button1 om deze te selecteren. In de Object Inspector worden de eigenschappen (properties) van de Button1 getoond. Bovenin de Object Inspector vind je de property 'Caption', deze heeft nu de waarde 'Button1'. Klik in dit vakje en wijzig de tekst in 'Press'. Als je nu op ENTER drukt of in een andere vakje klikt zul je zien dat de tekst op de knop nu wijzigt in 'Press'. Klik nu op de "Events" tab van de Object Inspector, hierdoor zie je een lijst van de verschillende Events waarop door de knop gereageerd kan worden. Deze Events bevatten onder meer OnClick, OnEnter, OnExit. (Events ontstaan als gevold van akties van de gebruiker van je programma. Wordt er op een knop geklikt dan wordt dus het OnClick event aangeroepen.) Klik in het vakje naast het OnClick, er verschijnen dan een knopje met een driehoekje en een knopje met een ellipsis (...). Als je op het ellipsis-knopje drukt, wordt er automatisch naar het editor scherm overgegaan en zal de cursor knipperen in een stukje code dat er als volgt uit ziet:

 procedure TForm1.Button1Click(Sender: TObject);
 begin
 
 end;

Type op de regel tussen begin en end het volgende:

 Button1.Caption := 'Press again'

Druk nu op F12 en je wordt weer terug gebracht naar het ontwerp van Form1.

Wijzig nu de properties van Button2 door er op te klikken en dan naar de Object Inspector te gaan. Wijzig het Caption property in 'Exit'. Ga dan naar de "Events" tab en klik op het vakje achter OnClick, klik dan op de ellipsis knop en je komt weer in het editor scherm. Wijzig de hierbij automatisch aangemaakte procedure zodat deze er als volgt uit ziet:

 procedure TForm1.Button2Click(Sender: TObject);
 begin
   Close;
 end;

Je hoeft dus alleen maar Close; in te typen.

Je bent nu klaar om je programma te compileren en uit te voeren. De makkelijkste manier is om van het 'Run'-menu de 'Run'-optie te kiezen, je kunt ook op F9 drukken of op het groene driehoekje klikken. In ieder geval zal je programma eerst gecompileerd worden en daarna gelinkt. Uiteindelijk zal je programma uitgevoerd worden, als tenminste alles is goed gegaan en er geen fouten in je code zaten.

Er zal nog een scherm verschijnen waarin allerlei meldingen van de compiler zullen verschijnen, maar uiteindelijk zal je scherm Form1 getoond worden (zonder alle puntjes, die je in de ontwerp fase ziet.) Dit is het "mainwindow" van je applicatie en het wacht op de dingen die komen gaan.

Klik eens op de knop met de tekst 'Press'. Als het goed is, zie je dat de tekst wijzigt in 'Press again'. Klik je er nog eens op, dan blijft de tekts 'Press again'!!

Klik nu op de knop met de tekst 'Exit'. Het scherm zal sluiten en daarmee wordt je programma afgesloten. Je komt weer in de IDE, waar het originele Form1 scherm weer te zien zal zijn met alle puntjes. Je kunt dan dus weer verder gaan met het wijzigen van je scherm en je programma.

Het is verstandig (en hopelijk niet te laat) om je werk op te slaan. Dit kun je doen door ctrl-shift-s te geven of in het 'Edit'-menu de keuze 'Save all' te maken. Maak er een gewoonte van om je werk regelmatig op te slaan, zodat je geen werk kunt verliezen!

Een kleine uitbreiding.

Heropen, indien nodig, je opgeslagen project. (Menu 'Project', keuze 'Open recent project') Klik in het "Form1" scherm op de "Press" knop (Button1) om het te selecteren. Ga naar op de Object Inspector en klik op het vakje achter het OnClick. Een klik op de ellipsis knop brengt je dan in de editor in de code van het OnClick event van deze knop. Wijzig de code zodat die er als volgt uitziet:

 procedure TForm1.Button1Click(Sender: TObject);
{We gebruiken hier het Tag property, die de waardes 0 of 1 krijgt.}
 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;

Sla je werk weer op, laat het opnieuw compileren en run je programma. Als je nu op de eerste knop drukt, zie je dat de tekst wisselt tussen 'Press' en 'Press again'.

The rest is up to you!

Tekst georiënteerde programma's.

Als je een console of tekst georiënteerd programma moet schrijven (bijvoorbeeld als je een basis cursus Pascal volgt, of voor een programma dat door een batch file wordt uitgevoerd), kun je ook Lazarus gebruiken om dit programma te bewerken, compileren en uit te voeren. Lazarus is dus ook een ideale tool om Pascal-programma's te schrijven. Zie Console Mode Pascal.

De Editor

De onderdelen van de Editor

Als je Lazarus opstart, verschijnen er een aantal losse van elkaar onafhankelijke of te wel 'floating' schermen op je desktop.

Het scherm aan de bovenkant van je desktop heeft als titel: Lazarus Editor vXXXXXX - project1. Hierbij wordt de serie X-en vervangen door het versie nummer van de Lazarus omgeving en zal project1 de naam weergeven van het project waar je op dat moment mee bezig bent. Dit scherm is het hoofdscherm en bevat het hoofdmenu en de componenten pallet.

Lazmain.jpg

Onder de titelbalk zien we het Hoofdmenu, met de gebruikelijke keuze als File, Edit, Search enzovoort. Daarnaast zijn er een aantal keuze specifiek voor Lazarus. Daaronder vinden we aan de linkerkant een aantal knopjes die een snelle en eenvoudige toegang geven tot een aantal belangrijke en veel gebruikte functies. Naast deze knopjes vinden we het componenten palet. Net zoals een schilder gebruik maakt van een palet om een kleur verf te kiezen, hebben we in Lazarus een pallet om een te gebruiken component te kiezen.

Onder dit hoofdscherm zie je aan de linkerkant de Object Inspector, en de Lazarus Source Editor aan de rechterkant. Er kan nog een ander kleiner scherm, genaamd Form1 zichtbaar zijn, dat over de Lazarus Source Editor scherm ligt. Als dit niet gelijk zichtbaar is, kun je het oproepen door op F12 te drukken. De F12 toets schakelt heen en weer tussen een formulier (form) en de bijbehorende code unit. Het formulier is de grafische interface van je programma.

Als je een nieuw project start zal er een standaard "Form" worden aangemaakt. Dit formulier is niet meer dan een kaal scherm met titelbalk en op dat scherm een matrix van puntjes die je helpen bij het positioneren van de verschillende componenten. De titelbalk bevat ook de gebruikelijke Minimalisatie-, Maximalisatie- en Sluitknopjes. Als je op het form klikt, zie je in de Object Inspector aan de linkerkant van je desktop de properties (eigenschappen) van het form.

Er zijn nog meer schermen die je zichtbaar kunt maken of die zichtbaar worden tijdens het werken: de Project Inspector, die gegevens laat zien over de bestanden die onderdeel zijn van het project; het Messages scherm, waarin compiler meldingen, foutmeldingen en voortgang rapportage getoond worden. Als je Lazarus opstart vanuit een terminal scherm, dan blijft dit zichtbaar en worden de compiler meldingen hierin ook weergegeven.

Het Hoofdmenu

For a detailed description of every menu item which is accessible from the Lazarus IDE Main Menu, please refer to the Main menu/nl page.

Het knoppenpaneel (Button bar)

Een kleine "toolbar" met een aantal knopjes, die veelgebruikte menukeuzes snel beschikbaar maken:

New unit, Open (met een drop-down lijst van onlangs geopende bestanden), Save, Save all, New Form, Toggle Form/Unit (Schakelen tussen de unit en het form), View Units, View Forms, Run, Pause, Step Into, Step over.

De Componenten Palet

Een toolbar met tabs waarop een groot aantal iconen die de componenten weergeven.

De verschillende componenten zijn functioneel gegroepeerd op de tabs. Aan de uiterste linker kant zie je op iedere tab een pijl, genaamd 'Selection Tool'.

Als je de muis boven een icon houdt verschijnt er een hint met de naam van het component. Je zult zien dat iedere naam begint met een 'T'. De 'T' staat voor 'Type' of eigenlijk 'Class'. In de volgende lijst van Componenten zie je links naar bestanden die beschrijvingen bevatten van de units waarin ze gevonden worden. Als je iets wilt weten van een bepaald component is het ook verstandig om te kijken naar het component waarvan het is afgeleid. Zo is bijvoorbeeld een TMaskEdit is afgeleid van TCustomMaskEdit.

TABS (de namen zijn over het algemeen veelzeggend genoeg.):

  • Standard: Veel gebruikte componenten: TMainMenu, TPopupMenu, TButton, TLabel, TEdit, TMemo, TToggleBox, TCheckBox, TRadioButton, TListBox, TComboBox, TScrollBar, TGroupBox, TStaticText, TRadioGroup, TCheckGroup, TPanel, TActionList
  • Additional: Regelmatig gebruikte componenten: TBitBtn, TSpeedButton, TImage, TShape, TBevel, TPaintBox, TNotebook, TLabeledEdit, TSplitter, TMaskEdit, TCheckListBox, TScrollBox, TApplicationProperties, TStringGrid, TDrawGrid, TPairSplitter
  • Common Controls: TTrackBar, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TUpDown, TPageControl, TImageList
  • Dialogs: TOpenDialog, TSaveDialog, TSelectDirectoryDialog, TColorDialog, TFontDialog, TOpenPictureDialog, TSavePictureDialog, TCalendarDialog, TCalculatorDialog

Een aantal veel gebruikte Dialoog procedures en functions zie je niet op de componenten palet, maar kunnen eenvoudig gebruikt worden met aanroep vanuit je eigen programma.

Bij de installatie van Lazarus zijn een aantal voorbeelden meegenomen, deze voorbeelden staan in de $LazarusPath/examples subdirectory. Veel van deze voorbeelden laten het gebruik van dialog en andere componenten zien zonder het gebruik van de IDE en de Componenten Palet, de gebruikte componenten worden expliciet gedefinieerd in het hoofd pascalunit. Andere voorbeelden maken weer wel gebruik van de IDE.

Waarschijnlijk zullen niet alle voorbeelden gelijk werken en zul je het een en ander moeten wijzigen aan toegangsrechten tot bestanden of directories. Het eenvoudigste is waarschijnlijk om de sources te kopieren naar een directory waar je volledige rechten hebt en van daaruit de projecten te compileren en runnen.

Kijk eens naar het 'testall' programma. Je kunt hiermee via de menukeuze Components bijna alle componenten aan het werk zien. Daarna kun je de source eens bestuderen om te zien hoe ze werken en hoe je ze kunt gebruiken.

  • Misc: TColorButton, TSpinEdit, TArrow, TCalendar, TEditButton, TFileNameEdit, TDirectoryEdit, TDateEdit, TCalcEdit, TFileListBox
  • Data Controls: Een aantal data-aware uitvoeringen van componenten die op the Standard en Additional tab staan: TDBNavigation, TDBText, TDBEdit, TDBMemo, TDBImage, TDBListBox,TDBComboBox, TDBCheckBox, TDBRadioGroup, TDBCalendar, TDBGroupBox, TdbGrid
  • Data Access: TDatasource
  • System: TTimer, TIdleTimer, TProcess
  • SynEdit: SynEdit bevat een set van componenten voor Delphi, Kylix, CB en Lazarus waaronder een edit control. Het ondersteunt Syntax Highlighting, Code Completion en heeft exportfuncties naar HTML, tex en RTF. Het is geen wrapper om een bestaand MS control maar een volledig losstaand component. Zie ook synedit op sourceforge. TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynMultiSyn

Om de componenten van de palet te gebruiken moet er natuurlijk een form zijn om ze op te plaatsen. Als er nog geen form is kun je via File -> New Form een nieuw formulier laten aanmaken. Klik dan op het icoontje van het component dat je wilt gebruiken en klik daarna op het formulier op de plek waar je het component ongeveer wilt hebben. Daarna kun je het met de muis op de juiste plaats slepen en de gewenste afmetingen geven. Deze aanpassingen kun je natuurlijk ook maken door de relevante properties in de Object Inspector te wijzigen.

Als je aanvullende componenten installeert (zelfgemaakte of uit een package van een andere bron) kunnen deze op nieuwe tab getoond worden. Deze kunnen dan op dezelfde wijze gebruikt worden als de standaardcomponenten. Zie Install Packages.

De Debugger

Moet nog geschreven worden.

De Lazarusbestanden

Een Lazarusproject voor een grafisch programma bestaat uit minimaal twee bestanden:

  xxx.pas (of xxx.pp) en yyy.lpr 

Eigenlijk worden er meer aangemaakt, maar dit zijn de bestanden die je een naam geeft. Het project bestand (lpr) en het unit bestand (pas of pp) mogen niet dezelfde naam hebben, omdat Lazarus de bijbehorende unit in de sources dezelfde naam zal geven.

Dus als je een project genaamd again opslaat, kun je de form unit niet meer als again.pas opslaan. Er zijn dan twee objecten met dezelfde naam. Dit kan niet en zal een "duplicate name" melding geven.

Uiteindelijk was dit mijn resultaat:

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

Zoals je ziet zijn het een paar meer dan je in eerste instantie dacht op te slaan.

Hieronder voor elk bestand een kleine beschrijving::

again.exe: Het uitvoerbare binaire bestand. Onder Windows zal het de ".exe"-extensie krijgen, onder Linux krijgt het geen extensie. In eerste instantie zullen deze bestanden erg groot zijn, omdat ze de volledige debug informatie bevatten. Met behulp van de "strip"-tooltje kan deze informatie verwijderd worden en zal het bestand aanzienlijk kleiner worden.

again.lpi: Dit is een bestand met informatie met betrekking tot je project, vergelijk baar met de .dsk file in Delphi. Het wordt opgeslagen in XML-formaat en bevat informatie over de plaats van de verschillende schermen, informatie over welke bestanden waren geopend in de editor, de cursorpositie in de verschillende bestanden, etc etc.

again.lpr: De broncode van het programma. Dit is een gewoon Pascal-bestand en wordt volledig door Lazarus onderhouden. Het is over het algemeen niet nodig dat je in deze file zelf wijzigingen aanbrengt.

againu.lfm: Dit is een tekstbestand met daarin de beschrijving van je form. Het wordt gebruikt om de resource file te genereren die in de initialisation sectie van againu.pas wordt ge-include. Delphi dfm-bestanden kunnen naar het Lazarus formaat worden omgezet met behulp van de Tools->Convert DFM file to LFM utility.

again.lrs: Dit is dan de door Lazarus gegenereerde en gebruikte resource-file. NB: Het is geen Windows resource file!

againu.pas: Het bestand dat de broncode bevat van het formulier. Dit is dus het bestand dat je in de source editor bewerkt.

again.ppu: De gecompileerde versie van agianu.pas.

ppas.bat: Dit is een script dat er voor zorgt dat je programma gelinkt wordt zodat er een uitvoerbaar bestand ontstaat. Als dit laatste succesvol was wordt het automatisch verwijderd.