customdrawn test: Adds OnClick handler and logger

git-svn-id: trunk@33278 -
This commit is contained in:
sekelsenmat 2011-11-04 07:38:22 +00:00
parent 563fb0dda7
commit 9e673aa6cf
2 changed files with 62 additions and 41 deletions

View File

@ -1,18 +1,18 @@
object Form1: TForm1 object Form1: TForm1
Left = 332 Left = 332
Height = 397 Height = 496
Top = 177 Top = 144
Width = 458 Width = 459
Caption = 'Form1' Caption = 'Custom Drawn Controls Tester'
ClientHeight = 397 ClientHeight = 496
ClientWidth = 458 ClientWidth = 459
LCLVersion = '0.9.31' LCLVersion = '0.9.31'
object comboControls: TComboBox object comboControls: TComboBox
Left = 80 Left = 80
Height = 21 Height = 21
Top = 12 Top = 12
Width = 172 Width = 172
ItemHeight = 13 ItemHeight = 0
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'TCDButton' 'TCDButton'
@ -39,7 +39,7 @@ object Form1: TForm1
Height = 240 Height = 240
Top = 40 Top = 40
Width = 439 Width = 439
PageIndex = 5 PageIndex = 0
TabOrder = 2 TabOrder = 2
TabStop = True TabStop = True
object pageButtons: TPage object pageButtons: TPage
@ -53,7 +53,8 @@ object Form1: TForm1
Caption = 'dsCommon' Caption = 'dsCommon'
Color = 15857141 Color = 15857141
DrawStyle = dsCommon DrawStyle = dsCommon
TabOrder = 0 OnClick = HandleClick
TabOrder = 1
TabStop = True TabStop = True
end end
object CDButton2: TCDButton object CDButton2: TCDButton
@ -64,7 +65,8 @@ object Form1: TForm1
Caption = 'dsWinCE' Caption = 'dsWinCE'
Color = 15857141 Color = 15857141
DrawStyle = dsWinCE DrawStyle = dsWinCE
TabOrder = 1 OnClick = HandleClick
TabOrder = 2
TabStop = True TabStop = True
end end
object Button1: TButton object Button1: TButton
@ -73,7 +75,8 @@ object Form1: TForm1
Top = 16 Top = 16
Width = 75 Width = 75
Caption = 'TButton' Caption = 'TButton'
TabOrder = 2 OnClick = HandleClick
TabOrder = 0
end end
object CDButton3: TCDButton object CDButton3: TCDButton
Left = 119 Left = 119
@ -83,6 +86,7 @@ object Form1: TForm1
Caption = 'dsWin2000' Caption = 'dsWin2000'
Color = 15857141 Color = 15857141
DrawStyle = dsWin2000 DrawStyle = dsWin2000
OnClick = HandleClick
TabOrder = 3 TabOrder = 3
TabStop = True TabStop = True
end end
@ -94,22 +98,25 @@ object Form1: TForm1
Caption = 'dsWinXP' Caption = 'dsWinXP'
Color = 15857141 Color = 15857141
DrawStyle = dsWinXP DrawStyle = dsWinXP
OnClick = HandleClick
TabOrder = 4 TabOrder = 4
TabStop = True TabStop = True
end end
end end
object pageEdits: TPage object pageEdits: TPage
ClientWidth = 14048 ClientWidth = 439
ClientHeight = 7680 ClientHeight = 240
object CDEdit1: TCDEdit object CDEdit1: TCDEdit
Left = 103 Left = 119
Height = 30 Height = 24
Top = 24 Top = 26
Width = 100 Width = 88
DrawStyle = dsCommon
Text = 'dsCommon'
end end
object Edit1: TEdit object Edit1: TEdit
Left = 8 Left = 8
Height = 21 Height = 22
Top = 28 Top = 28
Width = 80 Width = 80
TabOrder = 1 TabOrder = 1
@ -117,36 +124,36 @@ object Form1: TForm1
end end
end end
object pageCheckboxes: TPage object pageCheckboxes: TPage
ClientWidth = 7024 ClientWidth = 439
ClientHeight = 3840 ClientHeight = 240
object CheckBox1: TCheckBox object CheckBox1: TCheckBox
Left = 20 Left = 20
Height = 17 Height = 18
Top = 29 Top = 29
Width = 71 Width = 91
Caption = 'CheckBox1' Caption = 'CheckBox1'
TabOrder = 0 TabOrder = 0
end end
object CDCheckBox1: TCDCheckBox object CDCheckBox1: TCDCheckBox
Left = 119 Left = 119
Height = 16 Height = 19
Top = 29 Top = 29
Width = 73 Width = 93
DrawStyle = dsCommon DrawStyle = dsCommon
Caption = 'dsCommon' Caption = 'dsCommon'
end end
object CDCheckBox2: TCDCheckBox object CDCheckBox2: TCDCheckBox
Left = 119 Left = 119
Height = 16 Height = 19
Top = 47 Top = 48
Width = 63 Width = 75
DrawStyle = dsWinCE DrawStyle = dsWinCE
Caption = 'dsWinCE' Caption = 'dsWinCE'
end end
end end
object pageGroupBoxes: TPage object pageGroupBoxes: TPage
ClientWidth = 14048 ClientWidth = 56192
ClientHeight = 7680 ClientHeight = 30720
object GroupBox1: TGroupBox object GroupBox1: TGroupBox
Left = -1 Left = -1
Height = 105 Height = 105
@ -207,14 +214,15 @@ object Form1: TForm1
end end
end end
object pageTrackBars: TPage object pageTrackBars: TPage
ClientWidth = 14048 ClientWidth = 439
ClientHeight = 7680 ClientHeight = 240
object TrackBar1: TTrackBar object TrackBar1: TTrackBar
Left = 7 Left = 7
Height = 25 Height = 25
Top = 16 Top = 16
Width = 100 Width = 100
Position = 0 Position = 0
OnClick = HandleClick
TabOrder = 0 TabOrder = 0
end end
object CDTrackBar1: TCDTrackBar object CDTrackBar1: TCDTrackBar
@ -329,17 +337,24 @@ object Form1: TForm1
end end
end end
end end
object Page7: TPage object pageTabControls: TPage
end end
end end
object Memo1: TMemo object memoLog: TMemo
Left = 9 AnchorSideLeft.Control = Owner
Height = 90 AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 7
Height = 186
Top = 303 Top = 303
Width = 439 Width = 445
Lines.Strings = ( Anchors = [akTop, akLeft, akRight, akBottom]
'Memo1' BorderSpacing.Left = 7
) BorderSpacing.Right = 7
BorderSpacing.Bottom = 7
ScrollBars = ssVertical
TabOrder = 3 TabOrder = 3
end end
object StaticText2: TStaticText object StaticText2: TStaticText

View File

@ -38,7 +38,7 @@ type
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
Label1: TLabel; Label1: TLabel;
Label2: TLabel; Label2: TLabel;
Memo1: TMemo; memoLog: TMemo;
notebookControls: TNotebook; notebookControls: TNotebook;
pageButtons: TPage; pageButtons: TPage;
PageControl1: TPageControl; PageControl1: TPageControl;
@ -47,7 +47,7 @@ type
pageGroupBoxes: TPage; pageGroupBoxes: TPage;
pageTrackBars: TPage; pageTrackBars: TPage;
pagePageControls: TPage; pagePageControls: TPage;
Page7: TPage; pageTabControls: TPage;
StaticText1: TStaticText; StaticText1: TStaticText;
StaticText2: TStaticText; StaticText2: TStaticText;
StaticText3: TStaticText; StaticText3: TStaticText;
@ -58,6 +58,7 @@ type
TrackBar1: TTrackBar; TrackBar1: TTrackBar;
CDTrackBar1: TCDTrackBar; CDTrackBar1: TCDTrackBar;
procedure comboControlsChange(Sender: TObject); procedure comboControlsChange(Sender: TObject);
procedure HandleClick(Sender: TObject);
private private
{ private declarations } { private declarations }
public public
@ -78,5 +79,10 @@ begin
notebookControls.PageIndex := comboControls.ItemIndex; notebookControls.PageIndex := comboControls.ItemIndex;
end; end;
procedure TForm1.HandleClick(Sender: TObject);
begin
memoLog.Lines.Add(Format('%s: %s OnClick', [TControl(Sender).Name, TControl(Sender).ClassName]));
end;
end. end.