From b351e9f2058c42bfbc9089600e31b336305037e8 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 8 Jun 2010 10:57:49 +0200 Subject: 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). --- examples/gui/stdimages/stdimglist.lpr | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'examples') 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; -- cgit v1.2.3-70-g09d2