LCL-Win32: Take caption of an autosized GroupBox into account when calculating width. Issue #20447, patch from Henry Vermaak

git-svn-id: trunk@45795 -
This commit is contained in:
juha 2014-07-06 17:20:26 +00:00
parent bcb2f4643e
commit 634b35e8e6

View File

@ -54,6 +54,9 @@ type
const AParams: TCreateParams): HWND; override;
class procedure SetBiDiMode(const AWinControl: TWinControl; UseRightToLeftAlign,
UseRightToLeftReading, UseRightToLeftScrollBar : Boolean); override;
class procedure GetPreferredSize(const AWinControl: TWinControl;
var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override;
end;
{ TWin32WSGroupBox }
@ -560,6 +563,17 @@ begin
RecreateWnd(AWinControl);
end;
class procedure TWin32WSCustomGroupBox.GetPreferredSize(
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
begin
if MeasureText(AWinControl, AWinControl.Caption, PreferredWidth,
PreferredHeight) then begin
PreferredWidth += 19;
PreferredHeight += 4;
end;
end;
{ TWin32WSCustomListBox }
function ListBoxWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;