LCL: switch height and width if orientation of trackbar changes (bug #1787)

git-svn-id: trunk@10431 -
This commit is contained in:
vincents 2007-01-12 12:16:37 +00:00
parent b8104ed672
commit 1eda95efaa
2 changed files with 14 additions and 6 deletions

View File

@ -112,14 +112,22 @@ end;
Change the orientation of the trackbar.
------------------------------------------------------------------------------}
procedure TCustomTrackBar.SetOrientation(Value: TTrackBarOrientation);
var
OldWidth: LongInt;
OldHeight: LongInt;
begin
if FOrientation <> Value then
begin
FOrientation := Value;
if HandleAllocated then
begin
// switch width and height, but not when loading, because we assume that the
// lfm contains a consistent combination of Orientation and (width, height)
if not (csLoading in ComponentState) then begin
OldWidth:=Width;
OldHeight:=Height;
SetBounds(Left,Top,OldHeight,OldWidth);
// TODO: Remove RecreateWnd
RecreateWnd(Self);
if HandleAllocated then
RecreateWnd(Self);
end;
end;
end;

View File

@ -1749,9 +1749,9 @@ begin
Show := WParam <> 0;
Status := LParam;
End;
if assigned(lWinControl) and ((WParam<>0) or not lWinControl.Visible)
and ((WParam=0) or lWinControl.Visible)
//DebugLn(GetStackTrace(false));
if assigned(lWinControl) {and ((WParam<>0) or not lWinControl.Visible)
and ((WParam=0) or lWinControl.Visible)}
and (Application<>nil) and (lWinControl=Application.MainForm) then
begin
if WParam=0 then