mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 05:55:54 +02:00
examples: fixed compilation, removed writeln
git-svn-id: trunk@38134 -
This commit is contained in:
parent
ef38ed2d21
commit
a6a9b39dab
@ -16,7 +16,6 @@
|
||||
</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"/>
|
||||
@ -40,11 +39,11 @@
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="226"/>
|
||||
<CursorPos X="20" Y="243"/>
|
||||
<TopLine Value="102"/>
|
||||
<CursorPos X="10" Y="123"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="4" Y="245" ID="1"/>
|
||||
<Item0 X="4" Y="242" ID="1"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -52,7 +51,7 @@
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="9"/>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
@ -70,4 +69,5 @@
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<EditorMacros Count="0"/>
|
||||
</CONFIG>
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -1,19 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="/"/>
|
||||
<Version Value="6"/>
|
||||
<Version Value="9"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<SaveClosedFiles Value="False"/>
|
||||
<SaveOnlyProjectUnits Value="True"/>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<Title Value="project1"/>
|
||||
<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>
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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 }
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user