summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-06-08 10:57:49 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-06-08 10:57:49 +0200
commitb351e9f2058c42bfbc9089600e31b336305037e8 (patch)
treec5ee00148f7f914bd497f455d947c330cb711e64 /examples
parent9fc3070cec35073db340cfc5b836ceae05ea99c8 (diff)
downloadfpGUI-b351e9f2058c42bfbc9089600e31b336305037e8.tar.xz
Updated stdimglist demo.
Anchoring of button didn't work because it was created in constructor before complete size of Form was set. Anchoring doesn't work when csLoading is in ComponentState - this is by design (for loading streamed forms, etc).
Diffstat (limited to 'examples')
-rw-r--r--examples/gui/stdimages/stdimglist.lpr18
1 files changed, 7 insertions, 11 deletions
diff --git a/examples/gui/stdimages/stdimglist.lpr b/examples/gui/stdimages/stdimglist.lpr
index c70f6a0d..09e57990 100644
--- a/examples/gui/stdimages/stdimglist.lpr
+++ b/examples/gui/stdimages/stdimglist.lpr
@@ -15,7 +15,6 @@ type
protected
procedure HandlePaint; override;
public
- constructor Create(aowner: TComponent); override;
procedure AfterCreate; override;
end;
@@ -25,6 +24,13 @@ procedure TMainForm.AfterCreate;
begin
SetPosition(100,100,700,500);
WindowTitle := 'fpGUI Standard Image Listing';
+ WindowPosition := wpOneThirdDown;
+ MinWidth := 200;
+ MinHeight := 100;
+
+ btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick);
+ btnClose.ImageName := 'stdimg.quit';
+ btnClose.Anchors := [anRight, anBottom];
end;
procedure TMainForm.btnCloseClick(Sender: TObject);
@@ -68,16 +74,6 @@ begin
sl.Free;
end;
-constructor TMainForm.Create(aowner: TComponent);
-begin
- inherited Create(aowner);
- // Place button in bottom right corner.
- btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick);
- btnClose.ImageName := 'stdimg.quit';
-// btnClose.Focusable := False;
- btnClose.Anchors := [anRight, anBottom];
-end;
-
procedure MainProc;
var
frm : TMainForm;