Try something like this, I just ripped this out of one of my Component
Editors. You will no dobt get the picture here. As long as you know the
class of the other component (which you do)


{ TAdrockDateTimeEditEditor }
type
  TAdrockDateTimeComponentEditor = class(TComponentEditor)
    procedure ExecuteVerb(Index: Integer); override;
    function GetVerb(Index: Integer): string; override;
    function GetVerbCount: Integer; override;
  end;

implementation

procedure TAdrockDateTimeComponentEditor.ExecuteVerb(Index: Integer);
Var
  CalendarSettingsComponent : TAdrockCalendarSettingsComponent;
  POs                       : Integer;
begin
  case Index of
    0 :  begin
           if
(OpenTAdrockDateTimeEditComponentEditor(TAdrockDateTimeEdit(Component)) =
TRUE) then
             Designer.Modified;
         end;
    1 :  begin
            CalendarSettingsComponent := NIL;
            for Pos := 0 to (Component.Owner).ComponentCount-1 do
              if ((Component.Owner).Components[POs] is
TAdrockCalendarSettingsComponent) then
                begin
                  CalendarSettingsComponent :=
TAdrockCalendarSettingsComponent((Component.Owner).Components[Pos]);
                  break;
                end;
            if (CalendarSettingsComponent = nil) then
              ShowMessage('Unable to find a TAdrockCalendarSettingsComponent
on the current form!')
            else
              begin
                TAdrockDateTimeEdit(Component).CalendarSettings :=
CalendarSettingsComponent;
                Designer.Modified;
              end;
         end;
  end;
end;

function TAdrockDateTimeComponentEditor.GetVerb(Index: Integer): string;
begin
  case Index of
   0 : Result := 'TAdrockDateTimeEdit Component Editor';
   1 : Result := 'Link to TAdrockCalendarSettingsComponent';
  end;
end;

function TAdrockDateTimeComponentEditor.GetVerbCount: Integer;
begin
  Result := 2;
end;

end.


Chris Crowe
[EMAIL PROTECTED]
Want a free tool to help search the Microsoft KB and Search pages?
goto http://www.adrock.com/msarticle (LastUpdate: 19th October)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Mark Derricutt
Sent: Friday, 22 October 1999 12:02
To: Multiple recipients of list delphi
Subject: [DUG]: Property Editors and other properties...


In one of my property editors I use the following code to get information
about the settings of another property:

  PropInfo := typinfo.GetPropInfo(Control.ClassInfo, 'UnitType');
  if PropInfo <> nil then
    Result := typinfo.GetStrProp(Control, PropInfo)
  else
    Result := '';

For another property editor, I want to do something similiar, but
different.

I have a property called UnitSystem which links to another component in
the project.  I can use typinfo.GetPropInfo to get return the information
about the "UnitSystem" property, but what I really want to do is then look
up the linked component and return the value of one of its properties.

Is it possible?

--
Mark Derricutt, He that brings forth electronic life.
Now Playing: Timothy Pure - Blood Of The Berry

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to