TScrollingWinControl: fixed AV during destruction

git-svn-id: trunk@9763 -
This commit is contained in:
mattias 2006-08-28 21:44:51 +00:00
parent 5c7c30f966
commit 3093718d32
2 changed files with 17 additions and 7 deletions

View File

@ -36,12 +36,19 @@ end;
function TScrollingWinControl.GetClientScrollOffset: TPoint;
begin
Result.X:=HorzScrollBar.Position;
Result.Y:=VertScrollBar.Position;
if (HorzScrollBar<>nil) and (VertScrollBar<>nil) then begin
Result.X:=HorzScrollBar.Position;
Result.Y:=VertScrollBar.Position;
end else begin
Result.X:=0;
Result.Y:=0;
end;
end;
procedure TScrollingWinControl.AlignControls(AControl: TControl; var ARect: TRect);
procedure TScrollingWinControl.AlignControls(AControl: TControl;
var ARect: TRect);
begin
if (HorzScrollBar=nil) or (VertScrollBar=nil) then exit;
HorzScrollBar.AutoCalcRange;
VertScrollBar.AutoCalcRange;
If not AutoScroll then
@ -117,7 +124,8 @@ end;
function TScrollingWinControl.HasVisibleScrollbars: boolean;
begin
Result:=VertScrollBar.Visible and HorzScrollBar.Visible;
Result:=(VertScrollBar<>nil) and VertScrollBar.Visible
and (HorzScrollBar<>nil) and HorzScrollBar.Visible;
end;
procedure TScrollingWinControl.DestroyWnd;
@ -134,8 +142,10 @@ end;
procedure TScrollingWinControl.ScrollBy(DeltaX, DeltaY: Integer);
begin
TWSScrollingWinControlClass(WidgetSetClass).ScrollBy(Self, DeltaX, DeltaY);
Invalidate;
if HandleAllocated then begin
TWSScrollingWinControlClass(WidgetSetClass).ScrollBy(Self, DeltaX, DeltaY);
Invalidate;
end;
end;
Procedure TScrollingWinControl.WMVScroll(var Message : TLMVScroll);

View File

@ -826,7 +826,7 @@ begin
NeighbourControl.Parent.DisableAlign;
// TODO: create a PageControl and two pages. And move the neigbbours onto
// one page and Control to the other page.
if AnchorControls[akLeft]=nil then ;
finally
NeighbourList.Free;