summaryrefslogtreecommitdiff
path: root/src/corelib/gfx_widget.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-10 10:54:38 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-10 10:54:38 +0000
commit594a6a445ca92fb76f8f971d707f6c4b9901692a (patch)
treed07ed4afffd87cb94d1b265dbbe1956dbb7e7f86 /src/corelib/gfx_widget.pas
parent9b9092ae02ce595d1895506206d4321bc7e57af4 (diff)
downloadfpGUI-594a6a445ca92fb76f8f971d707f6c4b9901692a.tar.xz
* Resizing widgets now take into account the MinWidth and MinHeight
properties. In affect you now cannot resize components into the negative with the UI Designer. * UI Designer: On deleting a component from a form, resets the Object Inspector. * Fixed 'division by zero' errors for the ListView and Memo components when they get resized to smaller that 2x2 pixels in size.
Diffstat (limited to 'src/corelib/gfx_widget.pas')
-rw-r--r--src/corelib/gfx_widget.pas11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas
index 8e5a1945..728be6b3 100644
--- a/src/corelib/gfx_widget.pas
+++ b/src/corelib/gfx_widget.pas
@@ -119,6 +119,9 @@ function FindKeyboardFocus: TfpgWidget;
implementation
+uses
+ math;
+
{ Double click support }
const
@@ -782,10 +785,10 @@ var
dw: integer;
dh: integer;
begin
- dw := awidth - FWidth;
- dh := aheight - FHeight;
- FWidth := awidth;
- FHeight := aheight;
+ dw := awidth - FWidth;
+ dh := aheight - FHeight;
+ FWidth := Max(awidth, FMinWidth);
+ FHeight := Max(aheight, FMinHeight);
HandleAlignments(dw, dh);
end;