diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-23 11:17:05 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-23 11:17:05 +0000 |
commit | c9be342c9263cd72b93fc54ba90330152844d0c3 (patch) | |
tree | 10ae7ad84f8fce30b2084d1cbf6461b8ec4e64ec /examples/gui/imgtest | |
parent | cd81d8061e71fffb318c8669d2c310206bf5f2a9 (diff) | |
download | fpGUI-c9be342c9263cd72b93fc54ba90330152844d0c3.tar.xz |
Restructure Part 5.
* Created new packages for Corelib and GUI.
* Updated all examples to use the new packages.
Restructure should now be complete.
Diffstat (limited to 'examples/gui/imgtest')
-rw-r--r-- | examples/gui/imgtest/bitmaptest.dpr | 36 | ||||
-rw-r--r-- | examples/gui/imgtest/bitmaptest.lpi | 15 |
2 files changed, 19 insertions, 32 deletions
diff --git a/examples/gui/imgtest/bitmaptest.dpr b/examples/gui/imgtest/bitmaptest.dpr index 8ab86361..c8000d15 100644 --- a/examples/gui/imgtest/bitmaptest.dpr +++ b/examples/gui/imgtest/bitmaptest.dpr @@ -7,46 +7,40 @@ uses SysUtils, gfxbase, fpgfx, - gfx_imgfmt_bmp; + gfx_imgfmt_bmp, + gui_form; type - TMainForm = class(TfpgWindow) + TMainForm = class(TfpgForm) private img: TfpgImage; - procedure MsgPaint(var msg: TfpgMessageRec); message FPGM_PAINT; - procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE; + protected + procedure HandlePaint; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure Show; end; { TMainForm } -procedure TMainForm.MsgPaint(var msg: TfpgMessageRec); +procedure TMainForm.HandlePaint; begin - Canvas.BeginDraw; + Canvas.BeginDraw; // activate double buffering in time. + inherited HandlePaint; Canvas.DrawImage(0, 0, img); Canvas.EndDraw; end; -procedure TMainForm.MsgClose(var msg: TfpgMessageRec); -begin - ReleaseWindowHandle; - Halt(0); -end; - constructor TMainForm.Create(AOwner: TComponent); var i, j: integer; begin inherited Create(AOwner); - FWidth := 256; - FHeight := 256; - WindowAttributes := [waScreenCenterPos]; - + SetPosition(100, 100, 256, 256); + WindowTitle := 'fpGUI Bitmap Test'; + img := TfpgImage.Create; img.AllocateImage(32, 256, 256); img.UpdateImage; @@ -62,13 +56,6 @@ begin inherited Destroy; end; -procedure TMainForm.Show; -begin - AllocateWindowHandle; - // We can only set the title once we have a window handle. - SetWindowTitle('fpGUI Bitmap Test'); -end; - procedure MainProc; var @@ -80,6 +67,7 @@ begin fpgApplication.Run; end; + begin MainProc; end. diff --git a/examples/gui/imgtest/bitmaptest.lpi b/examples/gui/imgtest/bitmaptest.lpi index c8bf98e0..de1157a5 100644 --- a/examples/gui/imgtest/bitmaptest.lpi +++ b/examples/gui/imgtest/bitmaptest.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -9,7 +9,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value=".\"/> + <IconPath Value="./"/> <TargetFileExt Value=""/> <Title Value="bitmaptest"/> </General> @@ -18,19 +18,19 @@ </VersionInfo> <PublishOptions> <Version Value="2"/> - <DestinationDirectory Value="$(TestDir)\publishedproject\"/> <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)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="fpGFX2"/> + <PackageName Value="fpgui_package"/> + <MinVersion Minor="5" Valid="True"/> </Item1> </RequiredPackages> <Units Count="1"> @@ -43,10 +43,9 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <SearchPaths> - <IncludeFiles Value="..\source\"/> - <OtherUnitFiles Value="..\source\;..\source\x11\;..\gui\"/> + <IncludeFiles Value="../source/"/> + <OtherUnitFiles Value="../source/;../source/x11/;../gui/"/> </SearchPaths> <CodeGeneration> <Generate Value="Faster"/> |