IDE: Show frames and datamodules correctly in menu with option "Window menu shows designed form's name instead of caption". Issue #37138, patch from FTurtle.

git-svn-id: trunk@63226 -
This commit is contained in:
juha 2020-05-26 21:55:06 +00:00
parent 1c63f54328
commit c516e2543c

View File

@ -1584,10 +1584,19 @@ end;
procedure InitMenuItem(AMenuItem: TIDEMenuItem; AForm: TCustomForm; AIcon: Integer);
begin
AMenuItem.ImageIndex := AIcon;
if EnvironmentOptions.Desktop.IDENameForDesignedFormList and IsFormDesign(AForm) then
AMenuItem.Caption := AForm.Name
if not IsFormDesign(AForm) then
AMenuItem.Caption := AForm.Caption
else
AMenuItem.Caption := AForm.Caption;
case AForm.ClassName of
'TFrameProxyDesignerForm', // frame
'TNonControlProxyDesignerForm': // datamodule
AMenuItem.Caption := AForm.Caption;
else // form
if EnvironmentOptions.Desktop.IDENameForDesignedFormList then
AMenuItem.Caption := AForm.Name
else
AMenuItem.Caption := AForm.Caption;
end;
AMenuItem.UserTag := {%H-}PtrUInt(AForm);
end;