summaryrefslogtreecommitdiff
path: root/examples/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-02 14:37:56 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-02 14:37:56 +0000
commit958d5a73445966ae2d603155b065742806fb214c (patch)
tree829de873838c9604aba1e8f56c1166f1920a8bdb /examples/gui
parent6bf99bfc8d520e299e6ebe81573f4e40ee6d708b (diff)
downloadfpGUI-958d5a73445966ae2d603155b065742806fb214c.tar.xz
* More work has been done to the PageControl. It looks like a PageControl, but doesn't function yet.
* Minor changes to TrackBar widget. * Surfaced the SetPosition method in TfpgWidget to public. * Created a new example project for the PageControl.
Diffstat (limited to 'examples/gui')
-rw-r--r--examples/gui/tabtest/tabtest.lpi53
-rw-r--r--examples/gui/tabtest/tabtest.lpr77
2 files changed, 130 insertions, 0 deletions
diff --git a/examples/gui/tabtest/tabtest.lpi b/examples/gui/tabtest/tabtest.lpi
new file mode 100644
index 00000000..836169e0
--- /dev/null
+++ b/examples/gui/tabtest/tabtest.lpi
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <PathDelim Value="/"/>
+ <Version Value="5"/>
+ <General>
+ <Flags>
+ <SaveOnlyProjectUnits Value="True"/>
+ </Flags>
+ <SessionStorage Value="InProjectDir"/>
+ <MainUnit Value="0"/>
+ <TargetFileExt Value=""/>
+ </General>
+ <VersionInfo>
+ <ProjectVersion Value=""/>
+ </VersionInfo>
+ <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="fpgui_package"/>
+ <MinVersion Minor="5" Valid="True"/>
+ </Item1>
+ </RequiredPackages>
+ <Units Count="1">
+ <Unit0>
+ <Filename Value="tabtest.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="tabtest"/>
+ </Unit0>
+ </Units>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CustomOptions Value="-FUunits"/>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+</CONFIG>
diff --git a/examples/gui/tabtest/tabtest.lpr b/examples/gui/tabtest/tabtest.lpr
new file mode 100644
index 00000000..ab3381cc
--- /dev/null
+++ b/examples/gui/tabtest/tabtest.lpr
@@ -0,0 +1,77 @@
+program tabtest;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, fpgfx, gfx_widget, gfxbase, gui_form, gui_tab, gui_button,
+ fpgui_package;
+
+type
+ TMainForm = class(TfpgForm)
+ private
+ btnQuit: TfpgButton;
+ pcMain: TfpgPageControl;
+ tsOne: TfpgTabSheet;
+ tsTwo: TfpgTabSheet;
+ tsThree: TfpgTabSheet;
+ procedure btnQuitClick(Sender: TObject);
+ public
+ constructor Create(AOwner: TComponent); override;
+ end;
+
+{ TMainForm }
+
+procedure TMainForm.btnQuitClick(Sender: TObject);
+begin
+ Close;
+end;
+
+constructor TMainForm.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ WindowTitle := 'Tab control test';
+ SetPosition(100, 100, 566, 350);
+
+ btnQuit := CreateButton(self, 476, 320, 80, 'Quit', @btnQuitClick);
+ btnQuit.ImageName := 'stdimg.Quit';
+ btnQuit.ShowImage := True;
+ btnQuit.Anchors := [anRight, anBottom];
+
+ pcMain := TfpgPageControl.Create(self);
+ pcMain.Top := 10;
+ pcMain.Left := 10;
+ pcMain.Width := Width - 20;
+ pcMain.Height := 300;
+ pcMain.Anchors := [anLeft, anTop, anRight, anBottom];
+
+ tsOne := TfpgTabSheet.Create(pcMain);
+ tsOne.Text := 'Tab One';
+ tsOne.Top := 50;
+
+ tsTwo := TfpgTabSheet.Create(pcMain);
+ tsTwo.Text := 'Tab Two';
+ tsTwo.Top := 50;
+
+ tsThree := TfpgTabSheet.Create(pcMain);
+ tsThree.Text := 'Tab Three';
+ tsThree.Top := 50;
+
+end;
+
+procedure MainProc;
+var
+ frm: TMainForm;
+begin
+ fpgApplication.Initialize;
+ frm := TMainForm.Create(nil);
+ frm.Show;
+ fpgApplication.Run;
+end;
+
+begin
+ MainProc;
+end.
+