preferred size of statusbar is actual size.

git-svn-id: trunk@7290 -
This commit is contained in:
vincents 2005-06-26 19:35:02 +00:00
parent 0dc9ed7f3a
commit 3412d8b96c

View File

@ -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