Sign in Join

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

Mailing lists / lazarus / 2003-08

Patch lcl: customcombobox init

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Micha Nelissen

Hi,

On initialization, tcustomcombobox always sends it's current itemindex to the interface. However, if this -1, the control is cleared which is not what we want. The attached patch rules this case out.

Regards,

Micha.

Index: customcombobox.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/include/customcombobox.inc,v retrieving revision 1.29
diff -u -r1.29 customcombobox.inc
--- customcombobox.inc 26 Jul 2003 13:26:56 -0000 1.29 +++ customcombobox.inc 27 Aug 2003 09:00:50 -0000
@@ -43,7 +43,8 @@

   FItems:= NewStrings;
   UpdateSorted;
-  CNSendMessage(LM_SETITEMINDEX, Self, Pointer(FItemIndex));
+  if FItemIndex  -1 then
+    CNSendMessage(LM_SETITEMINDEX, Self, Pointer(FItemIndex));
   CNSendMessage(LM_SETPROPERTIES, Self, nil);
 end;

Reply by email

Mattias Gaertner
to Micha Nelissen
Show quoted text 5 lines
Hi, On initialization, tcustomcombobox always sends it's current itemindex to the interface. However, if this -1, the control is cleared which is not what we want. The attached patch rules this case out.

Applied. Thanks.

Mattias

Reply by email