diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-08 10:57:49 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-08 10:57:49 +0200 |
commit | b351e9f2058c42bfbc9089600e31b336305037e8 (patch) | |
tree | c5ee00148f7f914bd497f455d947c330cb711e64 | |
parent | 9fc3070cec35073db340cfc5b836ceae05ea99c8 (diff) | |
download | fpGUI-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).
-rw-r--r-- | examples/gui/stdimages/stdimglist.lpr | 18 |
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; |