diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-27 14:50:37 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-27 14:50:37 +0000 |
commit | 79f3d57b899e797fe9acc116146bf64e0327deb9 (patch) | |
tree | a02e2380024dc329a7872bc33e700f7f01f061dd /prototypes/fpgui2 | |
parent | 3abd19af870b83175359c2e1e0af063123d14635 (diff) | |
download | fpGUI-79f3d57b899e797fe9acc116146bf64e0327deb9.tar.xz |
X11 only:
* Fixed a bug in the SetLineStyle which caused
inaccurate line drawing. This eluded me for ages.
* Started the process of removing TfpgRect and replacing
it with the standard Object Pascal TRect.
* Started updating some methods to rather use two sets
of coordinates instead of width and height.
* Added a new test to verify drawing accuracy
* Implemented more line styles under X11
* Fixed up painting issues in widgets (Scrollbar and Memo
are still outstanding)
* Added three new helper functions for use with TRect in
fpgfx.pas (InflateRect, CentrePoint, OffsetRect).
Diffstat (limited to 'prototypes/fpgui2')
-rw-r--r-- | prototypes/fpgui2/tests/edittest.dpr | 13 | ||||
-rw-r--r-- | prototypes/fpgui2/tests/edittest.lpi | 7 |
2 files changed, 8 insertions, 12 deletions
diff --git a/prototypes/fpgui2/tests/edittest.dpr b/prototypes/fpgui2/tests/edittest.dpr index 444192d8..77234ddd 100644 --- a/prototypes/fpgui2/tests/edittest.dpr +++ b/prototypes/fpgui2/tests/edittest.dpr @@ -92,7 +92,7 @@ end; procedure TXPButton.HandlePaint; var x, i: integer; - r: TfpgRect; + r: TRect; iy, y: integer; w: integer; pofs: integer; @@ -102,6 +102,8 @@ begin Canvas.ClearClipRect; Canvas.Clear(clButtonFace); + r := Rect(0, 0, Width, Height); + if State <> 1 then begin if Down then @@ -127,7 +129,8 @@ begin begin Canvas.SetColor(clText1); Canvas.SetLineStyle(1, lsDot); - Canvas.DrawRectangle(3, 3, Width - 6, Height - 6); + InflateRect(r, -3, -3); + Canvas.DrawRectangle(r); end else begin @@ -138,12 +141,7 @@ begin if not Enabled then Canvas.SetTextColor(clShadow1); - r.left := 2; - r.top := 2; - r.Width := Width - 4; - r.Height := Height - 4; Canvas.SetClipRect(r); - Canvas.SetFont(Font); y := Height div 2 - FFont.Height div 2; if y < 3 then @@ -192,7 +190,6 @@ begin x := 3; Canvas.DrawString(x + pofs, y + pofs, FText); - Canvas.EndDraw; end; diff --git a/prototypes/fpgui2/tests/edittest.lpi b/prototypes/fpgui2/tests/edittest.lpi index b609d403..1ecb384f 100644 --- a/prototypes/fpgui2/tests/edittest.lpi +++ b/prototypes/fpgui2/tests/edittest.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=""/> </General> <VersionInfo> @@ -23,7 +23,7 @@ <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"> @@ -42,7 +42,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> |