carbon: fix remove menu error messages on IDE start

git-svn-id: trunk@21492 -
This commit is contained in:
dmitry 2009-08-31 09:15:08 +00:00
parent 7799ac78c6
commit 6bd45cf1f1

View File

@ -48,7 +48,7 @@ type
FParentMenu: TCarbonMenu;
FRoot: Boolean;
FItems: TObjectList; // of TCarbonMenu
procedure MenuNeeded;
procedure MenuNeeded(UpdateWithParent: Boolean=True);
function GetIndex: Integer;
protected
procedure RegisterEvents;
@ -152,7 +152,7 @@ end;
Creates Carbon menu object for sub menu
------------------------------------------------------------------------------}
procedure TCarbonMenu.MenuNeeded;
procedure TCarbonMenu.MenuNeeded(UpdateWithParent: Boolean);
begin
if Menu <> nil then Exit;
@ -165,7 +165,7 @@ begin
RegisterEvents;
if FParentMenu <> nil then
if (FParentMenu <> nil) and UpdateWithParent then
begin
SetCaption(LCLMenuItem.Caption);
@ -376,8 +376,8 @@ begin
{$ENDIF}
Index := GetIndex;
if FParentMenu.FRoot then MenuNeeded; // menu item is in toplevel of root menu
if FParentMenu.FRoot then MenuNeeded(False); // menu item is in toplevel of root menu.
if LCLMenuItem.Caption = cLineCaption then // menu item is separator
OSError(
InsertMenuItemTextWithCFString(FParentMenu.Menu, nil, Index,