Sign in Join
Wiki copytemporary

Lazarus Tutorial/fr: what changed

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

OldNewLine
11*Ceci est le début du Tutoriel Lazarus. N'hésitez pas à y ajouter vos expériences.*
22
33## Vue d'ensemble
44
55Lazarus 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.
66
77## Prise en main
88
99(Merci à User:Kirkpatc)
1010
1111Téléchargez Lazarus dans la section 'Download' du [site officiel](http://www.lazarus.freepascal.org), [[Installing Lazarus/fr|installez-le]] et lancez-le.
1212
1313### Votre premier programme sous Lazarus !
1414
1515Plusieurs 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.
1616
1717Sous 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.
1818
1919Maintenant 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 :
2020
2121``` pascal
2222 procedure TForm1.Button1Click(Sender: TObject);
2323 begin
2424 {maintenant tapez :} Button1.caption := 'Press again';
2525 {L'éditeur a déjà complété la procédure }
2626 end;
2727```
2828
2929Appuyez sur F12 pour sélectionner Form1 au lieu de l'éditeur de source.
3030
3131Maintenant, é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 :
3232
3333``` pascal
3434 procedure TForm1.Button2Click(Sender: TObject);
3535 begin
3636 {maintenant tapez :} Close;
3737 {L'éditeur a déjà complété la procédure }
3838 end;
3939```
4040
4141Maintenant, 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.
4242
4343La 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'.
4444
4545Essayez de cliquer sur le bouton 'Press'. Le libellé changera en 'Press again'. Si vous cliquez encore, le libellé continuera à afficher 'Press again' !
4646
4747Maintenant, 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.
4848
4949A présent, vous devriez sauvegarder votre travail (faites-le souvent !) sélectionnez : Projet -\> Enregistrer le projet sous... et indiquez les noms de vos fichiers.
5050
5151ATTENTION : le nom de fichier de la "Unit" et du projet doivent être différents.
5252
5353### Deuxième session
5454
5555Rouvrez 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.
5656
5757Modifiez votre code de la manière suivante :
5858
5959``` pascal
6060 procedure TForm1.Button1Click(Sender: TObject);
6161 {Makes use of the Tag property, setting it to either 0 or 1}
6262 begin
6363 if Button1.tag = 0 then
6464 begin
6565 Button1.caption := 'Press again';
6666 Button1.tag := 1
6767 end else
6868 begin
6969 Button1.caption := 'Press';
7070 Button1.tag := 0
7171 end
7272 end;
7373```
7474
7575Sauvegardez votre travail, et compilez votre programme. Le bouton 'Press' basculera entre les deux messages ('Press' et 'Press again').
7676
7777Le reste dépend de vous !
7878
7979Si 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]].
8080
8181## L'éditeur
8282
8383Lorsque vous lancez Lazarus, une série de fenêtres flottantes apparaît.
8484
8585La 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.
8686
87-<center>
88-
89-<figure>
90-<img src="Lazmainfr.jpg" title="Lazmainfr.jpg" />
91-<figcaption>Lazmainfr.jpg</figcaption>
92-</figure>
93-
94-</center>
87+![](/wiki-images/f/f5/Lazmainfr.jpg)
9588
9689Sur 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.
9790
9891En 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.
9992
10093Lorsque 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.
10194
10295D'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.
10396
10497### Menu principal
10598
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
99+Le menu principal contient les entrées suivantes : Fichier Edition Cercher Voir Project Exécuter Composants Outils Configuration Fenêtres Aide
107100
108101Comme 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.
109102
110103Pour plus de détails consultez [[Main menu/fr]].
111104
112105### La barre de boutons
113106
114107C'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 :
115108
116109
117110**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).
118111
119112## La palette de composants
120113
121114La barre d'outils à onglets affiche un large choix d'icônes représentant les composants les plus courants pour la conception de formulaires.
122115
123116Chaque 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.
124117
125118Si 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é.
126119
127120Dans 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.
128121
129122**ONGLETS** (les noms sont largement explicites) :
130123
131124- **Standard**
132125
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>
126+![](/wiki-images/4/4d/Component_Palette_Standart.png)
141127
142128
143129*Les composants fréquemment utilisés :*
144130
145131[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)
146132
147133- **Additional**
148134
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>
135+![](/wiki-images/7/7d/Component_Palette_Additional.png)
157136
158137
159138*Des composants souvent utilisés en complément :*
160139
161140[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
162141
163142- **Common Controls**
164143
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>
144+![](/wiki-images/4/4a/Component_Palette_Common_Controls.png)
173145
174146
175147[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)
176148
177149- **Dialogs**
178150
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>
151+![](/wiki-images/7/72/Component_Palette_Dialogs.png)
187152
188153
189154[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
190155
191156Beaucoup 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.
192157
193158Pour 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.
194159
195160Certains 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.
196161
197162Essayez 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 !
198163
199164- **Misc**
200165
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>
166+![](/wiki-images/8/8e/Component_Palette_Misc.png)
209167
210168
211169[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
212170
213171- **Data Controls**
214172
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>
173+![](/wiki-images/6/62/Component_Palette_DataControls.png)
223174
224175
225176*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)
226177
227178- **Data Access**
228179
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>
180+![](/wiki-images/c/cc/Component_Palette_DataAccess.png)
237181
238182
239183TDatasource, TMemDataset (Package MemDSLaz), TSdfDataSet (Package SDFLaz), TFixedFormatDataSet (Package SDFLaz), TDbf (Package DBFLaz)
240184
241185- **System**
242186
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>
187+![](/wiki-images/f/fe/Component_Palette_System.png)
251188
252189
253190[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
254191
255192- **SynEdit**
256193
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>
194+![](/wiki-images/2/22/Component_Palette_SynEdit.png)
265195
266196
267197*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).
268198
269199TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynPythonSyn, TSynAnySyn, TSynMultiSyn
270200
271201### Comment utiliser la Palette
272202
273203Pour 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.
274204
275205Si 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.
276206
277207## Comment utiliser les contrôles *Standard*, *Common* et étendus
278208
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.
209+Les Unités StdCtrls, ComCtrls et ExtCtrls 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.
280210
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>.
211+De nombreux contrôles finaux utilisés par les développeurs, tels que TButton, TMemo, TScrollBar etc., correspondent à une classe ancêtre comme, respectivement, TCustomButton, TCustomMemo ou TCustomScrollBar. Plusieurs propriétés et méthodes relatives au contrôle final sont définies (et expliquées) plus complètement dans la classe TCustomXXX, le contrôle final en héritant.
282212
283213Si 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.
284214
285215Cependant, si vous créez un composant vous-même par programmation, n'oubliez pas de le libérer lorsqu'il n'est plus utilisé.
286216
287217Si 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.
288218
289219Par 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.
290220
291221Inversement, 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.
292222
293223You can also explicitly change the properties of the object in code by typing (in the appropriate Implementation section of the Source editor), for example
294224
295225`         ``Form1.Button1.Height := 48;`\
296226`         `
297227
298228If 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.
299229
300230En résumé, il existe généralement trois méthodes différentes pour déterminer chaque propriété d'un objet:
301231
302232- en utilisant la souris ;
303233- en définissant les valeurs dans l'inspecteur d'objets;
304234- ou explicitement en écrivant du code.
305235
306236La 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.
307237
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.
238+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 `F1`. La page correspondante s'ouvrira alors.
309239
310240If 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.
311241
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>
242+`           ``Constructors`
340243
341-<b>Property</b>
244+`such as ``Create`` allocate memory and system resources needed by the object. They also call the constructor of any sub-objects present in the class.`
342245
343-</td>
246+`           ``Destructors:`
344247
345-<td>
248+`remove the object and de-allocate memory and other resources. If you call ``Destroy`` for an object which hasn't being initialized yet it will generate an error. Always use the ``Free`` method to deallocate objects, because it checks whether an object's value is ``nil`` before invoking ``Destroy``.`
346249
347-<b>Meaning</b>
250+Take the following precautions when creating your own Destroy method:
348251
349-</td>
252+- Declare Destroy with the override directive, because it is a virtual method.
253+- Always call 'inherited Destroy;' as the last thing on the destructor code.
254+- Be aware that an exception may be raised on the constructor in case there is not enought memory to create an object, or something else goes wrong. If the exception is not handled inside the constructor, the object will be only partially built. In this case Destroy will be called when you weren't expecting it, so your destructor must check if the resources were really allocated before disposing of them.
255+- Remember to call Free for all objects created on the constructor.
350256
351-</tr>
257+Some commonly listed properties
352258
353-<tr>
259+Property
354260
355-<td>
261+Meaning
356262
357263Action
358264
359-</td>
360-
361-<td>
362-
363265The main action or event associated with the object. For example selecting an 'Exit' Button might cause the 'Close' action
364266
365-</td>
366-
367-</tr>
368-
369-<tr>
370-
371-<td>
372-
373267Align
374268
375-</td>
376-
377-<td>
378-
379269Defines 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)
380270
381-</td>
382-
383-</tr>
384-
385-<tr>
386-
387-<td>
388-
389271Anchor
390272
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>
273+Used to keep a control a certain distance from the defined edges of a parent control, when the parent is resized. For example \[akBottom, akRight\] will keep the control a fixed distance from the bottom right corner.
404274
405275AutoSelect
406276
407-</td>
408-
409-<td>
410-
411277When True, an editing control will select all its text when it receives focus or when the Enter key is pressed.
412278
413-</td>
414-
415-</tr>
416-
417-<tr>
418-
419-<td>
420-
421279AutoSelected
422280
423-</td>
424-
425-<td>
426-
427281True 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.
428282
429-</td>
430-
431-</tr>
432-
433-<tr>
434-
435-<td>
436-
437283BorderSpacing
438284
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>
285+The space around the edge between an Anchored control and its parent.
452286
453287Caption
454288
455-</td>
456-
457-<td>
458-
459289The 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.
460290
461-</td>
462-
463-</tr>
464-
465-<tr>
466-
467-<td>
468-
469291CharCase
470292
471-</td>
472-
473-<td>
474-
475293Indicates 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
476294
477-</td>
478-
479-</tr>
480-
481-<tr>
482-
483-<td>
484-
485295Constraints
486296
487-</td>
488-
489-<td>
490-
491297Sets 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.
492298
493-</td>
494-
495-</tr>
496-
497-<tr>
498-
499-<td>
500-
501299Color
502300
503-</td>
504-
505-<td>
506-
507301The Colour to be used to draw the control or to write the text it contains.
508302
509-</td>
510-
511-</tr>
512-
513-<tr>
514-
515-<td>
516-
517303Enabled
518304
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>
305+A Boolean property to determine whether or not a control is capable of being selected and performing an action. If it is not Enabled, it is often Grayed out on the Form.
532306
533307Font
534308
535-</td>
536-
537-<td>
538-
539309The 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.
540310
541-</td>
542-
543-</tr>
544-
545-<tr>
546-
547-<td>
548-
549311Hint
550312
551-</td>
552-
553-<td>
554-
555313A short piece of informative pop-up text that appears if the mouse-cursor hovers over the control.
556314
557-</td>
558-
559-</tr>
560-
561-<tr>
562-
563-<td>
564-
565315Items
566316
567-</td>
568-
569-<td>
570-
571317The 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
572318
573-</td>
574-
575-</tr>
576-
577-<tr>
578-
579-<td>
580-
581319Lines
582320
583-</td>
584-
585-<td>
586-
587321An 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\]
588322
589-</td>
590-
591-</tr>
592-
593-<tr>
594-
595-<td>
596-
597323Name
598324
599-</td>
600-
601-<td>
602-
603325The 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.
604326
605-</td>
606-
607-</tr>
608-
609-<tr>
610-
611-<td>
612-
613327PopUpMenu
614328
615-</td>
616-
617-<td>
618-
619329A window containing context-sensitive menu information that pops up when the right mouse button is clicked on the object.
620330
621-</td>
622-
623-</tr>
624-
625-<tr>
626-
627-<td>
628-
629331Position (or Top, Left)
630332
631-</td>
632-
633-<td>
634-
635333Determines where the control is located on the parent form or window
636334
637-</td>
638-
639-</tr>
640-
641-<tr>
642-
643-<td>
644-
645335ReadOnly
646336
647-</td>
648-
649-<td>
650-
651337Boolean 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.
652338
653-</td>
654-
655-</tr>
656-
657-<tr>
658-
659-<td>
660-
661339ShowHint
662340
663-</td>
664-
665-<td>
666-
667341Allows a small window containing a context-sensitive Help or other description to be displayed when the mouse cursor 'hovers' over the control.
668342
669-</td>
670-
671-</tr>
672-
673-<tr>
674-
675-<td>
676-
677343Size (or Height and Width)
678344
679-</td>
680-
681-<td>
682-
683345The dimensions of the control
684346
685-</td>
686-
687-</tr>
688-
689-<tr>
690-
691-<td>
692-
693347Style
694348
695-</td>
696-
697-<td>
698-
699349The options available for Style depend upon the sort of Control being considered: for instance the Style may be defined by TFormStyle, TBorderStyle, TButtonStyle etc.
700350
701-</td>
702-
703-</tr>
704-
705-<tr>
706-
707-<td>
708-
709351TabOrder
710352
711-</td>
712-
713-<td>
714-
715353Integer defining where in the sequence of tabs on the Form this control is to lie
716354
717-</td>
718-
719-</tr>
720-
721-<tr>
722-
723-<td>
724-
725355TabStop
726356
727-</td>
728-
729-<td>
730-
731357Boolean property which if True places this control in the sequence of objects that the user can reach by successively pressing the Tab key
732358
733-</td>
734-
735-</tr>
736-
737-<tr>
738-
739-<td>
740-
741359Text
742360
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>
361+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 Select, Clear, Cut, Copy) 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 TMemo or TComboBox, then the textual elements are arranged as an array of strings (zero-indexed, ie numbered from \[0..numLines-1\]) in Lines.
756362
757363Visible
758364
759-</td>
760-
761-<td>
762-
763365If true, the object can be seen on the Form; if False, object is hidden
764366
765-</td>
766-
767-</tr>
768-
769-<tr>
770-
771-<td>
772-
773367WordWrap
774368
775-</td>
776-
777-<td>
778-
779369Logical 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.
780370
781-</td>
782-
783-</tr>
784-
785-</table>
786-
787371Many 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.
788372
789373While 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.
790374
791375The 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.
792376
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>
377+A common strategy in Object-Oriented programming is to provide an ActionList 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.
816378
817-</td>
379+Some commonly listed Actions
818380
819-<tr>
381+Action
820382
821-<td>
383+Meaning
822384
823385OnChange
824386
825-</td>
826-
827-<td>
828-
829387Action to be taken if any change is detected (eg mouse move, mouse click, key press, edit text, alter picture, etc)
830388
831-</td>
832-
833-</tr>
834-
835-<tr>
836-
837-<td>
838-
839389OnClick
840390
841-</td>
842-
843-<td>
844-
845391Action 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.
846392
847-</td>
848-
849-</tr>
850-
851-<tr>
852-
853-<td>
854-
855393Click
856394
857-</td>
858-
859-<td>
860-
861395A 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.
862396
863-</td>
864-
865-</tr>
866-
867-<tr>
868-
869-<td>
870-
871397OnDragDrop
872398
873-</td>
874-
875-<td>
876-
877399Action 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.
878400
879-</td>
880-
881-</tr>
882-
883-<tr>
884-
885-<td>
886-
887401OnEntry
888402
889-</td>
890-
891-<td>
892-
893403Action 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.
894404
895-</td>
896-
897-</tr>
898-
899-<tr>
900-
901-<td>
902-
903405OnExit
904406
905-</td>
906-
907-<td>
908-
909407Action to be taken when the mouse moves out of the area of the object, usually transferring focus out of the object.
910408
911-</td>
912-
913-</tr>
914-
915-<tr>
916-
917-<td>
918-
919409OnKeyPress
920410
921-</td>
922-
923-<td>
924-
925411Action 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.
926412
927-</td>
928-
929-</tr>
930-
931-<tr>
932-
933-<td>
934-
935413OnKeyDown
936414
937-</td>
938-
939-<td>
940-
941415Action 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.
942416
943-</td>
944-
945-</tr>
946-
947-<tr>
948-
949-<td>
950-
951417On Key Up
952418
953-</td>
954-
955-<td>
956-
957419Action to be taken if a key is up (ie not pressed) while focus is in this control.
958420
959-</td>
960-
961-</tr>
962-
963-<tr>
964-
965-<td>
966-
967421OnMouseMove
968422
969-</td>
970-
971-<td>
972-
973423On Mouse Down - Action to be taken if the mouse cursor moves while focus is in this control.
974424
975-</td>
976-
977-</tr>
978-
979-<tr>
980-
981-<td>
982-
983425OnMouseDown
984426
985-</td>
986-
987-<td>
988-
989427Action to be taken if the mouse button is down while focus is in this control.
990428
991-</td>
992-
993-</tr>
994-
995-<tr>
996-
997-<td>
998-
999429OnMouseUp
1000430
1001-</td>
1002-
1003-<td>
1004-
1005431Action 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.
1006432
1007-</td>
1008-
1009-</tr>
1010-
1011-<tr>
1012-
1013-<td>
1014-
1015433OnResize
1016434
1017-</td>
1018-
1019-<td>
1020-
1021435Action to be taken when the control is resized. Might include re-alignment of text or selection of a different font size etc.
1022436
1023-</td>
1024-
1025-</tr>
1026-
1027-</table>
1028-
1029437## Comment utiliser les Menus
1030438
1031439Trucs et astuces pour l'ajout de Menus dans vos Fiches.
1032440
1033441*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
1034442
1035443Main 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.
1036444
1037445To 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.
1038446
1039447An 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.
1040448
1041449Any or all of the *MenuItems* that you add can be configured using the Object Inspector.
1042450
1043451At 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"
1044452
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.
453+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 `Ctrl`+`C` for Copy or `Ctrl`+`V` for Paste - the standard Keyboard shortcuts) with the *ShortCut* property of the MenuItem.
1046454
1047455It 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.
1048456
1049457By 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.
1050458
1051459## Le débogueur
1052460
1053461
1054462*Reste encore à écrire*.
1055463
1056464voir également [:category: IDE Window - Debug](/wiki-category/IDE%20Window%20-%20Debug)
1057465
1058466## Les fichiers de Lazarus
1059467
1060468`   (Thanks to Kevin Whitefoot.)`\
1061469`   (Additions by Giuseppe Ridinò, `User:Kirkpatc` and Tom Lisjac)`
1062470
1063471Lorsque vous enregistrez, vous sauvez en réalité deux fichiers :
1064472
1065473`  xxx.pas et yyy.lpr `
1066474
1067475(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.
1068476
1069477Par 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.
1070478
1071479Les fichiers sont donc :
1072480
1073481e:/lazarus/kj/lazhello
1074482
1075483`total 4740  free 76500`\
1076484`-rwxrwxrwx   1 kjwh     root  4618697 Mar 24 11:19 encore.exe`\
1077485`-rw-rw-rw-   1 kjwh     root     3002 Mar 24 11:21 encore.lpi`\
1078486`-rw-rw-rw-   1 kjwh     root      190 Mar 24 11:18 encore.lpr`\
1079487`-rw-rw-rw-   1 kjwh     root      506 Mar 24 11:08 encoreu.lfm`\
1080488`-rw-rw-rw-   1 kjwh     root      679 Mar 24 11:08 encoreu.lrs`\
1081489`-rw-rw-rw-   1 kjwh     root      677 Mar 24 11:08 encoreu.pas`\
1082490`-rw-rw-rw-   1 kjwh     root     2124 Mar 24 11:08 encoreu.ppu`\
1083491`-rwxrwxrwx   1 kjwh     root      335 Mar 24 11:07 ppas.bat`
1084492
1085493Note : il y a plus de fichiers que les deux que j'ai enregistrés.
1086494
1087495Ci-dessous un bref commentaire sur chacun des fichiers :
1088496
1089497**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.
1090498
1091499**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.
1092500
1093501**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'.
1094502
1095503**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 :
1096504
1097505`object xxxx `\
1098506`  suit une liste de propriétés y compris les objets encapsulés ou les sous-objets) puis la ligne`\
1099507`end`
1100508
1101509Lazarus 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...*.
1102510
1103511**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
1104512
1105513`{$i againu.lrs}`
1106514
1107515qui commande au programme de charger le fichier de ressources. Notez que ce n'est pas un fichier de ressources Windows.
1108516
1109517**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').
1110518
1111519**encore.ppu :** l'unité compilée. Elle est liée à l'exécutable, ainsi les autres unités citées dans la section **Uses**.
1112520
1113521**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.
1114522
1115523## Contributeurs originaux et changements
1116524
1117525Cette page a été importée de [epikwiki](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial).
1118526
1119527- Created initial page and template. T. Lisjac - 11/04/2003 VlxAdmin
1120528- 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
1121529- Per above, moved Chris's writeup to the main body of the tutorial VlxAdmin
1122530- Began to insert text describing the Lazarus Editor - more to follow! 24 Mar 2004 User:Kirkpatc
1123531- Added some more to Lazarus Editor section of Tutorial. 25 Mar 2004 User:Kirkpatc
1124532- Added screenshots and revised some of the page formatting VlxAdmin 3/25/2004
1125533- 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
1126534- Formatted, added credits and comments. Removed original notes. VlxAdmin 3/26/2004
1127535- More material added to Editor section of tutorial. 26 Mar 2004 User:Kirkpatc
1128536- 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
1129537- Inserted section on Run sub-menu. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 User:Kirkpatc
1130538- Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 User:Kirkpatc
1131539- Deleted the section on MySQL from here: it has been copied to Lazarus Database section of tutorial. 14 Apr 2004 User:Kirkpatc
1132540- Added some more to the description of the Editor Main Menu. 18 Apr 2004 User:Kirkpatc
1133541- Added section on Environment sub-menu. 19 Apr 2004 User:Kirkpatc
1134542- Added section on Components sub-menu. 4 May 2004 User:Kirkpatc
1135543- Adding Tools sub-menu description (incomplete). 7 May 2004 User:Kirkpatc
1136544- Added some screenshots to Menu descriptions. 9 May 2004 User:Kirkpatc
1137545- Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 User:Kirkpatc
1138546- More additions to Tools sub-menu. 19 May 2004 User:Kirkpatc
1139547- Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 User:Kirkpatc
1140548- Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 User:Kirkpatc
1141549- 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
1142550- Expanding on the Components Palette. 5 June 2004 User:Kirkpatc
1143551- Added a lot to the DialogExamples page. 10 June 2004 User:Kirkpatc
1144552- 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
1145553- 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
1146554- Added page for Common Controls (linked to Component Palette). 16 June 2004 User:Kirkpatc
1147555- Added MaskEdit page (linked to Component Palette). 17 June 2004 User:Kirkpatc
1148556- Added Buttons, ExtCtrls pages (linked to Component Palette). 17 June 2004 User:Kirkpatc
1149557- Edited MainMenu component description page. 23 June 2004 User:Kirkpatc
1150558- Some additions to Common Controls. 28 June 2004 User:Kirkpatc
1151559- A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 User:Kirkpatc
1152560- Minor changes to ComCtrls, ExtCtrls, Environment Menu. 10 July User:Kirkpatc
1153561- Added FormsTxt, component description page for Component Palette. 20 July 2004 User:Kirkpatc
1154562- Some corrections to ConsoleModePascal. 21 July 2004 User:Kirkpatc
1155563- Some small changes to ComponentPalette. 22 July 2004 User:Kirkpatc
1156564
1157565---
1158566*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