The added message I showed you fixes the redraw when height changed by code..
Did you put that in the message loop?
Also I commented those sections that were testing for the csSimple as you pointed out..
and I made a change to the one of them because while in the designer mode it mess up the designer when trying to drag to a new position, the cursor gets off track for that control..
class procedure TWin32WSCustomComboBox.AdaptBounds(const AWinControl: TWinControl;
var Left, Top, Width, Height: integer; var SuppressMove: boolean);
var
StringList: TWin32ComboBoxStringList;
begin
{if TCustomComboBox(AWinControl).Style = csSimple Then Exit;}
StringList := GetStringList(TCustomComboBox(AWinControl));
if Assigned(StringList) then
Height := StringList.ComboHeight;
end;
class procedure TWin32WSCustomComboBox.GetPreferredSize(
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
begin
PreferredHeight := 0;
if (AWinControl.HandleAllocated)and
(Not(csDesigning in AWinControl.ComponentState)or(TCustomComboBox(AWinControl).Style <> csSimple)) then
{ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ADDED}
PreferredHeight := AWinControl.Height;
end;
class function TWin32WSCustomComboBox.GetStringList(
const ACustomComboBox: TCustomComboBox): TWin32ComboBoxStringList;
begin
Result := nil;
{ if ACustomComboBox.Style <> csSimple then}
Result := TWin32ComboBoxStringList(GetWin32WindowInfo(ACustomComboBox.Handle)^.List);
end;
I found that I had to uncomment those events to make things smoother for one of my PC's where as the other it didn't matter..
Btw, on my Win PRO 10 PC, I still have a 1 pixel calculation error at the base of the box while in Themes mode only. So I think the issue here is in the Themes drawing doing the calculations..
The only other differences between the two pcs is version numbers of Lazarus..
WinPRO = 2.0.8 where as Home edition PC has 2.0.6 on it.. 64 bit for both.
I have looked high and low, I can not find any reference in the Widget code or CustomCombo code that is causing the IDE issue..
If you would like I can forward you my copy of this complete widget file if you wish ?