Difference between revisions of "Lazarus Tutorial/it"

From Free Pascal wiki
Jump to navigationJump to search
Line 8: Line 8:
  
 
(Un ringraziamento a [[User:Kirkpatc]])
 
(Un ringraziamento a [[User:Kirkpatc]])
 +
Scarica, Istalla ([[Installing Lazarus]]) ed esegui Lazarus con il quale sara' disponibile il compilatore FreePascal.
 +
Diverse finestre compariranno sul desktop. Il menu proncipale in altro, L'Object Inspector sulla sinistra, l'editor di codice di Lazarus che occupa gran parte desktop ed una finestra Form1 già pronta che copre l'editor di codice.
  
Get, install ([[Installing Lazarus]]) and launch Lazarus which will also make available the FreePascal Compiler.
+
Nel finestra del menu in alto, sotto la line del menu c'è una riga di tab. Se la tab 'Standard' non è ancora selezionata, selezionala cliccandoci con il mouse. Quindi cerca l'icona del pulsante (un rettangolo con la scritta 'OK') a cliccaci con il mouse. Quindi clicca sulla finestra Form1, in un punto qualsiasi a sinistra a partire dal centro.
 +
Una rettangolo ombreggiato con il nome "Button1" comparirà. Clicca ancora sul pulsante nella Standard tab quindi clicca ancora nel Form1 destra dal centro: Un rettangolo con il nome 'Button2' comparirà.
  
Several windows will appear on the desktop:  the main menu at the top, the Object Inspector on the left, the Lazarus Source Editor occupying most of the desktop, and a ready-made Form1 window overlying the Source Editor.
+
Ora clicca sul pulsante Button1 per selezionarlo. L'Object Inspector visualizzarà le proprietà dell'oggetto Button1. Vicino in alto alla proprietà 'Caption' con visualizzato il valore 'Button1'. Clicca su questo riquadro e cambia 'Button1' con 'Press'. Se premi Enter o click in un altro riquadro, vedrai l'etichetta del primo pulsante su Form1 cambiato in 'Press'. Ora clicca sulla Events tab sull'Object Inspector per vedere i vari eventi che sono associati con il pulsante. Questi includono OnClick, OnEnter, OnExit etc. Selezione il riquadro a destra di OnClick: una piccolo riquadro con tree puntini compariranno. Quindi clicca cu questo. Sarai reindirizzato automaticamente sull'editor di codice e il cursore sarà collacato nel seguente framento di codice:
  
On the top Menu window, underneath the menu line, is a row of tabs. If the 'Standard' tab is not already selected, select it by clicking with the mouse. Then find the Button icon (a rectangle with 'OK' on it) and click on that with the mouse.  Then click on the Form1 window, somewhere to the left of the middle.  A shadowed rectangle labelled 'Button1' will appear.  Click again on the Button icon in the Standard tab, and click on the Form1 somewhere to the right of centre: a rectangle labelled 'Button2' will appear.
+
  procedure TForm1.Button1Click(Sender: TObject);
 
 
Now click on Button1 to select it.  The Object Inspector will display the properties of the object Button1.  Near the top is a property named 'Caption', with the displayed value 'Button1'.  Click on that box, and change 'Button1' to 'Press'.  If you hit ENTER or click in another box, you will see the label of the first button on Form1 change to 'Press'.  Now click on the Events tab on the Object Inspector, to see the various events that can be associated with the button.  These include OnClick, OnEnter, OnExit etc. Select the box to the right of OnClick:  a smaller box with three dots (... ellipsis) appears.  When you click on this, you are taken automatically into the Source Editor and your cursor will be placed in a piece of code starting:
 
 
 
  procedure TForm1.Button1Click(Sender: TObject);
 
 
   begin
 
   begin
 
     {now type:}    Button1.caption := 'Press again';
 
     {now type:}    Button1.caption := 'Press again';
Line 23: Line 22:
 
   end;
 
   end;
  
Press F12 to select the Form1 window instead of the Source Editor.
+
Premi F12 per selezionare la finestra Form1 invece dell'editor di codice.
 +
Ora modifica le proprietà di Button2: clicca su Button2 per visualizzare le sue proprierà nel Object Inspector. Cambia la la proprietà Caption 'Exit' al posto di 'Button2'. Ora seleziona la tab degli eventi e clicca sul riquadro OnClick. CLicca su .... Quindi verra reindirizzato all'interno dell'editor di codice all'interno di un altra procedura:
  
Now edit the properties of Button2: click on Button2 to display its properties in the Object Inspector.  Change its Caption property to 'Exit' instead of 'Button2'.  Now select the Events tab, and click on the box for OnClick. Click on the ... ellipsis, and you will be taken into the Source Editor, in the middle of another procedure:
 
  
 
   procedure TForm1.Button2Click(Sender: TObject);
 
   procedure TForm1.Button2Click(Sender: TObject);
Line 33: Line 32:
 
   end;
 
   end;
  
Now Press F12 to see the Form1 window again. You are now ready to try to compile. The simplest way to do this is to select 'Run' from the main menu at the top, and then the 'Run' option on the sub-menu. Alternatively you could simply type F9. This will first compile and then (if all is well) link and execute your program.
+
Premi F12 per vedere la finestra Form1 ancora. Sei pronto per compilare ora. Il modo più semplice per farlo è selezionare 'Esegui' dal menu principale in alto, l'opzione run si trova sul sotto-menu. In alternativa potresti semplicemente premere F9. Questo prima compilerà e dopo (se è andato tutto bene) linkera ed eseguirà il tuo programma.
 
 
Several text windows will appear and all sorts of compiler messages will be typed, but eventually your Form1 window will re-appear, but without the grid of dots;  this is the actual main window of your application, and it is waiting for you to push buttons or otherwise interact with it.
 
 
 
Try clicking on the button labelled 'Press'.  You will notice that it changes to 'Press again'. If you press it again, it will still say 'Press again'!!
 
  
Now click on the button marked 'Exit'. The window will close and the program will exit. The original Form1 window with the grid of dots will reappear, ready to accept more editing activity.
+
Diverse finestre di testo appariranno ad diversi tipi di messaggi verranno visualizzati, eventualmente tua finestra Form1 riapparirà  ma senza la griglia di punti. Questa è la finestra principale della tua applicazione e sta aspettando che premi i pulsanti oppure che ci interagisci.
 +
 +
Prova cliccando su pulsante 'Press'. Noterai che questo cambia in 'Press again'.
 +
Ora clicca sul pulsante 'Exit'. La finestra si chiuderà ed il programma finirà. La finestra orginale Form1 con la griglia di punti riapparirà, pronta ad accettare altre attività di modifica.
  
You should save your work now
+
Puoi salvare il tuo lavoro ora.

Revision as of 11:25, 2 May 2009

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

This is the start of a Lazarus Tutorial. Please feel free to add your experiences to it.

Overview

Lazarus è un strumento di sviluppo gratuito per compilatori Free Pascal, anche esso gratis e open source. L' IDE Lazarus (screenshot) è uno stabile e ricco ambiente di sviluppo per la creazione di applicazioni grafiche e da console. Lazarus attualmente funziona su Linux, Mac OS X e Windows e fornisce un editor di codice customizzabile ed un ambiente visuale con un package manager, un debugger ed una completa integrata GUI con un compilatore pascal free.

Si inizia - Il tuo primo programma in Lazarus!

(Un ringraziamento a User:Kirkpatc) Scarica, Istalla (Installing Lazarus) ed esegui Lazarus con il quale sara' disponibile il compilatore FreePascal. Diverse finestre compariranno sul desktop. Il menu proncipale in altro, L'Object Inspector sulla sinistra, l'editor di codice di Lazarus che occupa gran parte desktop ed una finestra Form1 già pronta che copre l'editor di codice.

Nel finestra del menu in alto, sotto la line del menu c'è una riga di tab. Se la tab 'Standard' non è ancora selezionata, selezionala cliccandoci con il mouse. Quindi cerca l'icona del pulsante (un rettangolo con la scritta 'OK') a cliccaci con il mouse. Quindi clicca sulla finestra Form1, in un punto qualsiasi a sinistra a partire dal centro. Una rettangolo ombreggiato con il nome "Button1" comparirà. Clicca ancora sul pulsante nella Standard tab quindi clicca ancora nel Form1 destra dal centro: Un rettangolo con il nome 'Button2' comparirà.

Ora clicca sul pulsante Button1 per selezionarlo. L'Object Inspector visualizzarà le proprietà dell'oggetto Button1. Vicino in alto alla proprietà 'Caption' con visualizzato il valore 'Button1'. Clicca su questo riquadro e cambia 'Button1' con 'Press'. Se premi Enter o click in un altro riquadro, vedrai l'etichetta del primo pulsante su Form1 cambiato in 'Press'. Ora clicca sulla Events tab sull'Object Inspector per vedere i vari eventi che sono associati con il pulsante. Questi includono OnClick, OnEnter, OnExit etc. Selezione il riquadro a destra di OnClick: una piccolo riquadro con tree puntini compariranno. Quindi clicca cu questo. Sarai reindirizzato automaticamente sull'editor di codice e il cursore sarà collacato nel seguente framento di codice:

procedure TForm1.Button1Click(Sender: TObject);
 begin
   {now type:}    Button1.caption := 'Press again';
   {the editor has already completed the procedure with}
 end;

Premi F12 per selezionare la finestra Form1 invece dell'editor di codice. Ora modifica le proprietà di Button2: clicca su Button2 per visualizzare le sue proprierà nel Object Inspector. Cambia la la proprietà Caption 'Exit' al posto di 'Button2'. Ora seleziona la tab degli eventi e clicca sul riquadro OnClick. CLicca su .... Quindi verra reindirizzato all'interno dell'editor di codice all'interno di un altra procedura:


 procedure TForm1.Button2Click(Sender: TObject);
 begin
 {now type:}   Close;
 {the editor has already completed the procedure with} 
 end;

Premi F12 per vedere la finestra Form1 ancora. Sei pronto per compilare ora. Il modo più semplice per farlo è selezionare 'Esegui' dal menu principale in alto, l'opzione run si trova sul sotto-menu. In alternativa potresti semplicemente premere F9. Questo prima compilerà e dopo (se è andato tutto bene) linkera ed eseguirà il tuo programma.

Diverse finestre di testo appariranno ad diversi tipi di messaggi verranno visualizzati, eventualmente tua finestra Form1 riapparirà ma senza la griglia di punti. Questa è la finestra principale della tua applicazione e sta aspettando che premi i pulsanti oppure che ci interagisci.

Prova cliccando su pulsante 'Press'. Noterai che questo cambia in 'Press again'. Ora clicca sul pulsante 'Exit'. La finestra si chiuderà ed il programma finirà. La finestra orginale Form1 con la griglia di punti riapparirà, pronta ad accettare altre attività di modifica.

Puoi salvare il tuo lavoro ora.