diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-08 14:26:10 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-08 14:26:10 +0000 |
commit | e94ba620f4168468bb3e1826cac641bb4a369c09 (patch) | |
tree | 1fb70141bff75e93e279b498f057d52b6cf90aa2 /src/gui/gui_tab.pas | |
parent | b19a28c30e51a0603560b7d24fc7fae887400790 (diff) | |
download | fpGUI-e94ba620f4168468bb3e1826cac641bb4a369c09.tar.xz |
* Finally fixed all painting issues with rectangles and clipping.
* Reverted the methods back to using TfpgRect instead of TRect. TfpgRect has better
support for Width and Heigh - required by many Canvas methods.
* Implemented helper functions like InflateRect but support TfpgRect
* Fixed all painting issues and rectangle sizes in all components.
* Fixed up all examples and test projects to compile and work correctly.
* Fixes some clip rectangle issues under Linux. TfpgRect was a big help.
* Changed the method signatures of many Canvas methods to rather use x, y, width and height.
This causes much less confusion and actually less coding in widgets.
Diffstat (limited to 'src/gui/gui_tab.pas')
-rw-r--r-- | src/gui/gui_tab.pas | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas index 5750cad3..3e7bb85b 100644 --- a/src/gui/gui_tab.pas +++ b/src/gui/gui_tab.pas @@ -409,7 +409,7 @@ end; procedure TfpgPageControl.RePaintTitles; var i: integer; - r: TRect; + r: TfpgRect; h: TfpgTabSheet; lp: integer; toffset: integer; @@ -433,27 +433,27 @@ begin FFirstTabButton := h else h := FFirstTabButton; - r := Rect(FMargin, FMargin, Width - FMargin * 2 - FRightButton.Width * 2 - 1, FRightButton.Height); + r.SetRect(FMargin, FMargin, Width-(FMargin*2)-(FRightButton.Width*2)-1, FRightButton.Height); FLeftButton.SetPosition(Width - FMargin * 2 - FRightButton.Width * 2, FMargin, FRightButton.Height, FRightButton.Height); FRightButton.SetPosition(Width - FMargin * 2 - FrightButton.Width, FMargin, FRightButton.Height, FRightButton.Height); - FLeftButton.Visible := True; - FRightButton.Visible := True; + FLeftButton.Visible := True; + FRightButton.Visible := True; end else begin - r := Rect(FMargin, FMargin, Width - (FMargin*2), ButtonHeight); - FLeftButton.Visible := False; - FRightButton.Visible := False; + r.SetRect(FMargin, FMargin, Width-(FMargin*2), ButtonHeight); + FLeftButton.Visible := False; + FRightButton.Visible := False; end; Canvas.SetColor(clHilite1); - Canvas.DrawLine(FMargin, ButtonHeight, FMargin, Height - FMargin * 2); + Canvas.DrawLine(FMargin, ButtonHeight, FMargin, Height-(FMargin*2)); Canvas.SetColor(clHilite2); - Canvas.DrawLine(FMargin+1, ButtonHeight+1, FMargin+1, Height - FMargin * 2 - 1); + Canvas.DrawLine(FMargin+1, ButtonHeight+1, FMargin+1, Height - (FMargin*2) - 1); Canvas.SetColor(clShadow2); - Canvas.DrawLine(FMargin, Height - FMargin * 2, Width - FMargin * 2, Height - FMargin * 2); + Canvas.DrawLine(FMargin, Height - (FMargin*2), Width - (FMargin*2), Height - (FMargin*2)); Canvas.DrawLine(Width - FMargin - 1, FMargin + ButtonHeight - 1, Width - FMargin - 1, Height - FMargin); Canvas.SetColor(clShadow1); - Canvas.DrawLine(FMargin + 1, Height - FMargin * 2 - 1, Width - FMargin * 2 - 1, Height - FMargin * 2 - 1); + Canvas.DrawLine(FMargin + 1, Height - (FMargin*2) - 1, Width - (FMargin*2) - 1, Height - (FMargin*2) - 1); Canvas.DrawLine(Width - FMargin - 2, FMargin + ButtonHeight - 1, Width - FMargin - 2, Height - FMargin - 2); Canvas.SetClipRect(r); lp := 0; @@ -474,7 +474,7 @@ begin begin toffset := 2; h.Visible := True; - h.SetPosition(FMargin+2, FMargin + ButtonHeight, Width - FMargin * 2 - 4, Height - FMargin * 2 - ButtonHeight - 2); + h.SetPosition(FMargin+2, FMargin + ButtonHeight, Width - (FMargin*2) - 4, Height - (FMargin*2) - ButtonHeight - 2); Canvas.SetColor(clHilite1); Canvas.DrawLine(lp + FMargin, FMargin, lp + FMargin + ButtonWidth(h.Text)-1, FMargin); Canvas.DrawLine(lp + FMargin, FMargin, lp + FMargin, FMargin + ButtonHeight - 2); |