diff --git a/components/ideintf/menuintf.pas b/components/ideintf/menuintf.pas index 4d74952d99..50497f90c9 100644 --- a/components/ideintf/menuintf.pas +++ b/components/ideintf/menuintf.pas @@ -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 inil) 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 FInvalidChildStartIndexnil) 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 i1; + MsgAboutSection.ChildrenAsSubMenu:=VisibleCnt>1; // Filtering if CanFilterMsgType then begin diff --git a/ide/mainbase.pas b/ide/mainbase.pas index f6c6d5863c..4922995061 100644 --- a/ide/mainbase.pas +++ b/ide/mainbase.pas @@ -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); diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 8095b8933a..71776b91f4 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -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