MG: component editors can now add menuitems to the designer popupmenu

git-svn-id: trunk@3273 -
This commit is contained in:
lazarus 2002-09-01 21:02:21 +00:00
parent 443c0e5ae2
commit c191a0955a
3 changed files with 14 additions and 11 deletions

View File

@ -416,12 +416,13 @@ end;
function TComponentEditor.GetVerb(Index: Integer): string;
begin
// Intended for descendents to implement
Result:='';
Result:=ClassName+IntToStr(Index);
end;
procedure TComponentEditor.ExecuteVerb(Index: Integer);
begin
// Intended for descendents to implement
writeln(Classname+'.ExecuteVerb: ',Index);
end;
procedure TComponentEditor.Copy;

View File

@ -1494,7 +1494,6 @@ end;
function TControlSelection.OnlyNonVisualComponentsSelected: boolean;
var i: integer;
begin
writeln('TControlSelection.OnlyNonVisualComponentsSelected ',cssOnlyNonVisualNeedsUpdate in FStates,' ',FOnlyNonVisualComponentsSelected);
if cssOnlyNonVisualNeedsUpdate in FStates then begin
Result:=true;
for i:=0 to FControls.Count-1 do
@ -1508,7 +1507,6 @@ end;
function TControlSelection.OnlyVisualComponentsSelected: boolean;
var i: integer;
begin
writeln('TControlSelection.OnlyVisualComponentsSelected ',cssOnlyVisualNeedsUpdate in FStates,' ',FOnlyVisualComponentsSelected);
if cssOnlyVisualNeedsUpdate in FStates then begin
Result:=true;
for i:=0 to FControls.Count-1 do

View File

@ -260,14 +260,18 @@ var
OwnerForm: TCustomForm;
begin
if FDesigner=nil then begin
OwnerForm:=TCustomForm(Component.Owner);
if OwnerForm=nil then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' Owner=nil');
end;
if not (OwnerForm is TCustomForm) then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' OwnerForm='+OwnerForm.ClassName);
if (Component is TCustomForm) and (TCustomForm(Component).Parent=nil) then
OwnerForm:=TCustomForm(Component)
else begin
OwnerForm:=TCustomForm(Component.Owner);
if OwnerForm=nil then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' Owner=nil');
end;
if not (OwnerForm is TCustomForm) then begin
raise Exception.Create('TComponentInterface.GetDesigner: '
+Component.Name+' OwnerForm='+OwnerForm.ClassName);
end;
end;
FDesigner:=TComponentEditorDesigner(OwnerForm.Designer);
if FDesigner=nil then begin