From cb5c7a3f3660352a5f31b7b84d468fad044b1409 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 13 May 2004 00:18:18 +0000 Subject: [PATCH] Added layout to check git-svn-id: trunk@5466 - --- examples/bitbtnform.pp | 165 +++++++++++++++++++++++++++++++++++------ 1 file changed, 144 insertions(+), 21 deletions(-) diff --git a/examples/bitbtnform.pp b/examples/bitbtnform.pp index a992996503..fd844f3e04 100644 --- a/examples/bitbtnform.pp +++ b/examples/bitbtnform.pp @@ -37,11 +37,17 @@ type public button1 : TBitBtn; Label1 : TLabel; + GroupBox1 : TGroupBox; Radio1 : TRadioButton; Radio2 : TRadioButton; Radio3 : TRadioButton; Radio4 : TRadioButton; + Groupbox2 : TGroupbox; Radio5 : TRadioButton; + Radio6 : TRadioButton; + Radio7 : TRadioButton; + Radio8 : TRadioButton; + Label2 : TLabel; constructor Create(AOwner: TComponent); override; procedure button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -54,6 +60,10 @@ type procedure Radio2Click(Sender : TObject); procedure Radio3Click(Sender : TObject); procedure Radio4Click(Sender : TObject); + procedure Radio5Click(Sender : TObject); + procedure Radio6Click(Sender : TObject); + procedure Radio7Click(Sender : TObject); + procedure Radio8Click(Sender : TObject); end; var @@ -65,8 +75,8 @@ constructor TForm1.Create(AOwner: TComponent); begin inherited Create(AOwner); Caption := 'TBitBtn Verify'; - Width := 200; - Height := 150; + Width := 335; + Height := 170; Left := 200; Top := 200; @@ -80,10 +90,10 @@ begin OnMouseDown := @button1MouseDown; OnMouseMove := @button1MouseMove; Parent := Self; - width := 80; - height := 32; - left := 25; - top := 25; + width := 120; + height := 120; + left := 15; + top := 15; layout := blGlyphLeft; kind := bkClose; caption := 'Close'; @@ -95,24 +105,47 @@ begin begin Parent := Self; width := 80; - left := 25; - top := 80; + left := 15; + top := 150; Caption := 'bkClose'; Autosize := True; Show; end; + Label2 := TLabel.Create(Self); + With Label2 do + begin + Parent := Self; + width := 80; + left := 150; + top := 150; + Caption := 'blGlyphLeft'; + Autosize := True; + Show; + end; + + GroupBox1 := TGroupbox.Create(Self); + with GroupBox1 do + begin + Parent := Self; + width := 80; + height := 125; + left := 150; + top := 15; + Caption := 'Kind'; + end; + Radio1 := TRadioButton.Create(Self); with Radio1 do begin OnClick := @Radio1Click; - Parent := Self; - top := 25; - left := 125; + Parent := GroupBox1; + top := 8; + left := 8; caption := 'Close'; Checked := True; Height := 15; - Width := 60; + Width := 60; Show; end; @@ -120,9 +153,9 @@ begin with Radio2 do begin OnClick := @Radio2Click; - Parent := Self; - top := 50; - left := 125; + Parent := GroupBox1; + top := 32; + left := 8; caption := 'Ok'; Checked := False; Height := 15; @@ -134,9 +167,9 @@ begin with Radio3 do begin OnClick := @Radio3Click; - Parent := Self; - top := 75; - left := 125; + Parent := GroupBox1; + top := 56; + left := 8; caption := 'Cancel'; Checked := False; Height := 15; @@ -148,9 +181,9 @@ begin with Radio4 do begin OnClick := @Radio4Click; - Parent := Self; - top := 100; - left := 125; + Parent := GroupBox1; + top := 80; + left := 8; caption := 'Help'; Checked := False; Height := 15; @@ -158,6 +191,72 @@ begin Show; end; + GroupBox2 := TGroupbox.Create(Self); + with GroupBox2 do + begin + Parent := Self; + width := 80; + height := 125; + left := 240; + top := 15; + Caption := 'Layout'; + end; + + Radio5 := TRadioButton.Create(Self); + with Radio5 do + begin + OnClick := @Radio5Click; + Parent := GroupBox2; + top := 8; + left := 8; + caption := 'Left'; + Checked := True; + Height := 15; + Width := 60; + Show; + end; + + Radio6 := TRadioButton.Create(Self); + with Radio6 do + begin + OnClick := @Radio6Click; + Parent := GroupBox2; + top := 32; + left := 8; + caption := 'Top'; + Checked := False; + Height := 15; + Width := 50; + Show; + end; + + Radio7 := TRadioButton.Create(Self); + with Radio7 do + begin + OnClick := @Radio7Click; + Parent := GroupBox2; + top := 56; + left := 8; + caption := 'Right'; + Checked := False; + Height := 15; + Width := 65; + Show; + end; + + Radio8 := TRadioButton.Create(Self); + with Radio8 do + begin + OnClick := @Radio8Click; + Parent := GroupBox2; + top := 80; + left := 8; + caption := 'Bottom'; + Checked := False; + Height := 15; + Width := 55; + Show; + end; end; procedure TForm1.FormDestroy(Sender : TObject); @@ -211,5 +310,29 @@ begin Label1.Caption := 'bkHelp'; end; +procedure TForm1.Radio5Click(Sender : TObject); +begin + button1.Layout := blGlyphLeft; + Label2.Caption := 'blGlyphLeft'; +end; + +procedure TForm1.Radio6Click(Sender : TObject); +begin + button1.Layout := blGlyphTop; + Label2.Caption := 'blGlyphTop'; +end; + +procedure TForm1.Radio7Click(Sender : TObject); +begin + button1.Layout := blGlyphRight; + Label2.Caption := 'blGlyphRight'; +end; + +procedure TForm1.Radio8Click(Sender : TObject); +begin + button1.Layout := blGlyphBottom; + Label2.Caption := 'blGlyphBottom'; +end; + end.