changed TPropertyEditor.GetComponent

git-svn-id: trunk@6232 -
This commit is contained in:
mattias 2004-11-11 18:45:24 +00:00
parent 2378a262fe
commit d5414fe864
3 changed files with 13 additions and 19 deletions

View File

@ -1321,7 +1321,7 @@ begin
FTIObject:=nil;
FTIPropertyName:='';
end else begin
FTIObject:=FEditor.GetPersistent(0);
FTIObject:=FEditor.GetComponent(0);
FTIPropertyName:=FEditor.GetName;
end;
end;
@ -1781,7 +1781,7 @@ var
begin
Result:=false;
for i:=0 to PropCount-1 do begin
CurPersistent:=GetPersistent(i);
CurPersistent:=GetComponent(i);
if (CurPersistent is TCustomPropertyLink) then begin
ALink:=TCustomPropertyLink(CurPersistent);
if Assigned(ALink.OnTestEditor) and (not ALink.OnTestEditor(Prop)) then
@ -1815,7 +1815,7 @@ begin
// get every TIObject of every TCustomPropertyLink in the selection
Filter:=AllTypeKinds;
for i:=0 to PropCount-1 do begin
CurPersistent:=GetPersistent(i);
CurPersistent:=GetComponent(i);
if (CurPersistent is TCustomPropertyLink) then begin
ALink:=TCustomPropertyLink(CurPersistent);
CurTIObject:=ALink.TIObject;
@ -1858,7 +1858,7 @@ begin
FCollectedValues:=TAliasStrings.Create;
FCollectedValues.Text:=Memo.Text;
for i:=0 to Editor.PropCount-1 do begin
CurPersistent:=Editor.GetPersistent(i);
CurPersistent:=Editor.GetComponent(i);
if (CurPersistent is TCustomPropertyLink) then begin
ALink:=TCustomPropertyLink(CurPersistent);
ALink.CreateEditor;

View File

@ -800,7 +800,7 @@ var
APersistent: TPersistent;
begin
Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
APersistent:=GetPersistent(0);
APersistent:=GetComponent(0);
if (APersistent<>nil) and (APersistent is TControl)
and (not (APersistent is TStaticText)) then
Result:=Result+[paDisableSubProperties]-[paDialog];

View File

@ -303,8 +303,7 @@ type
procedure Edit; virtual;
function GetAttributes: TPropertyAttributes; virtual;
function IsReadOnly: boolean; virtual;
function GetPersistent(Index: Integer): TPersistent;
function GetComponent(Index: Integer): TComponent;// for Delphi compatibility
function GetComponent(Index: Integer): TPersistent;// for Delphi compatibility
function GetEditLimit: Integer; virtual;
function GetName: shortstring; virtual;
procedure GetProperties(Proc: TGetPropEditProc); virtual;
@ -1408,7 +1407,7 @@ begin
if ListPropertyEditors=nil then exit;
for i:=0 to ListPropertyEditors.Count-1 do begin
Editor:=TListPropertyEditor(ListPropertyEditors[i]);
if (Editor.GetPersistent(0)=AnObject)
if (Editor.GetComponent(0)=AnObject)
and (Editor.OnSubPropertiesChanged<>nil) then
Editor.UpdateSubProperties;
end;
@ -1988,16 +1987,11 @@ begin
Result:=paReadOnly in GetAttributes;
end;
function TPropertyEditor.GetPersistent(Index: Integer): TPersistent;
function TPropertyEditor.GetComponent(Index: Integer): TPersistent;
begin
Result:=FPropList^[Index].Instance;
end;
function TPropertyEditor.GetComponent(Index: Integer): TComponent;
begin
Result:=TComponent(FPropList^[Index].Instance);
end;
function TPropertyEditor.GetFloatValue:Extended;
begin
Result:=GetFloatValueAt(0);
@ -3205,7 +3199,7 @@ begin
Result:=true;
if FSubPropertiesChanged then exit;
FSubPropertiesChanged:=true;
if SavedList<>GetPersistent(0) then exit;
if SavedList<>GetComponent(0) then exit;
if ReadElementCount<>SavedElements.Count then exit;
for i:=0 to SavedElements.Count-1 do
if TPersistent(SavedElements[i])<>ReadElement(i) then exit;
@ -3258,7 +3252,7 @@ procedure TListPropertyEditor.DoSaveElements;
var
i, ElementCount: integer;
begin
SavedList:=GetPersistent(0);
SavedList:=GetComponent(0);
ElementCount:=GetElementCount;
SavedElements.Count:=ElementCount;
for i:=0 to ElementCount-1 do
@ -3789,12 +3783,12 @@ var I: Integer;
begin
Result:='';
if PropertyHook.LookupRoot=nil then exit;
if GetPersistent(0) = PropertyHook.LookupRoot then begin
if GetComponent(0) = PropertyHook.LookupRoot then begin
Result := PropertyHook.GetRootClassName;
if (Result <> '') and (Result[1] = 'T') then
System.Delete(Result, 1, 1);
end else begin
Result := PropertyHook.GetObjectName(GetPersistent(0));
Result := PropertyHook.GetObjectName(GetComponent(0));
for I := Length(Result) downto 1 do
if Result[I] in ['.','[',']'] then
System.Delete(Result, I, 1);
@ -4182,7 +4176,7 @@ begin
if (not IsValidIdent(NewValue)) or (NewValue='') then
raise Exception.Create('Component name "'+NewValue+'" is not a valid identifier');
inherited SetValue(NewValue);
PropertyHook.ComponentRenamed(TComponent(GetPersistent(0)));
PropertyHook.ComponentRenamed(TComponent(GetComponent(0)));
end;
{ TDatePropertyEditor }