mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-29 22:27:29 +01:00
fixed menu item method creation on change form on the fly
git-svn-id: trunk@4792 -
This commit is contained in:
parent
e2c9774274
commit
16f0cc169f
@ -419,15 +419,19 @@ procedure TDefaultComponentEditor.Edit;
|
|||||||
var
|
var
|
||||||
Components: TComponentSelectionList;
|
Components: TComponentSelectionList;
|
||||||
PropertyEditorHook: TPropertyEditorHook;
|
PropertyEditorHook: TPropertyEditorHook;
|
||||||
|
NewLookupRoot: TComponent;
|
||||||
begin
|
begin
|
||||||
PropertyEditorHook:=nil;
|
PropertyEditorHook:=nil;
|
||||||
if not GetHook(PropertyEditorHook) then exit;
|
if not GetHook(PropertyEditorHook) then exit;
|
||||||
Components := TComponentSelectionList.Create;
|
NewLookupRoot:=GetLookupRootForComponent(Component);
|
||||||
|
if NewLookupRoot<>PropertyEditorHook.LookupRoot then
|
||||||
|
GetDesigner.SelectOnlyThisComponent(Component);
|
||||||
FContinue := True;
|
FContinue := True;
|
||||||
Components.Add(Component);
|
|
||||||
FFirst := nil;
|
FFirst := nil;
|
||||||
FBest := nil;
|
FBest := nil;
|
||||||
|
Components := TComponentSelectionList.Create;
|
||||||
try
|
try
|
||||||
|
Components.Add(Component);
|
||||||
GetComponentProperties(Components, tkAny, PropertyEditorHook,
|
GetComponentProperties(Components, tkAny, PropertyEditorHook,
|
||||||
@CheckEdit, nil);
|
@CheckEdit, nil);
|
||||||
if FContinue then
|
if FContinue then
|
||||||
|
|||||||
@ -1016,7 +1016,7 @@ type
|
|||||||
procedure ShowMethod(const Name:ShortString);
|
procedure ShowMethod(const Name:ShortString);
|
||||||
function MethodFromAncestor(const Method:TMethod):boolean;
|
function MethodFromAncestor(const Method:TMethod):boolean;
|
||||||
procedure ChainCall(const AMethodName, InstanceName,
|
procedure ChainCall(const AMethodName, InstanceName,
|
||||||
InstanceMethod:ShortString; TypeData:PTypeData);
|
InstanceMethod:ShortString; TypeData: PTypeData);
|
||||||
// components
|
// components
|
||||||
function GetComponent(const Name: ShortString):TComponent;
|
function GetComponent(const Name: ShortString):TComponent;
|
||||||
function GetComponentName(AComponent: TComponent):ShortString;
|
function GetComponentName(AComponent: TComponent):ShortString;
|
||||||
@ -1126,6 +1126,8 @@ type
|
|||||||
OnRefreshPropertyValues: TPropHookRefreshPropertyValues);
|
OnRefreshPropertyValues: TPropHookRefreshPropertyValues);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetLookupRootForComponent(AComponent: TComponent): TComponent;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
{ TPropInfoList }
|
{ TPropInfoList }
|
||||||
@ -4995,6 +4997,12 @@ var
|
|||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
|
|
||||||
|
function GetLookupRootForComponent(AComponent: TComponent): TComponent;
|
||||||
|
begin
|
||||||
|
Result:=AComponent;
|
||||||
|
if (Result<>nil) and (Result.Owner<>nil) then Result:=Result.Owner;
|
||||||
|
end;
|
||||||
|
|
||||||
Function ClassTypeInfo(Value: TClass): PTypeInfo;
|
Function ClassTypeInfo(Value: TClass): PTypeInfo;
|
||||||
begin
|
begin
|
||||||
Result := PTypeInfo(Value.ClassInfo);
|
Result := PTypeInfo(Value.ClassInfo);
|
||||||
|
|||||||
@ -671,19 +671,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFormEditor.SetSelectedComponents(
|
procedure TCustomFormEditor.SetSelectedComponents(
|
||||||
TheSelectedComponents : TComponentSelectionList);
|
TheSelectedComponents: TComponentSelectionList);
|
||||||
begin
|
begin
|
||||||
FSelectedComponents.Assign(TheSelectedComponents);
|
FSelectedComponents.Assign(TheSelectedComponents);
|
||||||
if FSelectedComponents.Count>0 then
|
if FSelectedComponents.Count>0 then begin
|
||||||
begin
|
Obj_Inspector.PropertyEditorHook.LookupRoot:=
|
||||||
if FSelectedComponents[0].Owner<>nil then
|
GetLookupRootForComponent(FSelectedComponents[0]);
|
||||||
begin
|
|
||||||
Obj_Inspector.PropertyEditorHook.LookupRoot:=FSelectedComponents[0].Owner;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Obj_Inspector.PropertyEditorHook.LookupRoot:=FSelectedComponents[0];
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
Obj_Inspector.Selections := FSelectedComponents;
|
Obj_Inspector.Selections := FSelectedComponents;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user