Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-10

Combobox patch

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Olivier Guilbaud
to olivier GUILBAUD: Hi I have implemented the control of style csDropDownList for the TCustomComboBox. Thanks…

It is all that there is for this style. !!

I saw two small problems with TCombobox:

1�) the height of the combo is not well calculated (or calculates it is not taken into account)

2�) If the combo is empty, the dropdown loop at infinite (not systematic)

Sorry, i have not found the solutions ... :o)

Thanks
Olivier

Earlier message 27 lines
----- Original Message ----- From: "Marc Weustink" To: Sent: Wednesday, October 08, 2003 1:00 AM Subject: Re: [lazarus] Combobox patch > At 23:42 7-10-2003, you wrote: > >Hi > > > >I have implemented the control of style csDropDownList for the > >TCustomComboBox. > > If you implemented the complete style, then there is something missing. I > only saw an implemented KeyPress. > > That part is applied, > > thanks, Marc > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > >

Reply by email

olivier GUILBAUD

Hi

I have implemented the control of style csDropDownList for the TCustomComboBox.

Thanks

Olivier

? .directory
Index: lcl/stdctrls.pp
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/stdctrls.pp,v retrieving revision 1.107
diff -u -r1.107 stdctrls.pp
--- lcl/stdctrls.pp 26 Sep 2003 18:19:40 -0000 1.107 +++ lcl/stdctrls.pp 7 Oct 2003 21:38:48 -0000
@@ -1,4 +1,4 @@
-{
+{
/*************************************************************************** stdctrls.pp
-----------
@@ -247,7 +247,8 @@

     procedure SetSorted(Val : boolean); virtual;
     procedure SetStyle(Val : TComboBoxStyle); virtual;
     procedure KeyDown(var Key : Word; Shift : TShiftState); override;

-
+ procedure KeyPress(var Key : Char); override; +

     property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
     property Items: TStrings read FItems write SetItems;
     property ItemHeight: Integer read GetItemHeight write SetItemHeight;

Index: lcl/include/customcombobox.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/include/customcombobox.inc,v retrieving revision 1.32
diff -u -r1.32 customcombobox.inc
--- lcl/include/customcombobox.inc 20 Sep 2003 13:27:49 -0000 1.32 +++ lcl/include/customcombobox.inc 7 Oct 2003 21:38:51 -0000 @@ -416,6 +416,15 @@

     inherited KeyDown(Key, Shift);

end;

+procedure TCustomComboBox.KeyPress(var Key : Char);
+begin
+  if (Style=csDropDownList) and (Ord(Key)>31) then
+    Key:=#0
+  else
+    Inherited KeyPress(Key);
+end;
+
+
 {------------------------------------------------------------------------------
   function TCustomComboBox.SelectItem(const AnItem: String): Boolean;

Reply by email