diff --git a/.gitattributes b/.gitattributes index 33dd810e2a..6de390b2bb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -439,6 +439,11 @@ examples/address_book/mybook.dbf svneol=native#unset examples/address_book/mybook.mdx svneol=native#unset examples/address_book/mybook2.dbf svneol=native#unset examples/address_book/mybook2.mdx svneol=native#unset +examples/barchart/chartdemo.lpi svneol=native#text/plain +examples/barchart/chartdemo.lpr svneol=native#text/pascal +examples/barchart/frmmain.lfm svneol=native#text/plain +examples/barchart/frmmain.lrs svneol=native#text/pascal +examples/barchart/frmmain.pas svneol=native#text/pascal examples/bitbtnform.pp svneol=native#text/pascal examples/bitbutton.pp svneol=native#text/pascal examples/checkbox.pp svneol=native#text/pascal diff --git a/examples/barchart/chartdemo.lpi b/examples/barchart/chartdemo.lpi new file mode 100644 index 0000000000..f499fdaa75 --- /dev/null +++ b/examples/barchart/chartdemo.lpi @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + </General> + <Units Count="2"> + <Unit0> + <Filename Value="chartdemo.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="chartdemo"/> + <UsageCount Value="20"/> + </Unit0> + <Unit1> + <CursorPos X="71" Y="8"/> + <EditorIndex Value="0"/> + <Filename Value="frmmain.pas"/> + <ComponentName Value="Form1"/> + <IsPartOfProject Value="True"/> + <Loaded Value="True"/> + <ResourceFilename Value="frmmain.lrs"/> + <TopLine Value="1"/> + <UnitName Value="frmmain"/> + <UsageCount Value="20"/> + </Unit1> + </Units> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="LCL"/> + <MinVersion Major="1" Valid="True"/> + </Item1> + </RequiredPackages> + </ProjectOptions> + <CompilerOptions> + <Version Value="2"/> + <SearchPaths> + <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> + </SearchPaths> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/examples/barchart/chartdemo.lpr b/examples/barchart/chartdemo.lpr new file mode 100644 index 0000000000..c235e65d05 --- /dev/null +++ b/examples/barchart/chartdemo.lpr @@ -0,0 +1,14 @@ +program chartdemo; + +{$mode objfpc}{$H+} + +uses + Interfaces, + Forms, frmmain; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/examples/barchart/frmmain.lfm b/examples/barchart/frmmain.lfm new file mode 100644 index 0000000000..64418b78d8 --- /dev/null +++ b/examples/barchart/frmmain.lfm @@ -0,0 +1,25 @@ +object Form1: TForm1 + Caption = 'Form1' + ClientHeight = 300 + ClientWidth = 400 + OnShow = Form1Show + PixelsPerInch = 90 + HorzScrollBar.Page = 401 + VertScrollBar.Page = 301 + Left = 440 + Height = 300 + Top = 209 + Width = 400 + object BarChart1: TBarChart + Depth = 20 + Caption = 'My Data' + ClientHeight = 256 + ClientWidth = 368 + FullRepaint = False + TabOrder = 0 + Left = 16 + Height = 256 + Top = 16 + Width = 368 + end +end diff --git a/examples/barchart/frmmain.lrs b/examples/barchart/frmmain.lrs new file mode 100644 index 0000000000..8655736c5f --- /dev/null +++ b/examples/barchart/frmmain.lrs @@ -0,0 +1,11 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TForm1','FORMDATA',[ + 'TPF0'#6'TForm1'#5'Form1'#7'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'Cl' + +'ientWidth'#3#144#1#6'OnShow'#7#9'Form1Show'#13'PixelsPerInch'#2'Z'#18'HorzS' + +'crollBar.Page'#3#145#1#18'VertScrollBar.Page'#3'-'#1#4'Left'#3#184#1#6'Heig' + +'ht'#3','#1#3'Top'#3#209#0#5'Width'#3#144#1#0#9'TBarChart'#9'BarChart1'#5'De' + +'pth'#2#20#7'Caption'#6#7'My Data'#12'ClientHeight'#3#0#1#11'ClientWidth'#3 + +'p'#1#11'FullRepaint'#8#8'TabOrder'#2#0#4'Left'#2#16#6'Height'#3#0#1#3'Top'#2 + +#16#5'Width'#3'p'#1#0#0#0 +]); diff --git a/examples/barchart/frmmain.pas b/examples/barchart/frmmain.pas new file mode 100644 index 0000000000..baa6d45808 --- /dev/null +++ b/examples/barchart/frmmain.pas @@ -0,0 +1,40 @@ +unit frmmain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, chart; + +type + TForm1 = class(TForm) + BarChart1: TBarChart; + procedure Form1Show(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation + +{ TForm1 } + +procedure TForm1.Form1Show(Sender: TObject); +begin + BarChart1.AddBar('1999',200,clGreen); + BarChart1.AddBar('2000',100,clred); + BarChart1.AddBar('2001',300,clred); + BarChart1.AddBar('2003',400,clGreen); + BarChart1.AddBar('2004',400,clGreen); +end; + +initialization + {$I frmmain.lrs} + +end. +