summaryrefslogtreecommitdiff
path: root/src/gui/gui_panel.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-04 10:19:29 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-04 10:19:29 +0000
commit1483bd8c7494635cbf7881ec56530b3551aae1af (patch)
tree68c1379eb717da7b779c509038feee033f4b921e /src/gui/gui_panel.pas
parent2d545ff910bde8b83ccfab2714d2ef89c5dff181 (diff)
downloadfpGUI-1483bd8c7494635cbf7881ec56530b3551aae1af.tar.xz
* Applied a patch from Luiz Americo which fixes some alignment issues inside TfpgPanel.
* I implemented more alignment fixes for TfpgGroupBox and TfpgBevel. * I improved the painting of the focus rectangle it TfpgCheckBox and TfpgRadioButton. * UI Designer's Unknown widget can now act like a container component.
Diffstat (limited to 'src/gui/gui_panel.pas')
-rw-r--r--src/gui/gui_panel.pas16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/gui_panel.pas b/src/gui/gui_panel.pas
index d25271a6..2e4280c5 100644
--- a/src/gui/gui_panel.pas
+++ b/src/gui/gui_panel.pas
@@ -38,11 +38,13 @@ type
TPanelBorder = (bsSingle, bsDouble);
+
TfpgAbstractPanel = class(TfpgWidget)
private
FPanelShape: TPanelShape;
FPanelStyle: TPanelStyle;
FPanelBorder: TPanelBorder;
+ function GetClientBounds: TfpgRect; override;
procedure SetPanelStyle(const AValue: TPanelStyle);
procedure SetPanelBorder(const AValue: TPanelBorder);
protected
@@ -128,6 +130,7 @@ type
procedure SetMargin(const AValue: integer);
protected
FFont: TfpgFont;
+ function GetClientBounds: TfpgRect; override;
procedure HandlePaint; override;
public
constructor Create(AOwner: TComponent); override;
@@ -205,6 +208,11 @@ end;
{TfpgAbstractPanel}
+function TfpgAbstractPanel.GetClientBounds: TfpgRect;
+begin
+ Result.SetRect(2, 2, Width - 4, Height - 4);
+end;
+
procedure TfpgAbstractPanel.SetPanelStyle(const AValue: TPanelStyle);
begin
if FPanelStyle <> AValue then
@@ -538,6 +546,14 @@ begin
end;
end;
+function TfpgGroupBox.GetClientBounds: TfpgRect;
+var
+ h: integer;
+begin
+ h := FFont.Height + 4;
+ Result.SetRect(2, h, Width - 4, Height - (h + 2));
+end;
+
procedure TfpgGroupBox.HandlePaint;
var
r: TfpgRect;