Sign in Join
Wiki copytemporary

Lazarus Tutorial/fr: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Lazarus Tutorial/fr

OldNewLine
1+*Ceci est le début du Tutoriel Lazarus. N'hésitez pas à y ajouter vos expériences.*
2+
3+## Vue d'ensemble
4+
5+Lazarus est un outil de développement libre et open source dédié au compilateur FreePascal (Pascal objet). FreePascal est également libre et open source. L'environnement de Développement Intégré (EDI) Lazarus ([[Screenshots|capture d'écran en Anglais]]) est stable. Il a de nombreuses fonctionnalités pour créer des logiciels pouvant s'exécuter de façon autonome. Il fonctionne actuellement sous Linux, FreeBSD, Win32 et macOS. Lazarus fournit un éditeur de code source personnalisable, un environnement visuel de création de fiches, un gestionnaire de paquets, un débogueur et une interface graphique utilisateur (GUI) intégrée au compilateur FreePascal.
6+
7+## Prise en main
8+
9+(Merci à User:Kirkpatc)
10+
11+Téléchargez Lazarus dans la section 'Download' du [site officiel](http://www.lazarus.freepascal.org), [[Installing Lazarus/fr|installez-le]] et lancez-le.
12+
13+### Votre premier programme sous Lazarus !
14+
15+Plusieurs fenêtres apparaîtront sur le bureau : le menu principal en haut, l'inspecteur d'objet à gauche, l'éditeur de source de Lazarus, qui occupe la plus grande partie du bureau, et une fenêtre Form1 prête à être utilisée recouvrant l'éditeur de source.
16+
17+Sous le menu principal, vous trouverez plusieurs onglets. Si 'Standard' n'est pas déjà sélectionné, faites-le en cliquant dessus avec la souris et cherchez une icône représentant un bouton (un rectangle avec 'OK' marqué dessus), sélectionnez-le avec la souris. Ensuite cliquez sur la fenêtre 'Form1'. Un rectangle ayant pour texte 'Button1' apparaîtra. Cliquez une nouvelle fois sur l'icône du bouton dans l'onglet 'Standard', et cliquez de nouveau sur Form1 : un rectangle ayant pour texte 'Button2' apparaîtra.
18+
19+Maintenant cliquez sur 'Button1' pour le sélectionner. L'inspecteur d'objet affichera les propriétés de l'objet 'Button1'. Elles sont triées par ordre alphabétique, cherchez 'Caption' elle devrait afficher la valeur 'Button1'. Cliquez dessus et changez 'Button1' en 'Press'. Si vous appuyez sur la touche ENTREE de votre clavier ou cliquez ailleurs, vous verrez le libellé de votre premier bouton de 'Form1' se changer en 'Press'. Ensuite cliquez sur l'onglet 'Événements' de l'inspecteur d'objet, pour voir les différents événements pouvant être associés au bouton. Cela inclut OnClick, OnEnter, OnExit etc. À présent, cliquez sur le bouton à droite de 'OnClick' \[...\]. Lorsque vous le sélectionnez, vous êtes renvoyés automatiquement dans l'éditeur de source, et votre curseur directement à l'emplacement où le code doit être saisi :
20+
21+``` pascal
22+ procedure TForm1.Button1Click(Sender: TObject);
23+ begin
24+ {maintenant tapez :} Button1.caption := 'Press again';
25+ {L'éditeur a déjà complété la procédure }
26+ end;
27+```
28+
29+Appuyez sur F12 pour sélectionner Form1 au lieu de l'éditeur de source.
30+
31+Maintenant, éditez les propriétés de 'Button2' : cliquez sur 'Button2' pour afficher ses propriétés dans l'inspecteur d'objet. Changez la propriété 'Caption' en 'Exit' au lieu de 'Button2'. Maintenant, sélectionnez l'onglet 'Événements', et cliquez sur 'OnClick'. Cliquez ensuite sur le bouton figurant 3 points \[...\], une nouvelle procédure sera automatiquement déclarée et le curseur sera positionné directement dans le corps de celle-ci :
32+
33+``` pascal
34+ procedure TForm1.Button2Click(Sender: TObject);
35+ begin
36+ {maintenant tapez :} Close;
37+ {L'éditeur a déjà complété la procédure }
38+ end;
39+```
40+
41+Maintenant, appuyez sur F12 pour revoir la fenêtre 'Form1'. Vous êtes maintenant prêt à compiler votre programme. La méthode la plus simple est de sélectionner 'Exécuter' dans le menu principal en haut de l'écran, et l'option 'Exécuter' dans le sous menu. Vous pouvez aussi appuyer, tout simplement, sur la touche F9 de votre clavier. Cette manipulation compilera votre programme, et (si tout se passe bien) l'exécutera.
42+
43+La fenêtre de texte en dessous de l'éditeur de source affichera différentes sortes d'informations sur la compilation (information, alerte, erreur...). Quelques instant plus tard, 'Form1' va réapparaître, mais sans la grille de points qui permet de positionner les composants (boutons, zones de saisie) en mode conception. C'est le fenêtre principale de votre application, elle attend que vous cliquiez sur le bouton 'Press'.
44+
45+Essayez de cliquer sur le bouton 'Press'. Le libellé changera en 'Press again'. Si vous cliquez encore, le libellé continuera à afficher 'Press again' !
46+
47+Maintenant, cliquez sur le bouton marqué 'Exit'. La fenêtre se fermera et vous quitterez le programme. La fenêtre 'Form1' originale réapparaîtra en mode conception avec sa grille de points, prête à être modifiée de nouveau.
48+
49+A présent, vous devriez sauvegarder votre travail (faites-le souvent !) sélectionnez : Projet -\> Enregistrer le projet sous... et indiquez les noms de vos fichiers.
50+
51+ATTENTION : le nom de fichier de la "Unit" et du projet doivent être différents.
52+
53+### Deuxième session
54+
55+Rouvrez votre projet. Cliquez sur le bouton 'Press' (Button1) de la fenêtre 'Form1'. Sélectionnez l'onglet 'Évènements' dans l'inspecteur d'objet, cliquez sur le bouton près de 'OnClick' \[...\], pour retourner à l'emplacement approprié dans l'éditeur de source.
56+
57+Modifiez votre code de la manière suivante :
58+
59+``` pascal
60+ procedure TForm1.Button1Click(Sender: TObject);
61+ {Makes use of the Tag property, setting it to either 0 or 1}
62+ begin
63+ if Button1.tag = 0 then
64+ begin
65+ Button1.caption := 'Press again';
66+ Button1.tag := 1
67+ end else
68+ begin
69+ Button1.caption := 'Press';
70+ Button1.tag := 0
71+ end
72+ end;
73+```
74+
75+Sauvegardez votre travail, et compilez votre programme. Le bouton 'Press' basculera entre les deux messages ('Press' et 'Press again').
76+
77+Le reste dépend de vous !
78+
79+Si vous préférez programmer en mode console (ou mode texte), par exemple si vous apprenez les bases du Pascal, ou que vous ayez besoin d'un programme de traitement par lots (batch) ou encore que vous souhaitiez faire de la programmation système, vous pouvez conserver Lazarus pour éditer, compiler et exécuter votre programme. Il constitue un environnement idéal pour le développement en Pascal. Voir [[Console Mode Pascal]].
80+
81+## L'éditeur
82+
83+Lorsque vous lancez Lazarus, une série de fenêtres flottantes apparaît.
84+
85+La fenêtre principale en haut de l'écran est titrée **Editeur Lazarus vXXXXXX - project1** (les X correspondent au numéro de la version de Lazarus installée sur votre machine). C'est une fenêtre importante de votre projet, elle contient le menu principal et la palette de composants.
86+
87+<center>
88+
89+<figure>
90+<img src="Lazmainfr.jpg" title="Lazmainfr.jpg" />
91+<figcaption>Lazmainfr.jpg</figcaption>
92+</figure>
93+
94+</center>
95+
96+Sur la ligne juste en dessous du titre se trouve le "Menu principal" avec les entrées habituelles : Fichier, Edition, Chercher, Voir... et d'autres qui correspondent à des fonctions spécifiques à Lazarus. En dessous à gauche vous trouverez un jeu de "BitButtons" qui vous permettrons d'accéder aux fonctions les plus courantes. A droite se trouve la palette de composants.
97+
98+En dessous de la fenêtre de l'éditeur apparaît, à gauche de l'écran, la fenêtre de l**'[inspecteur d'objet](http://lazarus-ccr.sourceforge.net/kbdata/objinsp.jpg)**, et l**'[éditeur de source de Lazarus](http://lazarus-ccr.sourceforge.net/kbdata/editor.jpg)**. Il peut également y avoir une fenêtre plus petite, appelée **[Form1](http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg)**, recouvrant l'éditeur de source de Lazarus. Si 'Form1' n'est pas visible immédiatement, vous pouvez la faire apparaître en pressant **F12**, qui basculera de l'éditeur de source au formulaire correspondant à l'unité en cours, et inversement. La fenêtre de conception de formulaire et l'un des outils que vous utiliserez le plus fréquemment pour mettre en place une interface utilisateur pour votre application. Ce qu'il est possible de faire dans l'inspecteur d'objet est décrit plus en détail dans la section : Palette de composants.
99+
100+Lorsque vous démarrez un nouveau projet, ou que vous lancez Lazarus pour la première fois, un formulaire par défaut apparaît. Ce formulaire consiste en une "boîte" contenant une grille de points qui vous aiderons à positionner les différents composants, une barre au sommet de la fenêtre contient les boutons habituels **Réduire**, **Agrandir** et **Fermer**. Si vous cliquez avec le curseur de la souris à l'endroit que vous voulez dans la boîte, vous verrez les propriétés du formulaire s'afficher dans l'inspecteur d'objet à gauche de l'écran.
101+
102+D'autres fenêtres peuvent êtres affichées pendant votre travail : l**'[inspecteur de projet](http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg)** contient les détails des fichiers inclus dans votre projet, et vous permet également d'en rajouter ou d'en supprimer. La fenêtre de **Messages**, affiche les informations de compilation, les erreurs ou les rapports d'avancement ; si Lazarus est lancé depuis une fenêtre de terminal, le terminal original reste toujours visible et affiche également des messages de compilation.
103+
104+### Menu principal
105+
106+Le menu principal contient les entrées suivantes : <u>F</u>ichier <u>E</u>dition <u>C</u>ercher <u>V</u>oir <u>P</u>roject <u>E</u>xécuter <u>C</u>omposants <u>O</u>utils <u>C</u>onfiguration <u>F</u>enêtres <u>A</u>ide
107+
108+Comme d'habitude, les options peuvent êtres sélectionnées soit en cliquant directement dessus à l'aide du bouton gauche de la souris, soit en tapant au clavier : Alt, la lettre correspondante au menu voulu (par exemple F), Entrée.
109+
110+Pour plus de détails consultez [[Main menu/fr]].
111+
112+### La barre de boutons
113+
114+C'est une barre d'outil à gauche de la fenêtre d'édition principale, juste au-dessous du menu principal et à gauche de la palette de composants, elle contient un jeu de boutons appelant les fonctions les plus fréquemment utilisées dans le menu :
115+
116+
117+**Nouvelle unité**, **Ouvrir** (avec une flèche pointant vers le bas, affichant une liste des fichiers récemment utilisés), **Enregistrer**, **Tout enregistrer**, **Nouvelle fiche**, **Commutation Fiche/Unité** (i.e. affiche la fiche ou le code source de l'unité), **Afficher les unités**, **Afficher les fiches**, **Exécuter** (i.e. compile et exécute), **Pause**, **Pas à pas approfondi**, **Pas à pas** (les deux derniers sont des fonctions de débogage).
118+
119+## La palette de composants
120+
121+La barre d'outils à onglets affiche un large choix d'icônes représentant les composants les plus courants pour la conception de formulaires.
122+
123+Chaque onglet affiche un jeu d'icônes, correspondant aux fonctionnalités du groupe de composants. L'icône la plus à gauche, figurant une flèche, est appelée outil de sélection.
124+
125+Si vous placez le pointeur de la souris sur l'une des icônes sans cliquer dessus, sont nom s'affichera. Notez que chaque nom commence par un 'T', ce qui signifie 'Type' ou plus précisément 'Class' de composant. Lorsque vous sélectionnez un composant pour l'intégrer dans un formulaire, la classe est ajoutée dans la section **type** de la partie **interface** de l'unité (habituellement en tant que partie de TForm1), et une instance de cette classe est ajoutée dans la section **var** (habituellement de la même manière que la variable Form1). Chaque **méthode** que vous écrivez pour être utilisée par le formulaire ou ses composants (i.e. Procédures ou Fonctions) sera placée dans la partie **implementation** de l'unité.
126+
127+Dans la liste suivante, vous trouverez des liens vers les fichiers qui contiennent la description de ses composants. Si vous souhaitez trouver les propriétés d'un composant en particulier, il peut être utile d'étudier le composant duquel il est dérivé (son parent). Par exemple, pour comprendre TMaskEdit, il est également utile d'examiner TCustomMaskEdit.
128+
129+**ONGLETS** (les noms sont largement explicites) :
130+
131+- **Standard**
132+
133+<center>
134+
135+<figure>
136+<img src="Component_Palette_Standart.png" title="Component_Palette_Standart.png" />
137+<figcaption>Component_Palette_Standart.png</figcaption>
138+</figure>
139+
140+</center>
141+
142+
143+*Les composants fréquemment utilisés :*
144+
145+[TMainMenu](http://lazarus-ccr.sourceforge.net/docs/lcl/menus/tmainmenu.html), [TPopupMenu](http://lazarus-ccr.sourceforge.net/docs/lcl/menus/tpopupmenu.html), [TButton](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tbutton.html), [TLabel](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tlabel.html), [TEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tedit.html), [TMemo](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tmemo.html), [TToggleBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/ttogglebox.html), [TCheckBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tcheckbox.html), [TRadioButton](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tradiobutton.html), [TListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tlistbox.html), [TComboBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tcombobox.html), [TScrollBar](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tscrollbar.html), [TGroupBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tgroupbox.html), [TRadioGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tradiogroup.html), [TCheckGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tcheckgroup.html), [TPanel](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tpanel.html), [TActionList](http://lazarus-ccr.sourceforge.net/docs/lcl/actnlist/tactionlist.html)
146+
147+- **Additional**
148+
149+<center>
150+
151+<figure>
152+<img src="Component_Palette_Additional.png" title="Component_Palette_Additional.png" />
153+<figcaption>Component_Palette_Additional.png</figcaption>
154+</figure>
155+
156+</center>
157+
158+
159+*Des composants souvent utilisés en complément :*
160+
161+[TBitBtn](http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tbitbtn.html), [TSpeedButton](http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tspeedbutton.html), [TStaticText](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tstatictext.html), [TImage](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/timage.html), [TShape](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tshape.html), [TBevel](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tbevel.html), [TPaintBox](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tpaintbox.html), [TNotebook](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tnotebook.html), [TLabeledEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tlabelededit.html), [TSplitter](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tsplitter.html), [TCheckListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/checklst/tchecklistbox.html), [TScrollBox](http://lazarus-ccr.sourceforge.net/index.php?wiki=FormsTxt#TScrollBox), [TApplicationProperties](http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tapplicationproperties.html), [TStringGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/grids/tstringgrid.html), [TDrawGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/grids/tdrawgrid.html), [TPairSplitter](http://lazarus-ccr.sourceforge.net/docs/lcl/pairsplitter/tpairsplitter.html), [TColorBox](http://lazarus-ccr.sourceforge.net/docs/lcl/colorbox/tcolorbox.html), [TColorListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/colorbox/tcolorlistbox.html), TChart
162+
163+- **Common Controls**
164+
165+<center>
166+
167+<figure>
168+<img src="Component_Palette_Common_Controls.png" title="Component_Palette_Common_Controls.png" />
169+<figcaption>Component_Palette_Common_Controls.png</figcaption>
170+</figure>
171+
172+</center>
173+
174+
175+[TTrackBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttrackbar.html), [TProgressBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tprogressbar.html), [TTreeView](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreeview.html), [TListView](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tlistview.html), [TStatusBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tstatusbar.html), [TToolBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttoolbar.html), [TUpDown](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tupdown.html), [TPageControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tpagecontrol.html), [TTabControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttabcontrol.html), [THeaderControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/theadercontrol.html), [TImageList](http://lazarus-ccr.sourceforge.net/docs/lcl/controls/timagelist.html)
176+
177+- **Dialogs**
178+
179+<center>
180+
181+<figure>
182+<img src="Component_Palette_Dialogs.png" title="Component_Palette_Dialogs.png" />
183+<figcaption>Component_Palette_Dialogs.png</figcaption>
184+</figure>
185+
186+</center>
187+
188+
189+[TOpenDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/topendialog.html), [TSaveDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tsavedialog.html), [TSelectDirectoryDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tselectdirectorydialog.html), [TColorDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcolordialog.html), [TFontDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tfontdialog.html), [TfindDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tfinddialog.html), [TReplaceDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/treplacedialog.html), [TOpenPictureDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/topenpicturedialog.html), [TSavePictureDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tsavepicturedialog.html), [TCalendarDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tcalendardialog.html), [TCalculatorDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tcalculatordialog.html), TPrinterSetupDialog, TPrintDialog, TPageSetupDialog
190+
191+Beaucoup de procédures ou de fonctions utiles comme les [[Dialog Examples/fr|boîtes de dialogue]] n'apparaissent pas directement dans la palette de composants, mais peuvent être facilement appelées dans le code source du programme.
192+
193+Pour quelques bons exemples sur l'utilisation des composants, voir le sous-répertoire \$LazarusPath/lazarus/examples de votre installation. Beaucoup de ces programmes montrent comment utiliser les boîtes de dialogue et d'autres composants directement sans utiliser l'EDI et la palette de composants, ou des définition de fichier séparés : tous les composants sont complets et explicitement définis dans le programme Pascal principal. D'autres exemples de programmes utilisent pleinement l'EDI.
194+
195+Certains exemples ne fonctionnent pas immédiatement : vous pourriez avoir besoin de modifier les chemins et les permissions des fichiers des répertoires. Si vous souhaitez compiler quelques exemples, faites attention à avoir les permissions de lecture/écriture/exécution pour les fichiers et les répertoires, ou copiez les fichiers dans un répertoire sur lequel vous avez les permissions appropriées.
196+
197+Essayez d'exécuter le programme 'testall' pour voir un menu des composants disponibles ainsi que de petits exemples de formulaires de test pour la plupart d'entre eux ; ensuite inspectez le code pour comprendre comment ils fonctionnent !
198+
199+- **Misc**
200+
201+<center>
202+
203+<figure>
204+<img src="Component_Palette_Misc.png" title="Component_Palette_Misc.png" />
205+<figcaption>Component_Palette_Misc.png</figcaption>
206+</figure>
207+
208+</center>
209+
210+
211+[TColorButton](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcolorbutton.html), [TSpinEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/spin/tspinedit.html), [TFloatSpinEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/spin/tfloatspinedit.html), [TArrow](http://lazarus-ccr.sourceforge.net/docs/lcl/arrow/tarrow.html), [TCalendar](http://lazarus-ccr.sourceforge.net/docs/lcl/calendar/tcalendar.html), [TEditButton](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/teditbutton.html), [TFileNameEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tfilenameedit.html), [TDirectoryEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tdirectoryedit.html), [TDateEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tdateedit.html), [TCalcEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tcalcedit.html), [TFileListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/filectrl/tfilelistbox.html), [TXMLPropStorage](http://lazarus-ccr.sourceforge.net/docs/lcl/xmlpropstorage/txmlpropstorage.html), [TIniPropStorage](http://lazarus-ccr.sourceforge.net/docs/lcl/inipropstorage/tinipropstorage.html), [TbarChart](http://lazarus-ccr.sourceforge.net/docs/lcl/chart/tbarchart.html), [TButtonPanel](http://lazarus-ccr.sourceforge.net/docs/lcl/buttonpanel/tbuttonpanel.html), TIDEDialogLayoutStorage
212+
213+- **Data Controls**
214+
215+<center>
216+
217+<figure>
218+<img src="Component_Palette_DataControls.png" title="Component_Palette_DataControls.png" />
219+<figcaption>Component_Palette_DataControls.png</figcaption>
220+</figure>
221+
222+</center>
223+
224+
225+*Composants orientés données, qui copient très largement les groupes Standard et Additionnel mais sont applicables aux bases de données :* [TDBNavigator](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcustomnavigator.html), [TDBText](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbtext.html), [TDBEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbedit.html), [TDBMemo](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbmemo.html), [TDBImage](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbimage.html), [TDBListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdblistbox.html),[TDBComboBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcombobox.html), [TDBCheckBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcheckbox.html), [TDBRadioGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbradiogroup.html), [TDBCalendar](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcalendar.html), [TDBGroupBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbgroupbox.html), [TdbGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/dbgrids/tdbgrid.html)
226+
227+- **Data Access**
228+
229+<center>
230+
231+<figure>
232+<img src="Component_Palette_DataAccess.png" title="Component_Palette_DataAccess.png" />
233+<figcaption>Component_Palette_DataAccess.png</figcaption>
234+</figure>
235+
236+</center>
237+
238+
239+TDatasource, TMemDataset (Package MemDSLaz), TSdfDataSet (Package SDFLaz), TFixedFormatDataSet (Package SDFLaz), TDbf (Package DBFLaz)
240+
241+- **System**
242+
243+<center>
244+
245+<figure>
246+<img src="Component_Palette_System.png" title="Component_Palette_System.png" />
247+<figcaption>Component_Palette_System.png</figcaption>
248+</figure>
249+
250+</center>
251+
252+
253+[TTimer](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/ttimer.html), [TIdleTimer](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tidletimer.html), [TLazComponentQueue](http://lazarus-ccr.sourceforge.net/docs/lcl/lresources/tlazcomponentqueue.html), [THTMLHelpDatabase](http://lazarus-ccr.sourceforge.net/docs/lcl/lazhelphtml/thtmlhelpdatabase.html), [THTMLBrowserHelpViewer](http://lazarus-ccr.sourceforge.net/docs/lcl/lazhelphtml/thtmlbrowserhelpviewer.html), TProcess, TSimpleIPCClient, TSimpleIPCServer, TXMLConfig
254+
255+- **SynEdit**
256+
257+<center>
258+
259+<figure>
260+<img src="Component_Palette_SynEdit.png" title="Component_Palette_SynEdit.png" />
261+<figcaption>Component_Palette_SynEdit.png</figcaption>
262+</figure>
263+
264+</center>
265+
266+
267+*Un groupe de composants pour aider à interfacer d'autres langage et outils logiciels. SynEdit est un puissant composant d'édition multiligne, pour Borland Delphi, Kylix et C++ Builder. Il supporte la coloration syntaxique et la complétion de code, et il inclut l'export aux formats html, tex et rtf. C'est un contrôle VCL/CLX à part entière, ce qui signifie qu'il n'encapsule pas un contrôle Microsoft Windows, et qu'aucune bibliothèque d'exécution n'est requise ; cela fait de SynEdit un composant multi-plateforme. La compatiblité avec FreePascal est également prévue, et SynEdit est le composant d'édition dans l'EDI Lazarus.* voir [synedit sur sourceforge](http://synedit.sourceforge.net).
268+
269+TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynPythonSyn, TSynAnySyn, TSynMultiSyn
270+
271+### Comment utiliser la Palette
272+
273+Pour utiliser une palette, il faut afficher une fiche dans l'éditeur (s'il n'y en a pas, sélectionnez Fichier -\> Nouvelle fiche). Cliquez sur l'icône du composant que vous souhaitez utiliser dans l'onglet approprié de la palette, et cliquez sur la fiche, vous verrez le composant apparaître. À ce moment là, vous pourrez le sélectionner à l'aide de la souris, et le déplacer à l'endroit que vous souhaitez sur la fiche et ajuster sa taille. Les ajustements peuvent être effectués directement sur l'image du composant sur la fiche ou en modifiant ses propriétés dans l'éditeur d'objet.
274+
275+Si vous installez des composants additionnels, que ce soit des composants que vous avez vous-même écrits, ou des paquets provenant d'autre sources, de nouveaux onglets apparaîtront dans la palette de composants. Ces nouveaux composants peuvent être sélectionnés et utilisés sur vos fiches de la même manière que ceux fournis par défaut.
276+
277+## Comment utiliser les contrôles *Standard*, *Common* et étendus
278+
279+Les Unités <i>StdCtrls</i>, <i>ComCtrls</i> et <i>ExtCtrls</i> contiennent les définitions et les descriptions de beaucoup des contrôles les plus fréquemment utilisés pour la construction de fiches et d'autres objets dans les applications Lazarus.
280+
281+De nombreux contrôles finaux utilisés par les développeurs, tels que <i>TButton</i>, <i>TMemo</i>, <i>TScrollBar</i> etc., correspondent à une classe ancêtre comme, respectivement, <i>TCustomButton</i>, <i>TCustomMemo</i> ou <i>TCustomScrollBar</i>. Plusieurs propriétés et méthodes relatives au contrôle final sont définies (et expliquées) plus complètement dans la classe <i>TCustomXXX</i>, le contrôle final en <b>héritant</b>.
282+
283+Si vous déposez un composant dans l'éditeur de fiche, vous n'avez pas besoin d'ajouter de code pour le créer. Le composant est automatiquement généré par l'EDI, ainsi que la fiche, et détruit lorsque la fiche est détruite.
284+
285+Cependant, si vous créez un composant vous-même par programmation, n'oubliez pas de le libérer lorsqu'il n'est plus utilisé.
286+
287+Si vous placez un composant dans l'éditeur de fiche et que vous regardez dans l'inspecteur d'objets, vous pourrez observer les propriétés changer en même temps que vous déplacez le composant.
288+
289+Par exemple placez un bouton (TButton) sur le formulaire, cliquez dessus pour le sélectionner, puis déplacez-le avec la souris. Vous verrez alors les valeurs Top et Left changer au fur et à mesure dans l'inspecteur d'objets pour refléter sa position. Si vous utilisez les poignées de redimensionnement du bouton pour modifier sa taille, vous verrrez les propriétés Height et Width changer de la même façon.
290+
291+Inversement, vous pouvez saisir dans l'inspecteur d'objets une valeur associée à une propriété, par exemple la hauteur (Height); vous verrez la taille de l'objet sur le formulaire changer pour correspondre à cette valeur.
292+
293+You can also explicitly change the properties of the object in code by typing (in the appropriate Implementation section of the Source editor), for example
294+
295+`         ``Form1.Button1.Height := 48;`\
296+`         `
297+
298+If you type this new value into the Source Editor and then look back at the Form Designer, you will see that the button on the Form has taken the new size. The new value will also be shown in the Object Inspector.
299+
300+En résumé, il existe généralement trois méthodes différentes pour déterminer chaque propriété d'un objet:
301+
302+- en utilisant la souris ;
303+- en définissant les valeurs dans l'inspecteur d'objets;
304+- ou explicitement en écrivant du code.
305+
306+La plupart des composants définis dans ces unités ont plusieurs propriétés communes ; d'autres sont spécifiques aux composants individuels. Nous décrirons ici les plus courantes. Des propriétés inhabituelles ou spécifiques à un contrôle seront décrites pour les contrôles individuels.
307+
308+De l'aide peut être obtenue en sélectionnant une propriété ou un mot clé, (dans l'inspecteur d'objet ou dans l'éditeur de source), puis en pressant <span class="kbd">F1</span>. La page correspondante s'ouvrira alors.
309+
310+If the description of a property on that page is insufficient, you can navigate to the corresponding description in the ancestor classes, by selecting the links in the Inheritance listing or by selecting the ancestor Type in the declaration of the object.
311+
312+`           `<i>`Constructors`</i>
313+
314+`such as `<i>`Create`</i>` allocate memory and system resources needed by the object. They also call the constructor of any sub-objects present in the class.`
315+
316+`           `<i>`Destructors:`</i>
317+
318+`remove the object and de-allocate memory and other resources. If you call `<i>`Destroy`</i>` for an object which hasn't being initialized yet it will generate an error. Always use the `<i>`Free`</i>` method to deallocate objects, because it checks whether an object's value is `<b>`nil`</b>` before invoking `<i>`Destroy`</i>`.`
319+
320+Take the following precautions when creating your own <i>Destroy</i> method:
321+
322+- Declare <i>Destroy</i> with the <b>override</b> directive, because it is a <b>virtual</b> method.
323+- Always call '<i>inherited Destroy;</i>' as the last thing on the destructor code.
324+- Be aware that an <i>exception</i> may be raised on the <i>constructor</i> in case there is not enought memory to create an object, or something else goes wrong. If the <i>exception</i> is not handled inside the constructor, the object will be only partially built. In this case <i>Destroy</i> will be called when you weren't expecting it, so your destructor must check if the resources were really allocated before disposing of them.
325+- Remember to call <i>Free</i> for all objects created on the constructor.
326+
327+\
328+
329+<table>
330+
331+<caption>
332+
333+<b>Some commonly listed properties</b>
334+
335+</caption>
336+
337+<tr>
338+
339+<td>
340+
341+<b>Property</b>
342+
343+</td>
344+
345+<td>
346+
347+<b>Meaning</b>
348+
349+</td>
350+
351+</tr>
352+
353+<tr>
354+
355+<td>
356+
357+Action
358+
359+</td>
360+
361+<td>
362+
363+The main action or event associated with the object. For example selecting an 'Exit' Button might cause the 'Close' action
364+
365+</td>
366+
367+</tr>
368+
369+<tr>
370+
371+<td>
372+
373+Align
374+
375+</td>
376+
377+<td>
378+
379+Defines the way in which an object is to be lined up with the parent object. Possible values are alTop (placed at the top and using the full available width), alBottom, alLeft (placed at the left and using the full available height), alRight. alNone (place anywhere on parent control) or alClient (takes all available space next to controls aligned to top, bottom, left or right)
380+
381+</td>
382+
383+</tr>
384+
385+<tr>
386+
387+<td>
388+
389+Anchor
390+
391+</td>
392+
393+<td>
394+
395+Used to keep a control a certain distance from the defined edges of a parent control, when the parent is resized. For example <b>\[akBottom, akRight\]</b> will keep the control a fixed distance from the bottom right corner.
396+
397+</td>
398+
399+</tr>
400+
401+<tr>
402+
403+<td>
404+
405+AutoSelect
406+
407+</td>
408+
409+<td>
410+
411+When True, an editing control will select all its text when it receives focus or when the Enter key is pressed.
412+
413+</td>
414+
415+</tr>
416+
417+<tr>
418+
419+<td>
420+
421+AutoSelected
422+
423+</td>
424+
425+<td>
426+
427+True indicate that the edit or combobox control has just performed an AutoSelect operation so that subsequent mouse-clicks and keystrokes proceed normally without selecting the text.
428+
429+</td>
430+
431+</tr>
432+
433+<tr>
434+
435+<td>
436+
437+BorderSpacing
438+
439+</td>
440+
441+<td>
442+
443+The space around the edge between an <i>Anchored</i> control and its parent.
444+
445+</td>
446+
447+</tr>
448+
449+<tr>
450+
451+<td>
452+
453+Caption
454+
455+</td>
456+
457+<td>
458+
459+The text that is displayed on or near the control; it should preferably give some clue as to the function of the control, or an instruction such as 'Close' or 'Execute'. By default Caption is set to be the same as the 'Name' property, and the application programmer should substitute meaningful text instead of the default values.
460+
461+</td>
462+
463+</tr>
464+
465+<tr>
466+
467+<td>
468+
469+CharCase
470+
471+</td>
472+
473+<td>
474+
475+Indicates how text is displayed in a text editing control: Normal (retaining the case of the letters typed by the user), converted to uppercase, or converted to lowercase
476+
477+</td>
478+
479+</tr>
480+
481+<tr>
482+
483+<td>
484+
485+Constraints
486+
487+</td>
488+
489+<td>
490+
491+Sets the minimum and maximum sizes for a control. If a control is resized the new dimensions are always within the ranges given here. You should take care when setting these options that they do not conflict with the Anchors and Align settings.
492+
493+</td>
494+
495+</tr>
496+
497+<tr>
498+
499+<td>
500+
501+Color
502+
503+</td>
504+
505+<td>
506+
507+The Colour to be used to draw the control or to write the text it contains.
508+
509+</td>
510+
511+</tr>
512+
513+<tr>
514+
515+<td>
516+
517+Enabled
518+
519+</td>
520+
521+<td>
522+
523+A Boolean property to determine whether or not a control is capable of being selected and performing an action. If it is not <i>Enabled</i>, it is often <b>Grayed</b> out on the Form.
524+
525+</td>
526+
527+</tr>
528+
529+<tr>
530+
531+<td>
532+
533+Font
534+
535+</td>
536+
537+<td>
538+
539+The Font to be used for writing the text associated with the control - either the caption or label, or the text-strings contained within the control. The entry on the Object Inspector usually has a (+) box on the left, and selecting this box reveals further options such as character set, colour and size.
540+
541+</td>
542+
543+</tr>
544+
545+<tr>
546+
547+<td>
548+
549+Hint
550+
551+</td>
552+
553+<td>
554+
555+A short piece of informative pop-up text that appears if the mouse-cursor hovers over the control.
556+
557+</td>
558+
559+</tr>
560+
561+<tr>
562+
563+<td>
564+
565+Items
566+
567+</td>
568+
569+<td>
570+
571+The list of 'Things' that the object contains, such as a group of images, a series of lines of text, a number of actions in an actionlist, etc
572+
573+</td>
574+
575+</tr>
576+
577+<tr>
578+
579+<td>
580+
581+Lines
582+
583+</td>
584+
585+<td>
586+
587+An array of strings, containing the textual data in controls with more than a single line of data, such as an Edit-Box or a Combo-Box. The array is zero-indexed, ie the lines are numbered \[0..numLines-1\]
588+
589+</td>
590+
591+</tr>
592+
593+<tr>
594+
595+<td>
596+
597+Name
598+
599+</td>
600+
601+<td>
602+
603+The identifier by which the control is known in the program. The IDE gives it a default name based on the underlying type, for example successive instances of TBitButton would be named Form1.BitBitton1 and Form1.BitButton2; it is up to the application programmer to give them more meaningful names such as ExitButton or OKButton. By default the Name of the control is applied to the Caption for the control, but the text of the Caption may be changed separately.
604+
605+</td>
606+
607+</tr>
608+
609+<tr>
610+
611+<td>
612+
613+PopUpMenu
614+
615+</td>
616+
617+<td>
618+
619+A window containing context-sensitive menu information that pops up when the right mouse button is clicked on the object.
620+
621+</td>
622+
623+</tr>
624+
625+<tr>
626+
627+<td>
628+
629+Position (or Top, Left)
630+
631+</td>
632+
633+<td>
634+
635+Determines where the control is located on the parent form or window
636+
637+</td>
638+
639+</tr>
640+
641+<tr>
642+
643+<td>
644+
645+ReadOnly
646+
647+</td>
648+
649+<td>
650+
651+Boolean property which, if True, signifies that the contents of the control can be read by the user or the calling routine, but cannot be written or changed.
652+
653+</td>
654+
655+</tr>
656+
657+<tr>
658+
659+<td>
660+
661+ShowHint
662+
663+</td>
664+
665+<td>
666+
667+Allows a small window containing a context-sensitive Help or other description to be displayed when the mouse cursor 'hovers' over the control.
668+
669+</td>
670+
671+</tr>
672+
673+<tr>
674+
675+<td>
676+
677+Size (or Height and Width)
678+
679+</td>
680+
681+<td>
682+
683+The dimensions of the control
684+
685+</td>
686+
687+</tr>
688+
689+<tr>
690+
691+<td>
692+
693+Style
694+
695+</td>
696+
697+<td>
698+
699+The options available for Style depend upon the sort of Control being considered: for instance the Style may be defined by TFormStyle, TBorderStyle, TButtonStyle etc.
700+
701+</td>
702+
703+</tr>
704+
705+<tr>
706+
707+<td>
708+
709+TabOrder
710+
711+</td>
712+
713+<td>
714+
715+Integer defining where in the sequence of tabs on the Form this control is to lie
716+
717+</td>
718+
719+</tr>
720+
721+<tr>
722+
723+<td>
724+
725+TabStop
726+
727+</td>
728+
729+<td>
730+
731+Boolean property which if True places this control in the sequence of objects that the user can reach by successively pressing the Tab key
732+
733+</td>
734+
735+</tr>
736+
737+<tr>
738+
739+<td>
740+
741+Text
742+
743+</td>
744+
745+<td>
746+
747+The String of Text that represents the actual data that this control contains. Applies particularly to Text, Memo and StringList types of object. Most of the editing operations (such as <i>Select</i>, <i>Clear</i>, <i>Cut</i>, <i>Copy</i>) are performed in this part of the object, which holds the actual string being edited. If the control contains more than a single line of text, for example <i>TMemo</i> or <i>TComboBox</i>, then the textual elements are arranged as an array of strings (zero-indexed, ie numbered from \[0..numLines-1\]) in <i>Lines</i>.
748+
749+</td>
750+
751+</tr>
752+
753+<tr>
754+
755+<td>
756+
757+Visible
758+
759+</td>
760+
761+<td>
762+
763+If true, the object can be seen on the Form; if False, object is hidden
764+
765+</td>
766+
767+</tr>
768+
769+<tr>
770+
771+<td>
772+
773+WordWrap
774+
775+</td>
776+
777+<td>
778+
779+Logical flag to show whether or not word-wrap is enabled, ie if a word comes close to the end of a line and is going to be too long for the line, it is wrapped down to the next line.
780+
781+</td>
782+
783+</tr>
784+
785+</table>
786+
787+Many actions are commonly listed in the 'Events' tab of the Object Inspector. If you select an entry in the list, a ComboBox appears with a DropDown list showing any actions that have aleady been defined, and allowing you to choose one to be associated with this event. Alternatively you can select the ellipsis (three dots ...) and you will be taken to an area of the Source Editor where you can begin typing your own action instructions for the selected event.
788+
789+While a large number of events is available for any given control, in practice it is only necessary to populate a few of them. For most controls, it is sufficient to provide coding for 'OnClick'; for more complex controls it may be necessary also to provide for 'OnEntry' (when the mouse cursor enters the Control and gives it focus) and 'OnExit' (when the mouse cursor leaves the Control; or you may need to write an event handler for 'OnChange' or 'OnScroll', depending on the nature of the particular control with which you are dealing.
790+
791+The pop-up menu that appears when you right-click an object in the Form Designer has, as its first item: 'Create default event' and selecting this option will have the same effect as selecting the ellipsis in the Object Inspector for the default event, usually OnClick: you are taken to the Implementation area of the Source Editor where you can type the code for the event handler.
792+
793+A common strategy in Object-Oriented programming is to provide an <i>ActionList</i> with the facility for entering, removing or editing a number of pre-defined actions from which the most appropriate can be selected to use in any particular instance.
794+
795+\
796+
797+<table>
798+
799+<caption>
800+
801+<b>Some commonly listed Actions</b>
802+
803+</caption>
804+
805+<tr>
806+
807+<td>
808+
809+<b>Action</b>
810+
811+</td>
812+
813+<td>
814+
815+<b>Meaning</b>
816+
817+</td>
818+
819+<tr>
820+
821+<td>
822+
823+OnChange
824+
825+</td>
826+
827+<td>
828+
829+Action to be taken if any change is detected (eg mouse move, mouse click, key press, edit text, alter picture, etc)
830+
831+</td>
832+
833+</tr>
834+
835+<tr>
836+
837+<td>
838+
839+OnClick
840+
841+</td>
842+
843+<td>
844+
845+Action to be taken when the (left) mouse button is clicked. This is usually the main or default action of the control; for example clicking on a button or checkbox initiates the action associated with the checkbox. It may alternatively initate a process of selection, for instance in a TextBox or Memo, or signal the beginning of painting with a Pen or Brush.
846+
847+</td>
848+
849+</tr>
850+
851+<tr>
852+
853+<td>
854+
855+Click
856+
857+</td>
858+
859+<td>
860+
861+A method to emulate in code the effect of clicking on a control. This method is most often found in Button-type controls (TButton, TBitBtn, TSpeedButton etc). A procedure can be written that calls the same code as the OnClick action. This facility can be particularly useful if the activation of one control by clicking causes a cascade of other controls to be activated, and the Click method can be used to initiate the action rather than having the user explicitly click on a lot of controls.
862+
863+</td>
864+
865+</tr>
866+
867+<tr>
868+
869+<td>
870+
871+OnDragDrop
872+
873+</td>
874+
875+<td>
876+
877+Action to be taken during Drag-Drop manoeuvres, ie when the mouse is used to 'capture' an item or some text etc and move it around the screen to a new location.
878+
879+</td>
880+
881+</tr>
882+
883+<tr>
884+
885+<td>
886+
887+OnEntry
888+
889+</td>
890+
891+<td>
892+
893+Action to be taken when the mouse cursor enters the area occupied by the object, usually transfering focus to that object. This might include changes in the appearance of the object such as highlighting or raising the border.
894+
895+</td>
896+
897+</tr>
898+
899+<tr>
900+
901+<td>
902+
903+OnExit
904+
905+</td>
906+
907+<td>
908+
909+Action to be taken when the mouse moves out of the area of the object, usually transferring focus out of the object.
910+
911+</td>
912+
913+</tr>
914+
915+<tr>
916+
917+<td>
918+
919+OnKeyPress
920+
921+</td>
922+
923+<td>
924+
925+Action to be taken for any key-press. Subtly different from OnKeyDown, which simply responds to a key being down, whether or not it was already down when focus was given to this control. OnKeyPress requires that a key becomes pressed while focus is in this control.
926+
927+</td>
928+
929+</tr>
930+
931+<tr>
932+
933+<td>
934+
935+OnKeyDown
936+
937+</td>
938+
939+<td>
940+
941+Action to be taken if a key is down while focus is in this control. Subtly different from OnKeyPress - for example the key might already have been down when focus entered this control, whereas OnKeyPress requires the key to become pressed while focus is in the control.
942+
943+</td>
944+
945+</tr>
946+
947+<tr>
948+
949+<td>
950+
951+On Key Up
952+
953+</td>
954+
955+<td>
956+
957+Action to be taken if a key is up (ie not pressed) while focus is in this control.
958+
959+</td>
960+
961+</tr>
962+
963+<tr>
964+
965+<td>
966+
967+OnMouseMove
968+
969+</td>
970+
971+<td>
972+
973+On Mouse Down - Action to be taken if the mouse cursor moves while focus is in this control.
974+
975+</td>
976+
977+</tr>
978+
979+<tr>
980+
981+<td>
982+
983+OnMouseDown
984+
985+</td>
986+
987+<td>
988+
989+Action to be taken if the mouse button is down while focus is in this control.
990+
991+</td>
992+
993+</tr>
994+
995+<tr>
996+
997+<td>
998+
999+OnMouseUp
1000+
1001+</td>
1002+
1003+<td>
1004+
1005+Action to be taken if the mouse button is up while the cursor is over this control. Implies that the mouse button was previously down and has been released. The case where the cursor enters the control but the mouse button has not yet been pressed is covered by OnEntry or OnMouseEnter.
1006+
1007+</td>
1008+
1009+</tr>
1010+
1011+<tr>
1012+
1013+<td>
1014+
1015+OnResize
1016+
1017+</td>
1018+
1019+<td>
1020+
1021+Action to be taken when the control is resized. Might include re-alignment of text or selection of a different font size etc.
1022+
1023+</td>
1024+
1025+</tr>
1026+
1027+</table>
1028+
1029+## Comment utiliser les Menus
1030+
1031+Trucs et astuces pour l'ajout de Menus dans vos Fiches.
1032+
1033+*TMainMenu* is the Main Menu that appears at the top of most forms; form designers can customise by choosing various menu items. *TPopupMenu* is a menu window that pops up with pertinent, usually context-sensitive, details and choices when the right mouse button is clicked near a control
1034+
1035+Main Menu is a non-visible component : that is, if the icon is selected from the Component Palette and placed on the Form, it will not appear at Run-time. Instead, a Menu bar with a structure defined by the Menu Editor will appear. Popup menus, placed on the form by selecting the icon from the Component Palette, do not appear at all unless the right mouse button is clicked on a control that owns such a menu.
1036+
1037+To see the Menu Editor, right-click on the Main Menu or Popup Menu icon on your Form. A pop-up box appears, that invites you to enter items into the Menu bar.
1038+
1039+An Edit box is displayed, containing a Button labelled New Item1. If you right-click on that box, a pop-up menu is displayed that allows you to add a new item before or after (along the same level) or create a sub-menu with the opportunity to add further items below (or above) the new item in a downward column.
1040+
1041+Any or all of the *MenuItems* that you add can be configured using the Object Inspector.
1042+
1043+At the least you should give each item a *Caption* which will appear on the Menu Bar (you may also wish to give it a more meaningful *Name*). The caption should indicate the activity to be selected, such as "File Open" or "Close", "Run" or "Quit"
1044+
1045+If you want a particular letter in the Caption to be associated with a shortcut key, that letter should be preceded by an ampersand. The Menu item at run-time will appear with the shortcut letter underlined, and hitting that letter key will have the same effect as selecting the menu item. Alternatively you can choose a shortcut key sequence (such as <span class="kbd">Ctrl</span>+<span class="kbd">C</span> for Copy or <span class="kbd">Ctrl</span>+<span class="kbd">V</span> for Paste - the standard Keyboard shortcuts) with the *ShortCut* property of the MenuItem.
1046+
1047+It is often helpful to use the Menu controls in conjuction with an *ActionList* which contains a series of standard or customised *Actions*. Menu Items can be linked in the Object Inspector to Actions on the list, and the same actions can be linked to *Buttons*, *ToolBar Buttons*, *SpeedButtons* etc. It is obviously economic of effort to re-use the same code to respond to the various events, rather than writing separate *OnClick* event handlers for each individual control.
1048+
1049+By default a number of standard actions is pre-loaded from *StdActns* or, if DataAware controls are being used, from *DBActns*, and these can be chosen using the ActionList editor which appears when you right-click on the ActionList icon on the Form Designer.
1050+
1051+## Le débogueur
1052+
1053+
1054+*Reste encore à écrire*.
1055+
1056+voir également [:category: IDE Window - Debug](/wiki-category/IDE%20Window%20-%20Debug)
1057+
1058+## Les fichiers de Lazarus
1059+
1060+`   (Thanks to Kevin Whitefoot.)`\
1061+`   (Additions by Giuseppe Ridinò, `User:Kirkpatc` and Tom Lisjac)`
1062+
1063+Lorsque vous enregistrez, vous sauvez en réalité deux fichiers :
1064+
1065+`  xxx.pas et yyy.lpr `
1066+
1067+(En fait en vous enregistrez plus que ça, mais ces deux-là sont les seuls auxquels vous donnez un nom). Le fichier de projet **.lpr** et le fichier d'unité **.pas** ne doivent pas avoir le même nom car Lazarus attribuera automatiquement à l'unité (dans le code source) le nom du fichier d'unité, et au programme, le nom du fichier de projet (sinon, le compilateur pourrait ne pas retrouver l'unité quand le fichier de projet y fera référence). Bien sûr, pour être cohérent, il change toute les occurrences de Unit1 en xxx.
1068+
1069+Par conséquent, si vous enregistrez un fichier appelé **encore**, encore.pas et encore.lpr, la compilation échouera car les noms de l'unité et du programme sont les mêmes ce qui entraînera une erreur.
1070+
1071+Les fichiers sont donc :
1072+
1073+e:/lazarus/kj/lazhello
1074+
1075+`total 4740  free 76500`\
1076+`-rwxrwxrwx   1 kjwh     root  4618697 Mar 24 11:19 encore.exe`\
1077+`-rw-rw-rw-   1 kjwh     root     3002 Mar 24 11:21 encore.lpi`\
1078+`-rw-rw-rw-   1 kjwh     root      190 Mar 24 11:18 encore.lpr`\
1079+`-rw-rw-rw-   1 kjwh     root      506 Mar 24 11:08 encoreu.lfm`\
1080+`-rw-rw-rw-   1 kjwh     root      679 Mar 24 11:08 encoreu.lrs`\
1081+`-rw-rw-rw-   1 kjwh     root      677 Mar 24 11:08 encoreu.pas`\
1082+`-rw-rw-rw-   1 kjwh     root     2124 Mar 24 11:08 encoreu.ppu`\
1083+`-rwxrwxrwx   1 kjwh     root      335 Mar 24 11:07 ppas.bat`
1084+
1085+Note : il y a plus de fichiers que les deux que j'ai enregistrés.
1086+
1087+Ci-dessous un bref commentaire sur chacun des fichiers :
1088+
1089+**encore.exe :** l'exécutable du programme. Win32 ajoute l'extension **.exe**, mais pas Linux. Ce fichier sera très gros sous Linux à cause de l'inclusion des symboles de débogage (il est prévu de résoudre ce problème). Cependant, vous pouvez exécuter l'utilitaire "strip" pour supprimer ces symboles et réduire de façon substantielle la taille de l'exécutable.
1090+
1091+**encore.lpi :** c'est le fichier principal d'un projet Lazarus (Lazarus Project Information) ; l'équivalent Delphi du fichier **.dpr**. Il est enregistré dans un dialecte XML et contient des instructions concernant toutes les bibliothèques et unités requises pour la compilation de l'exécutable.
1092+
1093+**encore.lpr :** c'est le fichier source principal du programme ou fichier maître. En dépit du fait qu'il ait une extension spécifique à Lazarus, il s'agit en fait d'un fichier source Pascal parfaitement normal. Il possède une clause **uses** qui permet au compilateur de trouver toutes les unités nécessaires. Veuillez noter que le nom du programme et celui du fichier n'ont pas besoin d'être identiques. Ce fichier est habituellement plutôt petit, ne comportant que quelques assertions permettant d'initialiser et construire les fiches, et démarrer et terminer l'application. Le gros du travail est effectué dans les fichiers sources des unités, dont l'extension est '.pas'.
1094+
1095+**encoreu.lfm :** c'est ici que Lazarus stocke les paramètres de la fiche (position, taille...), sous forme compréhensible. C'est le reflet des propriétés de divers composants, telles qu'elles apparaissent dans l'Inspecteur d'objet. Chaque description d'objet débute par une ligne :
1096+
1097+`object xxxx `\
1098+`  suit une liste de propriétés y compris les objets encapsulés ou les sous-objets) puis la ligne`\
1099+`end`
1100+
1101+Lazarus utilise ce fichier pour générer la ressource incluse dans la section d'initialisation de l'unité encoreu.pas. Les fichiers **.dfm** de Delphi peuvent être convertis au format **.lfm** dans l'EDI de Lazarus en utilisant la commande *Outils-\>Convertir un fichier DFM en fichier LFM...*.
1102+
1103+**encore.lrs :** c'est le fichier de ressource qui contient les instructions permettant au programme de construire la fiche. Si vous regardez le fichier de l'unité principale, vous verrez dans la section d'initialisation la ligne
1104+
1105+`{$i againu.lrs}`
1106+
1107+qui commande au programme de charger le fichier de ressources. Notez que ce n'est pas un fichier de ressources Windows.
1108+
1109+**encoreu.pas :** ce fichier d'unité contient votre code correspondant à cette fiche. C'est habituellement le seul fichier que le développeur a besoin d'éditer ou inspecter. Il contient tout le code spécifiquement ajouté par le développeur (en particulier, les 'event handlers').
1110+
1111+**encore.ppu :** l'unité compilée. Elle est liée à l'exécutable, ainsi les autres unités citées dans la section **Uses**.
1112+
1113+**ppas.bat :** c'est un simple script qui lie (link) le programme pour produire l'exécutable. Si la compilation réussit, il est effacé par le compilateur.
1114+
1115+## Contributeurs originaux et changements
1116+
1117+Cette page a été importée de [epikwiki](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial).
1118+
1119+- Created initial page and template. T. Lisjac - 11/04/2003 VlxAdmin
1120+- 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
1121+- Per above, moved Chris's writeup to the main body of the tutorial VlxAdmin
1122+- Began to insert text describing the Lazarus Editor - more to follow! 24 Mar 2004 User:Kirkpatc
1123+- Added some more to Lazarus Editor section of Tutorial. 25 Mar 2004 User:Kirkpatc
1124+- Added screenshots and revised some of the page formatting VlxAdmin 3/25/2004
1125+- 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
1126+- Formatted, added credits and comments. Removed original notes. VlxAdmin 3/26/2004
1127+- More material added to Editor section of tutorial. 26 Mar 2004 User:Kirkpatc
1128+- 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
1129+- Inserted section on Run sub-menu. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 User:Kirkpatc
1130+- Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 User:Kirkpatc
1131+- Deleted the section on MySQL from here: it has been copied to Lazarus Database section of tutorial. 14 Apr 2004 User:Kirkpatc
1132+- Added some more to the description of the Editor Main Menu. 18 Apr 2004 User:Kirkpatc
1133+- Added section on Environment sub-menu. 19 Apr 2004 User:Kirkpatc
1134+- Added section on Components sub-menu. 4 May 2004 User:Kirkpatc
1135+- Adding Tools sub-menu description (incomplete). 7 May 2004 User:Kirkpatc
1136+- Added some screenshots to Menu descriptions. 9 May 2004 User:Kirkpatc
1137+- Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 User:Kirkpatc
1138+- More additions to Tools sub-menu. 19 May 2004 User:Kirkpatc
1139+- Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 User:Kirkpatc
1140+- Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 User:Kirkpatc
1141+- 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
1142+- Expanding on the Components Palette. 5 June 2004 User:Kirkpatc
1143+- Added a lot to the DialogExamples page. 10 June 2004 User:Kirkpatc
1144+- 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
1145+- 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
1146+- Added page for Common Controls (linked to Component Palette). 16 June 2004 User:Kirkpatc
1147+- Added MaskEdit page (linked to Component Palette). 17 June 2004 User:Kirkpatc
1148+- Added Buttons, ExtCtrls pages (linked to Component Palette). 17 June 2004 User:Kirkpatc
1149+- Edited MainMenu component description page. 23 June 2004 User:Kirkpatc
1150+- Some additions to Common Controls. 28 June 2004 User:Kirkpatc
1151+- A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 User:Kirkpatc
1152+- Minor changes to ComCtrls, ExtCtrls, Environment Menu. 10 July User:Kirkpatc
1153+- Added FormsTxt, component description page for Component Palette. 20 July 2004 User:Kirkpatc
1154+- Some corrections to ConsoleModePascal. 21 July 2004 User:Kirkpatc
1155+- Some small changes to ComponentPalette. 22 July 2004 User:Kirkpatc
1156+
1157+---
1158+*From the Free Pascal wiki, page "Lazarus Tutorial/fr", as it stood on 2021-12-08 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history