IDEIntf: deprecated ChildsAsSubMenu, typo

git-svn-id: trunk@50816 -
This commit is contained in:
mattias 2015-12-15 15:34:01 +00:00
parent 5229da3d5b
commit d4675305e2
5 changed files with 54 additions and 52 deletions

View File

@ -116,7 +116,7 @@ type
private
FBottomSeparator: TMenuItem;
FChildMenuItemsCreated: boolean;
FChildsAsSubMenu: boolean;
FChildrenAsSubMenu: boolean;
FInvalidChildEndIndex: Integer;
FInvalidChildStartIndex: Integer;
FItems: TFPList;
@ -138,11 +138,11 @@ type
protected
procedure MenuItemClick(Sender: TObject); override;
procedure SetMenuItem(const AValue: TMenuItem); override;
procedure SetChildsAsSubMenu(const AValue: boolean); virtual;
procedure SetChildrenAsSubMenu(const AValue: boolean); virtual;
procedure SetSubMenuImages(const AValue: TCustomImageList); virtual;
procedure ClearMenuItems; override;
procedure ItemVisibleActiveChanged(AnItem: TIDEMenuItem);
procedure UpdateChildsIndex(StartIndex: Integer);
procedure UpdateAllChildrenIndex(StartIndex: Integer);
procedure UpdateMenuStructure;
procedure UpdateSize(Diff: integer);
procedure Invalidate(FromIndex, ToIndex: integer);
@ -167,7 +167,7 @@ type
procedure BeginUpdate;
procedure EndUpdate;
procedure NotifySubSectionOnShow(Sender: TObject;
WithChilds: Boolean = true); virtual;
WithChildren: Boolean = true); virtual;
procedure RemoveAllHandlersOfObject(AnObject: TObject);
procedure AddHandlerOnShow(const OnShowEvent: TNotifyEvent;
AsLast: boolean = false);
@ -176,8 +176,10 @@ type
MenuItemDebugReport: boolean); override;
procedure ConsistencyCheck; override;
public
property ChildsAsSubMenu: boolean read FChildsAsSubMenu
write SetChildsAsSubMenu default true;
property ChildsAsSubMenu: boolean read FChildrenAsSubMenu
write SetChildrenAsSubMenu default true; deprecated;// use ChildrenAsSubMenu instead
property ChildrenAsSubMenu: boolean read FChildrenAsSubMenu
write SetChildrenAsSubMenu default true;
property SubMenuImages: TCustomImageList read FSubMenuImages
write SetSubMenuImages;
property Items[Index: Integer]: TIDEMenuItem read GetItems; default;
@ -185,7 +187,7 @@ type
property BottomSeparator: TMenuItem read FBottomSeparator;
property NeedTopSeparator: boolean read FNeedTopSeparator;
property NeedBottomSeparator: boolean read FNeedBottomSeparator;
property VisibleCount: integer read FVisibleCount; // without grandchilds
property VisibleCount: integer read FVisibleCount; // without grandchildren
property States: TIDEMenuSectionStates read FStates;
end;
TIDEMenuSectionClass = class of TIDEMenuSection;
@ -462,7 +464,7 @@ function RegisterIDEMenuSection(Parent: TIDEMenuSection; const Name: string
): TIDEMenuSection;
begin
Result:=TIDEMenuSection.Create(Name);
Result.ChildsAsSubMenu:=false;
Result.ChildrenAsSubMenu:=false;
Parent.AddLast(Result);
end;
@ -481,7 +483,7 @@ function RegisterIDESubMenu(Parent: TIDEMenuSection; const Name,
const ResourceName: String): TIDEMenuSection;
begin
Result := TIDEMenuSection.Create(Name);
Result.ChildsAsSubMenu := True;
Result.ChildrenAsSubMenu := True;
Result.Caption := Caption;
Result.OnClick := OnClickMethod;
Result.OnClickProc := OnClickProc;
@ -815,7 +817,7 @@ begin
Result:=TIDEMenuSection(Self)
else
Result:=Section;
while (Result<>nil) and (not Result.ChildsAsSubMenu) do
while (Result<>nil) and (not Result.ChildrenAsSubMenu) do
Result:=Result.Section;
end;
@ -923,7 +925,7 @@ begin
Invalidate(0,Count-1);
end;
procedure TIDEMenuSection.UpdateChildsIndex(StartIndex: Integer);
procedure TIDEMenuSection.UpdateAllChildrenIndex(StartIndex: Integer);
var
i: LongInt;
begin
@ -941,7 +943,7 @@ var
procedure UpdateNeedTopSeparator;
// a separator at top is needed, if
// - this section is embedded (not ChildsAsSubMenu)
// - this section is embedded (not ChildrenAsSubMenu)
// - and this section is visible
// - and this section has visible children
// - and there is a visible menu item in front
@ -950,7 +952,7 @@ var
NewNeedTopSeparator: Boolean;
begin
NewNeedTopSeparator:=false;
if (not ChildsAsSubMenu) and (Section<>nil) and VisibleActive then begin
if (not ChildrenAsSubMenu) and (Section<>nil) and VisibleActive then begin
// check for any visible item in front
i:=SectionIndex-1;
while i>=0 do begin
@ -1007,7 +1009,7 @@ var
procedure UpdateNeedBottomSeparator;
// a separator at bottom is needed, if
// - this section is imbedded (not ChildsAsSubMenu)
// - this section is imbedded (not ChildrenAsSubMenu)
// - and this section is visible
// - and this section has visible children
// - and there is a visible menu item behind and it has no top separator
@ -1017,8 +1019,8 @@ var
NewNeedBottomSeparator: Boolean;
begin
NewNeedBottomSeparator:=false;
//debugln('TIDEMenuSection.UpdateNeedBottomSeparator Name="',Name,'" ChildsAsSubMenu=',dbgs(ChildsAsSubMenu),' Section=',dbgs(Section<>nil),' VisibleActive=',dbgs(VisibleActive));
if (not ChildsAsSubMenu) and (Section<>nil) and VisibleActive then begin
//debugln('TIDEMenuSection.UpdateNeedBottomSeparator Name="',Name,'" ChildrenAsSubMenu=',dbgs(ChildrenAsSubMenu),' Section=',dbgs(Section<>nil),' VisibleActive=',dbgs(VisibleActive));
if (not ChildrenAsSubMenu) and (Section<>nil) and VisibleActive then begin
// check for any visible item in front
i:=SectionIndex+1;
while i<Section.Count do begin
@ -1027,7 +1029,7 @@ var
// there is a visible menu item behind
//debugln('TIDEMenuSection.UpdateNeedBottomSeparator Name="',Name,'" ItemBehind="',ItemBehind.Name,'"');
if (ItemBehind is TIDEMenuSection)
and (not TIDEMenuSection(ItemBehind).ChildsAsSubMenu)
and (not TIDEMenuSection(ItemBehind).ChildrenAsSubMenu)
then begin
// the visible menu item behind will create its own separator
end else begin
@ -1087,7 +1089,7 @@ begin
end;
if FInvalidChildStartIndex<0 then FInvalidChildStartIndex:=0;
if (Section<>nil) and (not Section.ChildsAsSubMenu)
if (Section<>nil) and (not Section.ChildrenAsSubMenu)
and (Section.FInvalidChildStartIndex<=SectionIndex) then begin
// the sections in front need update too
// => start the update in front
@ -1098,7 +1100,7 @@ begin
end else if FInvalidChildStartIndex<Count then begin
// the sections in front are uptodate
ContainerMenuItem:=GetContainerMenuItem;
if ChildsAsSubMenu then
if ChildrenAsSubMenu then
ContainerMenuIndex:=0
else
ContainerMenuIndex:=GetContainerIndex(false);
@ -1129,7 +1131,7 @@ begin
CurSection:=nil;
if Visible then begin
// insert menu item
if ((CurSection=nil) or CurSection.ChildsAsSubMenu)
if ((CurSection=nil) or CurSection.ChildrenAsSubMenu)
and (ContainerMenuItem<>nil) then begin
Item.CreateMenuItem;
if Item.MenuItem.Parent=nil then begin
@ -1172,7 +1174,7 @@ begin
ASection:=Self;
while (ASection<>nil) do begin
inc(ASection.FSize,Diff);
if ASection.ChildsAsSubMenu then break;
if ASection.ChildrenAsSubMenu then break;
ASection:=ASection.Section;
end;
end;
@ -1213,14 +1215,14 @@ begin
end;
procedure TIDEMenuSection.NotifySubSectionOnShow(Sender: TObject;
WithChilds: Boolean);
WithChildren: Boolean);
var
i: Integer;
Child: TIDEMenuItem;
begin
//DebugLn(['TIDEMenuSection.NotifySubSectionOnShow ',Name,' ChildsAsSubMenu=',ChildsAsSubMenu,' Count=',Count]);
//DebugLn(['TIDEMenuSection.NotifySubSectionOnShow ',Name,' ChildrenAsSubMenu=',ChildrenAsSubMenu,' Count=',Count]);
FSectionHandlers[imshtOnShow].CallNotifyEvents(Sender);
if WithChilds or (not ChildsAsSubMenu) then begin
if WithChildren or (not ChildrenAsSubMenu) then begin
i:=0;
while i<Count do begin
Child:=Items[i];
@ -1279,7 +1281,7 @@ constructor TIDEMenuSection.Create(const TheName: string);
begin
inherited Create(TheName);
FSize := 0;
FChildsAsSubMenu := True;
FChildrenAsSubMenu := True;
FNeedTopSeparator := False;
FNeedBottomSeparator := False;
FItems := TFPList.Create;
@ -1341,7 +1343,7 @@ procedure TIDEMenuSection.Insert(Index: Integer; AnItem: TIDEMenuItem);
begin
AnItem.Name:=CreateUniqueName(AnItem.Name);
FItems.Insert(Index,AnItem);
UpdateChildsIndex(Index);
UpdateAllChildrenIndex(Index);
UpdateSize(AnItem.Size);
AnItem.FSection:=Self;
if AnItem.VisibleActive then
@ -1359,7 +1361,7 @@ begin
if not (imssClearing in FStates) then begin
OldVisibleActive:=AnItem.VisibleActive;
FItems.Delete(AnItem.SectionIndex);
UpdateChildsIndex(AnItem.SectionIndex);
UpdateAllChildrenIndex(AnItem.SectionIndex);
end;
UpdateSize(-AnItem.Size);
AnItem.FSection:=nil;
@ -1373,7 +1375,7 @@ end;
procedure TIDEMenuSection.CreateMenuItem;
begin
if ChildsAsSubMenu then
if ChildrenAsSubMenu then
inherited CreateMenuItem;
end;
@ -1385,7 +1387,7 @@ begin
if (Section=nil) then exit;
// get the start of the parent Section
if not Section.ChildsAsSubMenu then
if not Section.ChildrenAsSubMenu then
inc(Result,Section.GetContainerIndex(true));
// add all siblings in front
SiblingIndex:=0;
@ -1403,7 +1405,7 @@ function TIDEMenuSection.GetChildContainerIndex(Index: integer): Integer;
var
i: Integer;
begin
if ChildsAsSubMenu then
if ChildrenAsSubMenu then
Result:=0
else
Result:=GetContainerIndex(true);
@ -1450,7 +1452,7 @@ end;
function TIDEMenuSection.Size: integer;
begin
if ChildsAsSubMenu then
if ChildrenAsSubMenu then
Result:=1
else
Result:=inherited Size;
@ -1497,7 +1499,7 @@ var
begin
debugln([Prefix,'SectionIndex=',SectionIndex,' Name="',DbgStr(Name),'"',
' VisibleActive=',VisibleActive,
' ChildsAsSubMenu=',ChildsAsSubMenu,
' ChildrenAsSubMenu=',ChildrenAsSubMenu,
' ContainerIndex=',GetContainerIndex(false),
' NeedSep:Top=',NeedTopSeparator,',Bottom=',NeedBottomSeparator,
' Size=',dbgs(Size)]);
@ -1584,15 +1586,15 @@ begin
UpdateMenuStructure;
end;
procedure TIDEMenuSection.SetChildsAsSubMenu(const AValue: boolean);
procedure TIDEMenuSection.SetChildrenAsSubMenu(const AValue: boolean);
begin
if FChildsAsSubMenu=AValue then exit;
FChildsAsSubMenu:=AValue;
if FChildrenAsSubMenu=AValue then exit;
FChildrenAsSubMenu:=AValue;
ClearMenuItems;
if Section<>nil then begin
Section.Invalidate(SectionIndex,SectionIndex);
{$IFDEF VerboseMenuIntf}
debugln('TIDEMenuSection.SetChildsAsSubMenu Name="',Name,'"');
debugln('TIDEMenuSection.SetChildrenAsSubMenu Name="',Name,'"');
{$ENDIF}
if AValue then
Section.UpdateSize(1)

View File

@ -596,7 +596,7 @@ begin
'Change class',lisDlgChangeClass);
DesignerMenuChangeParent:=RegisterIDEMenuSection(DesignerMenuSectionMisc,
'Change parent');
DesignerMenuChangeParent.ChildsAsSubMenu:=true;
DesignerMenuChangeParent.ChildrenAsSubMenu:=true;
DesignerMenuChangeParent.Caption:=lisChangeParent;
DesignerMenuViewLFM:=RegisterIDEMenuCommand(DesignerMenuSectionMisc,
'View LFM',lisViewSourceLfm);

View File

@ -463,7 +463,7 @@ begin
MsgQuickFixMenuSection := RegisterIDEMenuSection(Root, 'Quick Fix');
MsgAboutSection:=RegisterIDEMenuSection(Root,'About');
Parent:=MsgAboutSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisAbout;
MsgAboutToolMenuItem:=RegisterIDEMenuCommand(Parent, 'About', lisAbout);
MsgOpenToolOptionsMenuItem:=RegisterIDEMenuCommand(Parent, 'Open Tool '
@ -471,18 +471,18 @@ begin
MsgFilterMsgOfTypeMenuItem:=RegisterIDEMenuCommand(Root,'FilterMsgOfType',lisFilterAllMessagesOfCertainType);
MsgRemoveCompOptHideMenuSection:=RegisterIDEMenuSection(Root,'RemoveCompOptHideMsg');
Parent:=MsgRemoveCompOptHideMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisRemoveCompilerOptionHideMessage;
MsgRemoveMsgTypeFilterMenuSection:=RegisterIDEMenuSection(Root,'RemoveMsgTypeFilters');
Parent:=MsgRemoveMsgTypeFilterMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisRemoveMessageTypeFilter;
MsgRemoveFilterMsgOneTypeMenuSection:=RegisterIDEMenuSection(Parent,'RemoveOneMsgTypeFilterSection');
MsgRemoveFilterAllMsgTypesMenuItem:=RegisterIDEMenuCommand(Parent, 'Remove'
+' all message type filters', lisRemoveAllMessageTypeFilters);
MsgFilterBelowMenuSection:=RegisterIDEMenuSection(Root,'Filter Below Section');
Parent:=MsgFilterBelowMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisFilterNonUrgentMessages;
MsgFilterWarningsMenuItem:=RegisterIDEMenuCommand(Parent,
'Filter Warnings', lisFilterWarningsAndBelow);
@ -512,14 +512,14 @@ begin
+' without Source Position', lisFilterHintsWithoutSourcePosition);
MsgFiltersMenuSection:=RegisterIDEMenuSection(Root,'Switch Filter Section');
Parent:=MsgFiltersMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisSwitchFilterSettings;
MsgSelectFilterMenuSection:=RegisterIDEMenuSection(Parent,'Filters');
MsgAddFilterMenuItem:=RegisterIDEMenuCommand(Parent, 'Add Filter',
lisAddFilter);
MsgCopyMenuSection:=RegisterIDEMenuSection(Root,'Copy');
Parent:=MsgCopyMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisCopy;
MsgCopyFilenameMenuItem:=RegisterIDEMenuCommand(Parent, 'Filename',
lisCopyFileNameToClipboard);
@ -529,7 +529,7 @@ begin
lisCopyAllOriginalMessagesToClipboard);
MsgSaveToFileMenuSection:=RegisterIDEMenuSection(Root,'Save');
Parent:=MsgSaveToFileMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisSave;
MsgSaveShownToFileMenuItem:=RegisterIDEMenuCommand(Parent, 'Save Shown '
+'Messages to File', lisSaveShownMessagesToFile);
@ -540,13 +540,13 @@ begin
MsgClearMenuItem := RegisterIDEMenuCommand(Root, 'Clear', lisClear);
MsgOptionsMenuSection:=RegisterIDEMenuSection(Root,'Option Section');
Parent:=MsgOptionsMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisOptions;
MsgWndStayOnTopMenuItem:=RegisterIDEMenuCommand(Parent,
'Window stay on top', lisWindowStaysOnTop);
MsgFilenameStyleMenuSection:=RegisterIDEMenuSection(Parent,'Filename Styles');
Parent:=MsgFilenameStyleMenuSection;
Parent.ChildsAsSubMenu:=true;
Parent.ChildrenAsSubMenu:=true;
Parent.Caption:=lisFilenameStyle;
MsgFileStyleShortMenuItem:=RegisterIDEMenuCommand(Parent, 'Short',
lisShortNoPath);
@ -2820,7 +2820,7 @@ begin
//assign default caption if item is not visible (needed for EditorToolBar)
MsgOpenToolOptionsMenuItem.Caption:=lisOpenToolOptions;
MsgOpenToolOptionsMenuItem.OnClick:=@OpenToolsOptionsMenuItemClick;
MsgAboutSection.ChildsAsSubMenu:=VisibleCnt>1;
MsgAboutSection.ChildrenAsSubMenu:=VisibleCnt>1;
// Filtering
if CanFilterMsgType then begin

View File

@ -909,7 +909,7 @@ procedure TMainIDEBase.CreateMenuSeparatorSection(
const AName: String);
begin
Section:=RegisterIDEMenuSection(ParentSection,AName);
Section.ChildsAsSubMenu := false;
Section.ChildrenAsSubMenu := false;
end;
procedure TMainIDEBase.CreateMenuSubSection(ParentSection: TIDEMenuSection;
@ -1402,7 +1402,7 @@ begin
// Populated later with a list of editor names
CreateMenuSeparatorSection(mnuWindow,itmWindowLists,'itmWindowLists');
CreateMenuSeparatorSection(mnuWindow,itmCenterWindowLists,'itmCenterWindowLists');
itmCenterWindowLists.ChildsAsSubMenu:=true;
itmCenterWindowLists.ChildrenAsSubMenu:=true;
itmCenterWindowLists.Caption:=lisCenterALostWindow;
CreateMenuSeparatorSection(mnuWindow,itmTabLists,'itmTabLists');
CreateMenuSubSection(itmTabLists,itmTabListProject,'itmTabListProject', dlgEnvProject);

View File

@ -6884,7 +6884,7 @@ var
CurCaption: String;
IDEMenuItem: TIDEMenuItem;
begin
SrcEditSubMenuHighlighter.ChildsAsSubMenu:=true;
SrcEditSubMenuHighlighter.ChildrenAsSubMenu:=true;
i:=0;
for h:=Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do begin
CurName:='Highlighter'+IntToStr(i);
@ -6917,7 +6917,7 @@ const
'CRLF (Win, DOS)'
);
begin
SrcEditSubMenuLineEnding.ChildsAsSubMenu:=true;
SrcEditSubMenuLineEnding.ChildrenAsSubMenu:=true;
if (SrcEdit<>nil) and (SrcEdit.CodeBuffer<>nil) then
FileEndings:=SrcEdit.CodeBuffer.DiskLineEnding
else
@ -6976,7 +6976,7 @@ var
IDEMenuItem: TIDEMenuItem;
SysEncoding: String;
begin
SrcEditSubMenuEncoding.ChildsAsSubMenu:=true;
SrcEditSubMenuEncoding.ChildrenAsSubMenu:=true;
Encoding:='';
if SrcEdit<>nil then begin
if SrcEdit.CodeBuffer<>nil then