From a6a9b39dabe4be6608561567429d3e4e11c703ea Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 3 Aug 2012 23:03:00 +0000 Subject: [PATCH] examples: fixed compilation, removed writeln git-svn-id: trunk@38134 - --- examples/checkbox.lpi | 10 ++-- examples/checkbox.pp | 13 ++--- examples/designnonlcl/mywidgetset.pas | 1 - examples/fontenum/fontenumeration.lpi | 31 +++++++----- examples/fontenum/mainunit.pas | 10 ++-- examples/htmlhelp_ipro/htmlhelp2unit2.pas | 2 - examples/listboxtest.lpi | 29 +++++++---- examples/listboxtest.pp | 4 +- examples/messagedialogs.pp | 4 +- examples/notebku.pp | 9 ---- examples/pascalstream/PascalStream1.lpi | 19 +++---- examples/pascalstream/unit1.pas | 24 ++++----- .../postscript/usamplepostscriptcanvas.pas | 1 - examples/scrollbar.pp | 8 +-- examples/speedtest.pp | 10 ++-- examples/sprites/playground.pas | 4 -- examples/toolbar.pp | 20 ++++---- examples/trackbar.lpi | 50 +++++++++++-------- examples/trackbar.pp | 14 +++--- examples/treeview/tv_add_remove_u1.pas | 2 +- examples/xmlstreaming/mainunit.pas | 24 ++++----- 21 files changed, 143 insertions(+), 146 deletions(-) diff --git a/examples/checkbox.lpi b/examples/checkbox.lpi index dd8b7b7640..e1dab1a345 100644 --- a/examples/checkbox.lpi +++ b/examples/checkbox.lpi @@ -16,7 +16,6 @@ - @@ -40,11 +39,11 @@ - - + + - + @@ -52,7 +51,7 @@ - + @@ -70,4 +69,5 @@ + diff --git a/examples/checkbox.pp b/examples/checkbox.pp index b4bff3eeda..f31f6bee17 100644 --- a/examples/checkbox.pp +++ b/examples/checkbox.pp @@ -32,11 +32,10 @@ program CheckBox; {$mode objfpc}{$H+} -// program uses WriteLn uses Interfaces, Classes, Stdctrls, Forms, Buttons, Menus, Comctrls, - SysUtils, ExtCtrls, GraphType, Graphics, Controls; + SysUtils, ExtCtrls, GraphType, Graphics, Controls, LazLogger; type TForm1 = class(TFORM) @@ -121,13 +120,12 @@ End; procedure TForm1.CheckBoxClick(Sender : TObject); Begin - WriteLn('[TForm1.CheckBoxClick]'); + DebugLn('[TForm1.CheckBoxClick]'); if assigned (CheckBox1) and assigned (label1) then begin Writeln (' [checkbox and label assigned]'); if CheckBox1.Checked then label1.Caption := 'checked' else label1.Caption := 'unchecked'; -// ***SIGSEGV!!!!!!!!! label1.Repaint; if CheckBox1.Checked then CheckBox1.Caption := 'new caption' else CheckBox1.Caption := 'Checkbox 1'; @@ -136,25 +134,24 @@ End; procedure TForm1.RadioButtonClick(Sender : TObject); begin - WriteLn('[TForm1.RadioButtonClick]'); + debugln('[TForm1.RadioButtonClick]'); if assigned (label2) then label2.Caption := 'active: ' + TRadioButton (Sender).Caption end; procedure TForm1.RadioGroupClick(Sender : TObject); begin - WriteLn('[TForm1.RadioGroupClick]'); + debugln('[TForm1.RadioGroupClick]'); end; procedure TForm1.ToggleBoxClick(Sender : TObject); begin - WriteLn('[TForm1.ToggleBoxClick]'); + debugln('[TForm1.ToggleBoxClick]'); if assigned (ToggleBox) then begin if ToggleBox.checked then ToggleBox.Caption := 'Togglebox1' else ToggleBox.Caption := 'does nothing:-('; -// ***SIGSEGV!!!!!!!!! ToggleBox.RePaint; end; end; diff --git a/examples/designnonlcl/mywidgetset.pas b/examples/designnonlcl/mywidgetset.pas index 504cb790d8..2ed5d4f1d7 100644 --- a/examples/designnonlcl/mywidgetset.pas +++ b/examples/designnonlcl/mywidgetset.pas @@ -292,7 +292,6 @@ end; procedure TMyWidget.InvalidateRect(ARect: TRect; Erase: boolean); begin - //writeln('TMyWidget.InvalidateRect ',Name,' ',ARect.Left,',',ARect.Top); ARect.Left:=Max(0,ARect.Left); ARect.Top:=Max(0,ARect.Top); ARect.Right:=Min(Width,ARect.Right); diff --git a/examples/fontenum/fontenumeration.lpi b/examples/fontenum/fontenumeration.lpi index 222fd2d240..2373c95339 100644 --- a/examples/fontenum/fontenumeration.lpi +++ b/examples/fontenum/fontenumeration.lpi @@ -1,19 +1,20 @@ - - + + - - - <ActiveEditorIndexAtStart Value="0"/> + <ActiveWindowIndexAtStart Value="0"/> </General> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <DestinationDirectory Value="$(ProjPath)/published"/> @@ -37,29 +38,34 @@ <Filename Value="fontenumeration.lpr"/> <IsPartOfProject Value="True"/> <UnitName Value="fontenumeration"/> - <CursorPos X="44" Y="15"/> <TopLine Value="1"/> + <CursorPos X="44" Y="15"/> <UsageCount Value="158"/> </Unit0> <Unit1> <Filename Value="mainunit.pas"/> - <ComponentName Value="frmMain"/> <IsPartOfProject Value="True"/> - <ResourceFilename Value="mainunit.lrs"/> + <ComponentName Value="frmMain"/> <UnitName Value="mainunit"/> - <CursorPos X="11" Y="10"/> - <TopLine Value="1"/> <EditorIndex Value="0"/> + <WindowIndex Value="0"/> + <TopLine Value="1"/> + <CursorPos X="47" Y="9"/> <UsageCount Value="158"/> <Loaded Value="True"/> </Unit1> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="11"/> <SearchPaths> - <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> + <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)"/> </SearchPaths> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Other> <CompilerPath Value="$(CompPath)"/> </Other> @@ -74,4 +80,5 @@ </Item2> </Exceptions> </Debugging> + <EditorMacros Count="0"/> </CONFIG> diff --git a/examples/fontenum/mainunit.pas b/examples/fontenum/mainunit.pas index a582ee7d07..44dc6dcd07 100644 --- a/examples/fontenum/mainunit.pas +++ b/examples/fontenum/mainunit.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, - LCLType, LCLIntf, StdCtrls, Buttons, LCLProc, ComCtrls, ExtCtrls, Grids, + LCLType, LCLIntf, StdCtrls, Buttons, LCLProc, ExtCtrls, Grids, FileUtil, IniFiles; type @@ -399,7 +399,7 @@ begin i := Sender.Items.IndexOf(s); if i>-1 then begin {$ifdef debug} - WriteLn('RestoreSelection: listbox=',Sender.Name,' Old=',GetSelection,' New=',S); + debugln('RestoreSelection: listbox=',Sender.Name,' Old=',GetSelection,' New=',S); {$endif} if i<>Sender.ItemIndex then Sender.ItemIndex := i; @@ -428,7 +428,7 @@ begin lf.lfPitchAndFamily := i; {$ifdef debug} - WriteLn('LoadFontList: for charset=',CharSetToString(lf.lfcharset)); + debugln('LoadFontList: for charset=',CharSetToString(lf.lfcharset)); {$endif} L := TStringList.create; @@ -492,9 +492,9 @@ begin {$ifdef debug} Write('LoadFamilyFonts: for family=', lbFamily.Items[i],' and Charset='); if LoadingCharsets then - WriteLn('ALL_CHARSETS') + debugln('ALL_CHARSETS') else - WriteLn(CharsetToString(byte(Charset))); + debugln(CharsetToString(byte(Charset))); {$endif} // at the moment only global fonts are enumerated diff --git a/examples/htmlhelp_ipro/htmlhelp2unit2.pas b/examples/htmlhelp_ipro/htmlhelp2unit2.pas index 463adb3f7a..2aaaf49862 100644 --- a/examples/htmlhelp_ipro/htmlhelp2unit2.pas +++ b/examples/htmlhelp_ipro/htmlhelp2unit2.pas @@ -112,9 +112,7 @@ end; procedure TForm2.showURL(URL : String); begin Show; - //writeln ('ShowUrl ',ansiuppercase(URL)); URL := expandLocalHtmlFileName (URL); - //writeln ('showURL: "',URL,'"'); IHP.OpenURL(URL); end; diff --git a/examples/listboxtest.lpi b/examples/listboxtest.lpi index 7f792ada2f..d37b5360db 100644 --- a/examples/listboxtest.lpi +++ b/examples/listboxtest.lpi @@ -1,20 +1,21 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> + <Version Value="9"/> <PathDelim Value="\"/> - <Version Value="5"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <MainUnit Value="0"/> - <IconPath Value="./"/> - <TargetFileExt Value=""/> - <ActiveEditorIndexAtStart Value="0"/> + <ActiveWindowIndexAtStart Value="0"/> </General> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> - <DestinationDirectory Value="$(TestDir)\publishedproject\"/> <IgnoreBinaries Value="False"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> @@ -35,20 +36,25 @@ <Filename Value="listboxtest.pp"/> <IsPartOfProject Value="True"/> <UnitName Value="ListBoxTest"/> - <CursorPos X="1" Y="32"/> - <TopLine Value="1"/> + <IsVisibleTab Value="True"/> <EditorIndex Value="0"/> + <WindowIndex Value="0"/> + <TopLine Value="113"/> + <CursorPos X="47" Y="143"/> <UsageCount Value="20"/> <Loaded Value="True"/> + <LoadedDesigner Value="True"/> </Unit0> </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="11"/> <PathDelim Value="\"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Linking> <Options> <Win32> @@ -60,4 +66,5 @@ <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> + <EditorMacros Count="0"/> </CONFIG> diff --git a/examples/listboxtest.pp b/examples/listboxtest.pp index 7c0ee2d321..044bcd7de8 100644 --- a/examples/listboxtest.pp +++ b/examples/listboxtest.pp @@ -23,7 +23,7 @@ program ListBoxTest; {$mode objfpc}{$H+} uses - Interfaces, Buttons, Classes, Forms, StdCtrls, SysUtils, Controls; + Interfaces, Buttons, Classes, Forms, StdCtrls, SysUtils, Controls, LazLogger; type TListBoxTestForm = class(TForm) @@ -140,7 +140,7 @@ var X: PtrInt; begin X := PtrInt(ListBox.Items.Objects[ListBox.ItemIndex]); - writeln('TListBoxTestForm.Button4Click ',X); + DebugLn(['TListBoxTestForm.Button4Click ',X]); end; procedure TListBoxTestForm.FormResize(Sender: TObject); diff --git a/examples/messagedialogs.pp b/examples/messagedialogs.pp index 85eddd4eb0..504f8c6c2a 100644 --- a/examples/messagedialogs.pp +++ b/examples/messagedialogs.pp @@ -32,7 +32,7 @@ Program MessagDialogs; {$mode objfpc}{$H+} -uses Interfaces, Classes, Forms, Dialogs, Buttons, StdCtrls; +uses Interfaces, Classes, Forms, Dialogs, Buttons, StdCtrls, LazLogger; type TMainForm = class(TForm) @@ -70,7 +70,7 @@ end; procedure TMainForm.Button1Click(Sender : TObject); begin ShowMessage ('First simple test!'); - writeln('Go to second dialog'); + DebugLn('Go to second dialog'); MessageDlg ('Caption', 'Two buttons now ...', mtError, [mbOK,mbCancel], 0); MessageDlg ('Warning, not fully implemented', mtWarning, [mbYes, mbNo, mbOK,mbCancel], 0); ShowMessageFmt ('The show will end now'+LineEnding+'%s'+LineEnding+'Good bye!!!', [MainForm.Caption]); diff --git a/examples/notebku.pp b/examples/notebku.pp index 26952dbf56..e110cec0ff 100644 --- a/examples/notebku.pp +++ b/examples/notebku.pp @@ -275,26 +275,21 @@ end; procedure TForm1.Button1Click(Sender: TObject); begin - //writeln('Button 1 Clicked'); fNotebk.PageIndex := 0; end; procedure TForm1.Button2Click(Sender: TObject); begin - //writeln('Button 2 Clicked'); fNotebk.PageIndex := fNotebk.Pages.Count - 1; end; procedure TForm1.Button3Click(Sender: TObject); begin - //writeln('Close Button Clicked'); Close; end; procedure TForm1.Button4Click(Sender: TObject); begin - //writeln('Show/Hide Tabs Button Clicked'); - fNotebook.ShowTabs := not fNotebook.ShowTabs; if (fNotebook.ShowTabs) then fButton4.Caption := 'Hide Tabs' @@ -304,8 +299,6 @@ end; procedure TForm1.Button5Click(Sender: TObject); begin - //writeln('Delete Page Button Clicked'); - if (fNotebook.PageCount > 1) then begin // Make sure we don't delete the page with the delete button on it @@ -318,8 +311,6 @@ end; procedure TForm1.Button6Click(Sender: TObject); begin - //writeln('Set Tab Position Button Clicked'); - if fNotebook.TabPosition = tpTop then fNotebook.TabPosition := tpRight else if fNotebook.TabPosition = tpRight then diff --git a/examples/pascalstream/PascalStream1.lpi b/examples/pascalstream/PascalStream1.lpi index 550d2bb2f1..8252d6f9fc 100644 --- a/examples/pascalstream/PascalStream1.lpi +++ b/examples/pascalstream/PascalStream1.lpi @@ -1,24 +1,24 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <Version Value="7"/> + <Version Value="9"/> <General> <Flags> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> - <UseDefaultCompilerOptions Value="True"/> </Flags> <SessionStorage Value="InIDEConfig"/> <MainUnit Value="0"/> - <TargetFileExt Value=""/> <ResourceType Value="res"/> - <Icon Value="0"/> </General> <VersionInfo> <Language Value=""/> <CharSet Value=""/> - <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + <StringTable ProductVersion=""/> </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -59,19 +59,14 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="8"/> + <Version Value="11"/> <Target> <Filename Value="PascalStream1"/> </Target> <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)/"/> + <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <Parsing> - <SyntaxOptions> - <UseAnsiStrings Value="True"/> - </SyntaxOptions> - </Parsing> <Other> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/examples/pascalstream/unit1.pas b/examples/pascalstream/unit1.pas index d1396cbdbd..e5a0f37e81 100644 --- a/examples/pascalstream/unit1.pas +++ b/examples/pascalstream/unit1.pas @@ -261,21 +261,21 @@ var i: Integer; Item: TMyCollectionItem; begin - writeln('TMyComponent.WriteDebugReport '); - writeln(' MyDouble=',FMyDouble); - writeln(' MySingle=',FMySingle); - writeln(' MyEnum=',GetEnumName(TypeInfo(TMyEnum),ord(FMyEnum))); - writeln(' MySet=',HexStr(Cardinal(FMySet),8)); - writeln(' MyString=',FMyString); - writeln(' MyWideString=',FMyWideString); - writeln(' MyInteger=',FMyInteger); - writeln(' MyInt64=',FMyInt64); - writeln(' MyCollection.Count=',FMyCollection.Count); + debugln('TMyComponent.WriteDebugReport '); + debugln([' MyDouble=',FMyDouble]); + debugln([' MySingle=',FMySingle]); + debugln([' MyEnum=',GetEnumName(TypeInfo(TMyEnum),ord(FMyEnum))]); + debugln([' MySet=',HexStr(Cardinal(FMySet),8)]); + debugln([' MyString=',FMyString]); + debugln([' MyWideString=',FMyWideString]); + debugln([' MyInteger=',FMyInteger]); + debugln([' MyInt64=',FMyInt64]); + debugln([' MyCollection.Count=',FMyCollection.Count]); for i:=0 to FMyCollection.Count-1 do begin Item:=TMyCollectionItem(FMyCollection.Items[i]); - writeln(' ',i,' MyString=',Item.MyString); + debugln([' ',i,' MyString=',Item.MyString]); end; - //writeln(' MyStrings='+dbgstr(MyStrings.Text)); + //debugln([' MyStrings='+dbgstr(MyStrings.Text)]); end; procedure TMyComponent.GetChildren(Proc: TGetChildProc; Root: TComponent); diff --git a/examples/postscript/usamplepostscriptcanvas.pas b/examples/postscript/usamplepostscriptcanvas.pas index 402b94ce79..ce9a3ebc80 100644 --- a/examples/postscript/usamplepostscriptcanvas.pas +++ b/examples/postscript/usamplepostscriptcanvas.pas @@ -90,7 +90,6 @@ var procedure LineSample(txt:string); begin tmp := Pt2Pix(PsCanvas.Font.Size) div 2; - //WriteLn('LineSample: Y=',Y,' FontSize=', PsCanvas.Font.Size,' Pix=',tmp*2,' Spc= ',tmp,' Sy=',Sy(Tmp)); PsCanvas.Line(x+Sx(170),y+tmp,x+Sx(170+100),y+tmp); PsCanvas.TextOut(x,y,txt); inc(y,tmp*3); diff --git a/examples/scrollbar.pp b/examples/scrollbar.pp index 25fccc2dc6..5aabab7362 100644 --- a/examples/scrollbar.pp +++ b/examples/scrollbar.pp @@ -34,7 +34,7 @@ program Scrollbar; uses Interfaces, Classes, StdCtrls, Forms, Buttons, Menus, ComCtrls, - SysUtils, ExtCtrls, Controls; + SysUtils, ExtCtrls, Controls, LazLogger; type TForm1 = class(TFORM) @@ -130,8 +130,8 @@ End; Procedure TForm1.Button1Clicked(sender : tobject); Begin -Writeln('[Button1cvlikced]'); -if ScrollBar1.Kind = sbHorizontal then + debugln('[Button1Clicked]'); + if ScrollBar1.Kind = sbHorizontal then Scrollbar1.Kind := sbVertical else Scrollbar1.kind := sbHorizontal; @@ -161,7 +161,7 @@ End; Procedure TForm1.Scrollbar1OnScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); Begin -Writeln('.............Scrolled...............'); + DebugLn('.............Scrolled...............'); End; begin diff --git a/examples/speedtest.pp b/examples/speedtest.pp index ca11d9ee06..bf8fdabd7a 100644 --- a/examples/speedtest.pp +++ b/examples/speedtest.pp @@ -24,7 +24,7 @@ program SpeedTest; uses Interfaces, Forms, SysUtils, Buttons, Classes, StdCtrls, LCLType, - LCLIntf, Graphics; + LCLIntf, Graphics, LazLogger; type TForm1 = class(TForm) @@ -165,12 +165,12 @@ var begin - WriteLN('------ INIT ------- '); + debugln('------ INIT ------- '); Application.Initialize; { calls InitProcedure which starts up GTK } - WriteLN('------ CREATE ------- '); + debugln('------ CREATE ------- '); Application.CreateForm(TForm1, Form1); - WriteLN('------ RUN ------- '); + debugln('------ RUN ------- '); Application.Run; - WriteLN('------ DONE ------- '); + DebugLn('------ DONE ------- '); end. diff --git a/examples/sprites/playground.pas b/examples/sprites/playground.pas index 35bff65cff..baa2f98da0 100644 --- a/examples/sprites/playground.pas +++ b/examples/sprites/playground.pas @@ -101,7 +101,6 @@ begin // paint first on the buffer // paint background - //writeln('TPlayGroundForm.UpdateImage A'); BufferImg.Canvas.CopyRect(Rect(0,0,BufferImg.Width,BufferImg.Height), BackgroundImg.Canvas,Rect(0,0,BackgroundImg.Width,BackgroundImg.Height)); // paint sprite @@ -110,16 +109,13 @@ begin t:=Now*86400; x:=CenterX+round(cos(t)*CenterX*2/3)-(SpriteImg.Width div 2); y:=CenterY+round(sin(t*0.7)*CenterY*2/3)-(SpriteImg.Height div 2); - //writeln('TPlayGroundForm.UpdateImage B ',x,',',y,' ',t); BufferImg.Canvas.Draw(x, y, SpriteImg); - //writeln('TPlayGroundForm.UpdateImage C'); // copy to image DestImg:=PictureControl.Picture.Bitmap; DestImg.Width:=BufferImg.Width; DestImg.Height:=BufferImg.Height; DestImg.Canvas.Draw(0,0,BufferImg); - //writeln('TPlayGroundForm.UpdateImage D'); end; { TPictureControl } diff --git a/examples/toolbar.pp b/examples/toolbar.pp index 963b4c82d4..0fcd23d842 100644 --- a/examples/toolbar.pp +++ b/examples/toolbar.pp @@ -35,7 +35,7 @@ program Toolbar; uses Interfaces, Classes, StdCtrls, Forms, Buttons, Menus, ComCtrls, - SysUtils, ExtCtrls, Controls; + SysUtils, ExtCtrls, Controls, LazLogger; type TForm1 = class(TFORM) @@ -127,23 +127,23 @@ end; Procedure TFORM1.Button1Click(Sender : TObject); Begin -Writeln('******************'); -Writeln('Toolbar button 1 clicked!'); -Writeln('******************'); + debugln('******************'); + debugln('Toolbar button 1 clicked!'); + debugln('******************'); end; Procedure TFORM1.Button2Click(Sender : TObject); Begin -Writeln('******************'); -Writeln('Toolbar button 2 clicked!'); -Writeln('******************'); + debugln('******************'); + debugln('Toolbar button 2 clicked!'); + debugln('******************'); end; Procedure TFORM1.Button3Click(Sender : TObject); Begin -Writeln('******************'); -Writeln('Toolbar button 3 clicked!'); -Writeln('******************'); + DebugLn('******************'); + debugln('Toolbar button 3 clicked!'); + debugln('******************'); end; diff --git a/examples/trackbar.lpi b/examples/trackbar.lpi index ab67957555..b35a011fc7 100644 --- a/examples/trackbar.lpi +++ b/examples/trackbar.lpi @@ -1,28 +1,18 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="5"/> + <Version Value="9"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <MainUnit Value="0"/> - <TargetFileExt Value=""/> - <ActiveEditorIndexAtStart Value="0"/> + <ActiveWindowIndexAtStart Value="0"/> </General> - <Units Count="1"> - <Unit0> - <CursorPos X="24" Y="26"/> - <EditorIndex Value="0"/> - <Filename Value="trackbar.pp"/> - <IsPartOfProject Value="True"/> - <Loaded Value="True"/> - <TopLine Value="1"/> - <UnitName Value="Trackbar"/> - <UsageCount Value="20"/> - </Unit0> - </Units> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -40,15 +30,32 @@ <PackageName Value="LCL"/> </Item1> </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="trackbar.pp"/> + <IsPartOfProject Value="True"/> + <UnitName Value="Trackbar"/> + <IsVisibleTab Value="True"/> + <EditorIndex Value="0"/> + <WindowIndex Value="0"/> + <TopLine Value="92"/> + <CursorPos X="16" Y="113"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + <LoadedDesigner Value="True"/> + </Unit0> + </Units> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="11"/> <SearchPaths> - <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> + <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)"/> </SearchPaths> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> + <Parsing> + <SyntaxOptions> + <UseAnsiStrings Value="False"/> + </SyntaxOptions> + </Parsing> <Linking> <Options> <Win32> @@ -60,4 +67,5 @@ <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> + <EditorMacros Count="0"/> </CONFIG> diff --git a/examples/trackbar.pp b/examples/trackbar.pp index 7a7b854f43..a798e69182 100644 --- a/examples/trackbar.pp +++ b/examples/trackbar.pp @@ -40,7 +40,7 @@ program Trackbar; uses Interfaces, Classes, Forms, Buttons, StdCtrls, Menus, ComCtrls, - SysUtils, Controls; + SysUtils, Controls, LazLogger; type TForm1 = class(TFORM) @@ -102,7 +102,7 @@ End; procedure TForm1.Button3Click(Sender : TObject); Begin if assigned (Track1) then begin - writeln ('Setting new position'); + debugln ('Setting new position'); Track1.Position := Track1.Position + 1; end; End; @@ -110,7 +110,7 @@ End; procedure TForm1.Button4Click(Sender : TObject); Begin if assigned (Track1) then begin - writeln ('Setting new position for scale. Old:', ord (Track1.ScalePos)); + debugln (['Setting new position for scale. Old:', ord (Track1.ScalePos)]); case Track1.ScalePos of trLeft : Track1.ScalePos := trRight; trRight : Track1.ScalePos := trTop; @@ -123,7 +123,7 @@ End; procedure TForm1.Button5Click(Sender : TObject); Begin if assigned (Track1) then begin - writeln ('Toggling showing tickmarks'); + debugln ('Toggling showing tickmarks'); if Track1.TickStyle = tsNone then Track1.TickStyle := tsAuto else Track1.TickStyle := tsNone; @@ -139,7 +139,7 @@ End; procedure TForm1.Button7Click(Sender : TObject); Begin if assigned (Track1) then begin - writeln ('Incrementing LineSize'); + debugln ('Incrementing LineSize'); Track1.LineSize := Track1.LineSize + 1; end; End; @@ -147,7 +147,7 @@ End; procedure TForm1.Button8Click(Sender : TObject); Begin if assigned (Track1) then begin - writeln ('Incrementing PageSize'); + debugln ('Incrementing PageSize'); Track1.PageSize := Track1.PageSize + 1; end; End; @@ -155,7 +155,7 @@ End; procedure TForm1.Track1Change(Sender : TObject); begin if assigned (Track1) then begin - writeln ('*** CALLBACK ONCHANGE!!!!! ***'); + DebugLn ('*** CALLBACK ONCHANGE!!!!! ***'); Track1.PageSize := Track1.PageSize + 1; end; end; diff --git a/examples/treeview/tv_add_remove_u1.pas b/examples/treeview/tv_add_remove_u1.pas index ba8469c6fe..327403604b 100644 --- a/examples/treeview/tv_add_remove_u1.pas +++ b/examples/treeview/tv_add_remove_u1.pas @@ -52,7 +52,7 @@ begin with tv_eg1.Items.AddFirst( nil, 'Root' ) do begin Selected := true; - writeln('tv_eg1.Selected=',DbgS(tv_eg1.Selected)); + debugln('tv_eg1.Selected=',DbgS(tv_eg1.Selected)); end; end else begin diff --git a/examples/xmlstreaming/mainunit.pas b/examples/xmlstreaming/mainunit.pas index 5f05bdefb8..901d4471f2 100644 --- a/examples/xmlstreaming/mainunit.pas +++ b/examples/xmlstreaming/mainunit.pas @@ -367,21 +367,21 @@ var i: Integer; Item: TMyCollectionItem; begin - writeln('TMyComponent.WriteDebugReport '); - writeln(' MyDouble=',MyDouble); - writeln(' MySingle=',MySingle); - writeln(' MyEnum=',GetEnumName(TypeInfo(TMyEnum),ord(MyEnum))); - writeln(' MySet=',HexStr(Cardinal(MySet),8)); - writeln(' MyString=',MyString); - writeln(' MyWideString=',MyWideString); - writeln(' MyInteger=',MyInteger); - writeln(' MyInt64=',MyInt64); - writeln(' MyCollection.Count=',MyCollection.Count); + debugln('TMyComponent.WriteDebugReport '); + debugln([' MyDouble=',MyDouble]); + debugln([' MySingle=',MySingle]); + debugln([' MyEnum=',GetEnumName(TypeInfo(TMyEnum),ord(MyEnum))]); + debugln([' MySet=',HexStr(Cardinal(MySet),8)]); + debugln([' MyString=',MyString]); + debugln([' MyWideString=',MyWideString]); + debugln([' MyInteger=',MyInteger]); + debugln([' MyInt64=',MyInt64]); + debugln([' MyCollection.Count=',MyCollection.Count]); for i:=0 to MyCollection.Count-1 do begin Item:=TMyCollectionItem(MyCollection.Items[i]); - writeln(' ',i,' MyString=',Item.MyString); + debugln([' ',i,' MyString=',Item.MyString]); end; - writeln(' MyStrings='+dbgstr(MyStrings.Text)); + debugln([' MyStrings='+dbgstr(MyStrings.Text)]); end; { TMyGroupBox }