mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 10:00:34 +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
|
begin
|
||||||
//fake paint menu
|
//fake paint menu
|
||||||
|
|
||||||
// pFakeMenu is visible only when HasMainMenu is true
|
|
||||||
//if not HasMainMenu then
|
|
||||||
// Exit;
|
|
||||||
|
|
||||||
Menu := FDesignedForm.Form.Menu;
|
|
||||||
|
|
||||||
MenuRect := pFakeMenu.ClientRect;
|
MenuRect := pFakeMenu.ClientRect;
|
||||||
LCanvas := pFakeMenu.Canvas;
|
LCanvas := pFakeMenu.Canvas;
|
||||||
LCanvas.Brush.Color := clMenuBar;
|
LCanvas.Brush.Color := clMenuBar;
|
||||||
LCanvas.FillRect(MenuRect);
|
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;
|
LCanvas.Font.Color := clMenuText;
|
||||||
|
|
||||||
X := 5;
|
X := 5;
|
||||||
@ -278,7 +279,6 @@ begin
|
|||||||
LCanvas.TextOut(X, Y, Menu.Items[I].Caption);
|
LCanvas.TextOut(X, Y, Menu.Items[I].Caption);
|
||||||
Inc(X, LCanvas.TextWidth(Menu.Items[I].Caption) + 10);
|
Inc(X, LCanvas.TextWidth(Menu.Items[I].Caption) + 10);
|
||||||
end;
|
end;
|
||||||
LCanvas.Brush.Color := clNone;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TResizerFrame.ClientChangeBounds(Sender: TObject);
|
procedure TResizerFrame.ClientChangeBounds(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user