sparta: fix AV in pFakeMenuPaint

git-svn-id: trunk@51242 -
This commit is contained in:
ondrej 2016-01-10 21:26:07 +00:00
parent f3ec76381d
commit 0321aeb764

View File

@ -258,16 +258,17 @@ var
begin
//fake paint menu
// pFakeMenu is visible only when HasMainMenu is true
//if not HasMainMenu then
// Exit;
Menu := FDesignedForm.Form.Menu;
MenuRect := pFakeMenu.ClientRect;
LCanvas := pFakeMenu.Canvas;
LCanvas.Brush.Color := clMenuBar;
LCanvas.FillRect(MenuRect);
// pFakeMenu is visible only when HasMainMenu is true
// but FDesignedForm can be nil if the designer is painted before it has been assigned
if not HasMainMenu then
Exit;
Menu := FDesignedForm.Form.Menu;
LCanvas.Font.Color := clMenuText;
X := 5;
@ -278,7 +279,6 @@ begin
LCanvas.TextOut(X, Y, Menu.Items[I].Caption);
Inc(X, LCanvas.TextWidth(Menu.Items[I].Caption) + 10);
end;
LCanvas.Brush.Color := clNone;
end;
procedure TResizerFrame.ClientChangeBounds(Sender: TObject);