mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:56:00 +02:00
LCL/Win32: Fix drawing artefacts of ComboBox in Windows when style is csSimple and static listbox is visible. Issue #37129, patch by Jamie Philbrook.
git-svn-id: trunk@63251 -
This commit is contained in:
parent
6e4dbe9fd0
commit
102cb0b364
@ -426,6 +426,31 @@ begin
|
|||||||
LMessage.Result := 0;
|
LMessage.Result := 0;
|
||||||
Exit(DeliverMessage(WindowInfo^.WinControl, LMessage));
|
Exit(DeliverMessage(WindowInfo^.WinControl, LMessage));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// WM_SETFONT and WM_SIZE were added due to csSimple issue #37129
|
||||||
|
WM_SETFONT:
|
||||||
|
begin
|
||||||
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
|
WindowInfo := GetWin32WIndowInfo(Window);
|
||||||
|
if TCustomComBoBox(WindowInfo^.WinControl).Style = csSimple then
|
||||||
|
with WindowInfo^.WinControl do
|
||||||
|
begin {LCL is blocking the size change so we trick it}
|
||||||
|
SendMessage(Window,CB_SETDROPPEDWIDTH, WIdth, 0);
|
||||||
|
MoveWindow(Handle, left, Top, Width, Height-1, False); {Trick the No size lock}
|
||||||
|
MoveWindow(Handle, Left, Top, Width, Height+1, False);{ Won't change otherwise}
|
||||||
|
end;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
WM_SIZE: { Added for csSimple border painting with the list in view}
|
||||||
|
begin
|
||||||
|
Result := WindowProc(Window, Msg, WParam, LParam); //call original firt;
|
||||||
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
|
if TCustomcombobox(WindowInfo^.WinControl).Style = csSimple then
|
||||||
|
begin
|
||||||
|
InvalidateRect(WindowInfo^.WinControl.Handle, nil, true); {border does not paint properly otherwise}
|
||||||
|
end;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
// normal processing
|
// normal processing
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
@ -975,6 +1000,14 @@ begin
|
|||||||
pSubClassName := LCLComboboxClsName;
|
pSubClassName := LCLComboboxClsName;
|
||||||
SubClassWndProc := @ComboBoxWindowProc;
|
SubClassWndProc := @ComboBoxWindowProc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// issue #37129: Fix static listbox of style csSimple when height is changed (like in Delphi)
|
||||||
|
if (CBS_SIMPLE and Params.flags) <> 0 Then
|
||||||
|
begin
|
||||||
|
Params.Flags := Params.Flags or CBS_NOINTEGRALHEIGHT;
|
||||||
|
Include(TWinControlAccess(AWinControl).FWinControlFlags, wcfEraseBackground);
|
||||||
|
end;
|
||||||
|
|
||||||
// create window
|
// create window
|
||||||
FinishCreateWindow(AWinControl, Params, False, True);
|
FinishCreateWindow(AWinControl, Params, False, True);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user