From 3412d8b96caab39b6411f939eb11070231b78371 Mon Sep 17 00:00:00 2001 From: vincents Date: Sun, 26 Jun 2005 19:35:02 +0000 Subject: [PATCH] preferred size of statusbar is actual size. git-svn-id: trunk@7290 - --- lcl/interfaces/win32/win32wscomctrls.pp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lcl/interfaces/win32/win32wscomctrls.pp b/lcl/interfaces/win32/win32wscomctrls.pp index be320eae54..a96fa99d76 100644 --- a/lcl/interfaces/win32/win32wscomctrls.pp +++ b/lcl/interfaces/win32/win32wscomctrls.pp @@ -54,6 +54,8 @@ type class procedure SetText(const AWinControl: TWinControl; const AText: string); override; class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: integer); override; + class procedure GetPreferredSize(const AWinControl: TWinControl; + var PreferredWidth, PreferredHeight: integer); override; end; { TWin32WSTabSheet } @@ -323,6 +325,18 @@ begin Windows.PostMessage(AWinControl.Handle, WM_SIZE, 0, 0); end; +procedure TWin32WSStatusBar.GetPreferredSize(const AWinControl: TWinControl; + var PreferredWidth, PreferredHeight: integer); +var + R: TRect; +begin + // statusbars cannot be resized by the LCL, so actual size is prefered size + if Windows.GetWindowRect(AWinControl.Handle, R) then begin + PreferredHeight:= R.Bottom - R.Top; + PreferredWidth:= R.Right - R.Left; + end; +end; + procedure TWin32WSStatusBar.SetPanelText(const AStatusBar: TStatusBar; PanelIndex: integer); begin if AStatusBar.SimplePanel then