View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025556 | Lazarus | LCL | public | 2014-01-19 13:13 | 2014-01-19 15:18 |
Reporter | Assigned To | Bart Broersma | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x64 (with x86 compiler) | OS | Windows | ||
Product Version | 1.3 (SVN) | ||||
Summary | 0025556: Using combobox.items.addstrings does not update combobox dropdown list | ||||
Description | See 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 | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r43771 | ||||
LazTarget | - | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
2014-01-19 13:13 developer |
|
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; |
|
Thanks for the analysis. Applied with slight modification. (Assign calls AddStrings, so now the call to UpdateComboHeight isn't needed in Assign anymore.) |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-19 13:13 |
|
New Issue | |
2014-01-19 13:13 |
|
File Added: combodropdown.zip | |
2014-01-19 13:13 |
|
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 |
|
Status | resolved => closed |