=== unit1.lfm === object Form1: TForm1 Left = 1258 Height = 240 Top = 225 Width = 320 Caption = 'Form1' ClientHeight = 212 ClientWidth = 320 Menu = MainMenu1 LCLVersion = '1.6.2.0' object Panel1: TPanel Left = 0 Height = 212 Top = 0 Width = 320 Align = alClient Caption = 'Panel1' TabOrder = 0 end object MainMenu1: TMainMenu left = 62 top = 60 object MenuItem1: TMenuItem Caption = 'New Item1' object MenuItem2: TMenuItem Caption = 'New Item2' OnClick = MenuItem2Click end object MenuItem6: TMenuItem Caption = '-' end object MenuItem5: TMenuItem Caption = 'New Item5' end end object MenuItem3: TMenuItem Caption = 'New Item3' object MenuItem4: TMenuItem Caption = 'New Item4' end end end end === unit1.pas === unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, ExtCtrls; type { TForm1 } TForm1 = class(TForm) MainMenu1: TMainMenu; MenuItem1: TMenuItem; MenuItem2: TMenuItem; MenuItem3: TMenuItem; MenuItem4: TMenuItem; MenuItem5: TMenuItem; MenuItem6: TMenuItem; Panel1: TPanel; procedure MenuItem2Click(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.MenuItem2Click(Sender: TObject); begin Close; end; end. === project1.lpr === program project1; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms, Unit1 { you can add units after this }; {$R *.res} begin RequireDerivedFormResource:=True; Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. === project1.lpi === <ResourceType Value="res"/> <UseXPManifest Value="True"/> <Icon Value="0"/> </General> <i18n> <EnableI18N LFM="False"/> </i18n> <VersionInfo> <StringTable ProductVersion=""/> </VersionInfo> <BuildModes Count="1"> <Item1 Name="Default" Default="True"/> </BuildModes> <PublishOptions> <Version Value="2"/> </PublishOptions> <RunParams> <local> <FormatVersion Value="1"/> </local> </RunParams> <RequiredPackages Count="1"> <Item1> <PackageName Value="LCL"/> </Item1> </RequiredPackages> <Units Count="2"> <Unit0> <Filename Value="project1.lpr"/> <IsPartOfProject Value="True"/> </Unit0> <Unit1> <Filename Value="unit1.pas"/> <IsPartOfProject Value="True"/> <ComponentName Value="Form1"/> <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> <UnitName Value="Unit1"/> </Unit1> </Units> </ProjectOptions> <CompilerOptions> <Version Value="11"/> <Target> <Filename Value="project1"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Linking> <Options> <Win32> <GraphicApplication Value="True"/> </Win32> </Options> </Linking> </CompilerOptions> <Debugging> <Exceptions Count="3"> <Item1> <Name Value="EAbort"/> </Item1> <Item2> <Name Value="ECodetoolError"/> </Item2> <Item3> <Name Value="EFOpenError"/> </Item3> </Exceptions> </Debugging> </CONFIG>