MenuDesigner: Rename a MenuItem when it is changed into a separator.

git-svn-id: trunk@58940 -
This commit is contained in:
juha 2018-09-10 22:27:57 +00:00
parent 508a89d4af
commit 7183dd5d0b
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ interface
uses
// FCL
Classes, SysUtils, Types, typinfo,
Classes, SysUtils, Types, typinfo, strutils,
// LazUtils
LazLogger,
// LCL
@ -720,9 +720,11 @@ begin
Assert(Assigned(FEditedMenuItem), 'TShadowMenu.StopEditingCaption: FEditedMenuItem = Nil');
EditedShadow := TShadowItem(GetShadowForMenuItem(FEditedMenuItem));
s := FInPlaceEditor.Text;
if (s <> cLineCaption) and (s <> '') then
if s <> '' then
begin
FEditedMenuItem.Caption:=s;
if (s = cLineCaption) and AnsiStartsStr('MenuItem', FEditedMenuItem.Name) then
FEditedMenuItem.Name:=FEditorDesigner.CreateUniqueComponentName('N');
GlobalDesignHook.RefreshPropertyValues;
GlobalDesignHook.Modified(FEditedMenuItem);
EditedShadow.Invalidate;

View File

@ -120,7 +120,7 @@ type
TMenuItem = class(TLCLComponent)
private
FActionLink: TMenuActionLink;
FCaption: string;
FCaption: TTranslateString;
FBitmap: TBitmap;
FGlyphShowMode: TGlyphShowMode;
FHandle: HMenu;