From a5cac5fc1076fced31e8fbadf4f0cecd3920adcd Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 10 Jun 2003 13:35:54 +0000 Subject: [PATCH] implemented TComboBox dropdown from Yoyong git-svn-id: trunk@4252 - --- lcl/include/customcombobox.inc | 17 +++++++++++++++++ lcl/stdctrls.pp | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/lcl/include/customcombobox.inc b/lcl/include/customcombobox.inc index 051f22571d..97fe7bad06 100644 --- a/lcl/include/customcombobox.inc +++ b/lcl/include/customcombobox.inc @@ -364,6 +364,20 @@ begin end; end; +procedure TCustomComboBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if AutoDropDown then + begin + case Key of + VK_TAB,VK_RETURN: + DroppedDown := False; + else + DroppedDown := True; + end; + end; +end; + {------------------------------------------------------------------------------ function TCustomComboBox.SelectItem(const AnItem: String): Boolean; @@ -736,6 +750,9 @@ end; { $Log$ + Revision 1.27 2003/06/10 13:35:54 mattias + implemented TComboBox dropdown from Yoyong + Revision 1.26 2003/06/07 09:34:21 mattias added ambigius compiled unit test for packages diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 7c4c7b8518..ed1f1fb6ad 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -240,6 +240,7 @@ type procedure SetSelText(const Val : string); virtual; procedure SetSorted(Val : boolean); virtual; procedure SetStyle(Val : TComboBoxStyle); virtual; + procedure KeyDown(var Key : Word; Shift : TShiftState); override; property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8; @@ -287,6 +288,7 @@ type property ItemIndex; published property Anchors; + property AutoDropDown; property Ctl3D; property DropDownCount; property Enabled; @@ -1450,6 +1452,9 @@ end. { ============================================================================= $Log$ + Revision 1.93 2003/06/10 13:35:54 mattias + implemented TComboBox dropdown from Yoyong + Revision 1.92 2003/06/07 09:34:21 mattias added ambigius compiled unit test for packages