From b77306c3dfabea16ed7c013cd109c6782bee5604 Mon Sep 17 00:00:00 2001 From: juha Date: Wed, 8 Mar 2017 20:33:56 +0000 Subject: [PATCH] Menu designer: formatting. git-svn-id: trunk@54374 - --- designer/menueditor.pp | 27 +++++++++++++-------------- designer/menueditorform.pas | 30 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/designer/menueditor.pp b/designer/menueditor.pp index 033731731b..dc67358f48 100644 --- a/designer/menueditor.pp +++ b/designer/menueditor.pp @@ -1585,7 +1585,7 @@ begin if FSelectedMenuItem = nil then Exit; comp:=GlobalDesignHook.GetComponent(FSelectedMenuItem.Name); - if (comp<>nil) and (comp is TMenuItem) then + if comp is TMenuItem then begin selBox:=SelectedShadowBox; if (selBox.LastRIValue <> mi.RadioItem) then @@ -1597,8 +1597,7 @@ function TShadowMenu.OnClickIsAssigned(aMI: TMenuItem): boolean; begin if (aMI = nil) then Exit(False); - Result:=(FEditorDesigner.PropertyEditorHook.GetMethodName - (GetMethodProp(aMI, 'OnClick'), aMI) <> ''); + Result:=(FEditorDesigner.PropertyEditorHook.GetMethodName(GetMethodProp(aMI, 'OnClick'), aMI) <> ''); end; procedure TShadowMenu.Paint; @@ -1611,18 +1610,18 @@ procedure TShadowMenu.SetParent(NewParent: TWinControl); begin inherited SetParent(NewParent); if (NewParent <> nil) and not (csDestroying in ComponentState) then - begin - Align:=alNone; - CreateShadowBoxesAndItems; - UpdateBoxLocationsAndSizes; - HideBoxesAboveLevel(0); - Application.ProcessMessages; - FInitialising:=True; - if (FInitialSelectedMenuItem <> nil) then begin - SetSelectedMenuItem(FInitialSelectedMenuItem, True, False); - UpdateActionsEnabledness; - end; + begin + Align:=alNone; + CreateShadowBoxesAndItems; + UpdateBoxLocationsAndSizes; + HideBoxesAboveLevel(0); + Application.ProcessMessages; + FInitialising:=True; + if (FInitialSelectedMenuItem <> nil) then begin + SetSelectedMenuItem(FInitialSelectedMenuItem, True, False); + UpdateActionsEnabledness; end; + end; end; procedure TShadowMenu.SetSelectedMenuItem(aMI: TMenuItem; diff --git a/designer/menueditorform.pas b/designer/menueditorform.pas index 2c66ecf7c8..11e4850104 100644 --- a/designer/menueditorform.pas +++ b/designer/menueditorform.pas @@ -501,21 +501,21 @@ var isPopupMenu: boolean; begin if not FGUIEnabled then - begin - StatisticsGroupBox.Font.Style:=[fsBold]; - StatisticsGroupBox.Caption:=FEditedMenu.Name; - StatisticsGroupBox.Enabled:=True; - ButtonsGroupBox.Enabled:=not selectedIsNil; - if selectedIsNil then - Caption:=Format(lisMenuEditorEditingSSNoMenuItemSelected, - [TComponent(GlobalDesignHook.LookupRoot).Name, FEditedMenu.Name]); - isPopupMenu:=(FEditedMenu is TPopupMenu); - LoadVariableButtonGlyphs(not isPopupMenu); - if isPopupMenu then - ShowPopupAssignmentsInfo - else HidePopupAssignmentsInfo; - FGUIEnabled:=True; - end; + begin + StatisticsGroupBox.Font.Style:=[fsBold]; + StatisticsGroupBox.Caption:=FEditedMenu.Name; + StatisticsGroupBox.Enabled:=True; + ButtonsGroupBox.Enabled:=not selectedIsNil; + if selectedIsNil then + Caption:=Format(lisMenuEditorEditingSSNoMenuItemSelected, + [TComponent(GlobalDesignHook.LookupRoot).Name, FEditedMenu.Name]); + isPopupMenu:=(FEditedMenu is TPopupMenu); + LoadVariableButtonGlyphs(not isPopupMenu); + if isPopupMenu then + ShowPopupAssignmentsInfo + else HidePopupAssignmentsInfo; + FGUIEnabled:=True; + end; end; procedure TMenuDesignerForm.InitializeStatisticVars;