[patch] conditional evaluation bug in TWin32WidgetSet.SetComboMinDropDownSize (win32winapi.inc)
Original Reporter info from Mantis: Christian Danner
-
Reporter name: Christian Danner
Original Reporter info from Mantis: Christian Danner
- Reporter name: Christian Danner
Description:
There's a conditional evaluation bug in TWin32WidgetSet.SetComboMinDropDownSize (win32winapi.inc).
| function TWin32WidgetSet.SetComboMinDropDownSize(Handle: HWND; MinItemsWidth,
| MinItemsHeight, MinItemCount: integer): boolean;
| begin
| Result:= ThemeServices.ThemesEnabled and
| boolean(Windows.SendMessage(Handle, CB_SETMINVISIBLE, MinItemCount, 0));
| Result := Result and boolean(Windows.SendMessage(Handle, CB_SETDROPPEDWIDTH, MinItemsWidth, 0));
| end;
Here a - usually deactivated - complete boolean evaluation is mandatory, as otherwise SendMessage() won't get called with ThemesEnabled returning FALSE.
That problem only becomes apparent in case you try to alter the width of the dropdown part, which is what the TCustomComboBox.AdjustDropDown (customcombobox.inc) patch does by adjusting the box width to the longest text item;
http://danner-net.de/trans/combobox.gif shows a pre/post comparison.
Cheers
Mantis conversion info:
- Mantis ID: 30526
- OS: Windows 7
- OS Build: Professional
- Build: 52880
- Platform: Win32
- Version: 1.7 (SVN)
- Fixed in version: 1.6.2
- Fixed in revision: r53045 (#028ed814)
- Target version: 1.6.2