From 594a6a445ca92fb76f8f971d707f6c4b9901692a Mon Sep 17 00:00:00 2001 From: graemeg Date: Wed, 10 Oct 2007 10:54:38 +0000 Subject: * 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. --- src/corelib/gfx_widget.pas | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/corelib/gfx_widget.pas') 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; -- cgit v1.2.3-70-g09d2