View Issue Details

IDProjectCategoryView StatusLast Update
0025556LazarusLCLpublic2014-01-19 15:18
ReporterReinier OlislagersAssigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64 (with x86 compiler)OSWindows 
Product Version1.3 (SVN) 
Summary0025556: Using combobox.items.addstrings does not update combobox dropdown list
DescriptionSee attached demo program. Using items.addstrings to add string items to the combobox items leads to the items being added, but the dropdown list is kept at 1 line, instead of the number of lines set in properties.

Attached patch solves this for Win32; don't know if other widgetsets need comparable fixes.

Thanks to engkin on the forum who figured this out:
http://forum.lazarus.freepascal.org/index.php/topic,23289.msg138831.html#msg138831
TagsNo tags attached.
Fixed in Revisionr43771
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Reinier Olislagers

2014-01-19 13:13

developer  

combodropdown.zip (2,926 bytes)

Reinier Olislagers

2014-01-19 13:13

developer  

combodropdownwin32.diff (1,150 bytes)   
Index: lcl/interfaces/win32/win32listsl.inc
===================================================================
--- lcl/interfaces/win32/win32listsl.inc	(revision 43770)
+++ lcl/interfaces/win32/win32listsl.inc	(working copy)
@@ -420,6 +420,14 @@
   SetWindowPos(FSender.Handle, 0, 0, 0, Width, Height, SWP_NOZORDER or SWP_NOACTIVATE or SWP_NOMOVE);
 end;
 
+procedure TWin32ComboBoxStringList.AddStrings(TheStrings: TStrings);
+begin
+  inherited AddStrings(TheStrings);
+
+  // Make sure dropdown etc is set correctly
+  UpdateComboHeight;
+end;
+
 procedure TWin32ComboBoxStringList.Clear;
 var
   SaveText: String;
Index: lcl/interfaces/win32/win32listslh.inc
===================================================================
--- lcl/interfaces/win32/win32listslh.inc	(revision 43770)
+++ lcl/interfaces/win32/win32listslh.inc	(working copy)
@@ -84,6 +84,7 @@
     procedure InitFlags; override;
     procedure UpdateComboHeight;
   public
+    procedure AddStrings(TheStrings: TStrings); override;
     procedure Assign(Source: TPersistent); override;
     procedure Clear; override;
     procedure Delete(Index: integer); override;
combodropdownwin32.diff (1,150 bytes)   

Bart Broersma

2014-01-19 14:59

developer   ~0072543

Thanks for the analysis.
Applied with slight modification.
(Assign calls AddStrings, so now the call to UpdateComboHeight isn't needed in Assign anymore.)

Issue History

Date Modified Username Field Change
2014-01-19 13:13 Reinier Olislagers New Issue
2014-01-19 13:13 Reinier Olislagers File Added: combodropdown.zip
2014-01-19 13:13 Reinier Olislagers File Added: combodropdownwin32.diff
2014-01-19 14:59 Bart Broersma Fixed in Revision => r43771
2014-01-19 14:59 Bart Broersma Note Added: 0072543
2014-01-19 14:59 Bart Broersma Status new => resolved
2014-01-19 14:59 Bart Broersma Resolution open => fixed
2014-01-19 14:59 Bart Broersma Assigned To => Bart Broersma
2014-01-19 15:18 Reinier Olislagers Status resolved => closed