mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 07:30:22 +02:00
sparta: fix AV in pFakeMenuPaint
git-svn-id: trunk@51242 -
This commit is contained in:
parent
f3ec76381d
commit
0321aeb764
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user