Menu designer: formatting.

git-svn-id: trunk@54374 -
This commit is contained in:
juha 2017-03-08 20:33:56 +00:00
parent 13a7fe6856
commit b77306c3df
2 changed files with 28 additions and 29 deletions

View File

@ -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;

View File

@ -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;