IDE: designer: menu editor: less overhead

git-svn-id: trunk@52225 -
This commit is contained in:
mattias 2016-04-20 09:47:03 +00:00
parent 4819139549
commit 75349695d6

View File

@ -1864,33 +1864,33 @@ begin
FInitialSelectedMenuItem := aSelect;
SetInitialBounds(0, 0, aWidth, aHeight);
Name := 'ShadowMenu';
FItemsPopupMenu := TPopupMenu.Create(Self);
FItemsPopupMenu.Name := 'ItemsPopupMenu';
FActionList := TActionList.Create(Self);
SetupPopupMenu;
FAddItemFake := TAddSiblingFake.Create(Self);
FAddItemFake.OnClick := @AddItemAfter;
FAddItemFake.Caption := lisMenuEditorAddMenuItem;
FAddItemFake.Name := 'AddItemFake';
FAddSubmenuFake := TAddSubmenuFake.Create(Self);
FAddSubmenuFake.OnClick := @AddSubMenu;
FAddSubmenuFake.Caption := lisMenuEditorAddSubmenu;
FAddSubmenuFake.Name := 'AddSubmenuFake';
FAddFirstItemFake := TAddFirstFake.Create(Self);
FAddFirstItemFake.OnClick := @AddFirstMenu;
FAddFirstItemFake.Caption := lisMenuEditorAddMenuItem;
FAddFirstItemFake.Name := 'AddFirstItemFake';
FAddFirstItemFake.Left := Popup_Origin.x;
FAddFirstItemFake.Top := Popup_Origin.y;
FInPlaceEditor := TEdit.Create(Self);
FInPlaceEditor.OnKeyDown := @InPlaceEditKeyDown;
FInPlaceEditor.Visible := False;
ConnectSpeedButtonOnClickMethods;
GlobalDesignHook.AddHandlerObjectPropertyChanged(@OnObjectPropertyChanged);
GlobalDesignHook.AddHandlerModified(@OnDesignerModified);
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnDesignerRefreshPropertyValues);
DisableAutoSizing;
try
FItemsPopupMenu := TPopupMenu.Create(Self);
FItemsPopupMenu.Name := 'ItemsPopupMenu';
FActionList := TActionList.Create(Self);
SetupPopupMenu;
FAddItemFake := TAddSiblingFake.Create(Self);
FAddItemFake.OnClick := @AddItemAfter;
FAddItemFake.Caption := lisMenuEditorAddMenuItem;
FAddItemFake.Name := 'AddItemFake';
FAddSubmenuFake := TAddSubmenuFake.Create(Self);
FAddSubmenuFake.OnClick := @AddSubMenu;
FAddSubmenuFake.Caption := lisMenuEditorAddSubmenu;
FAddSubmenuFake.Name := 'AddSubmenuFake';
FAddFirstItemFake := TAddFirstFake.Create(Self);
FAddFirstItemFake.OnClick := @AddFirstMenu;
FAddFirstItemFake.Caption := lisMenuEditorAddMenuItem;
FAddFirstItemFake.Name := 'AddFirstItemFake';
FAddFirstItemFake.Left := Popup_Origin.x;
FAddFirstItemFake.Top := Popup_Origin.y;
FInPlaceEditor := TEdit.Create(Self);
FInPlaceEditor.OnKeyDown := @InPlaceEditKeyDown;
FInPlaceEditor.Visible := False;
ConnectSpeedButtonOnClickMethods;
GlobalDesignHook.AddHandlerObjectPropertyChanged(@OnObjectPropertyChanged);
GlobalDesignHook.AddHandlerModified(@OnDesignerModified);
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnDesignerRefreshPropertyValues);
AutoSize := False;
Color := clBtnFace;
BorderStyle := bsNone;