Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that inclu



Permlink Replies: 3 - Last Post: Oct 30, 2017 8:04 PM Last Post By: Remy Lebeau (Te...
Lex Dean

Posts: 132
Registered: 3/26/07
Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that inclu
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2017 9:18 PM
Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that includes Proxies.dcu in it.

This is stupidly frustrating (*bold*not only by me but by a lot of users I'm talking on behalf for*bold*) - trying to develop a object that is easy to use for every one that requires simplicity to use
I understand that embarcadero do not wish to give their development products away but at the same time they are destroying thier own product!!!!!!!!
for their own users. If DCU's used a inscription process to protect their info.

Question
In the mean time how do I write my code (compiler instructions) so the compiler uses the *.BPL files that contain the Proxies.dcu file so DesignEditors.dcu can work in design time?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that inclu
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2017 9:33 PM   in response to: Lex Dean in response to: Lex Dean
Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that includes Proxies.dcu in it.

This is stupidly frustrating (*bold*not only by me but by a lot of users I'm talking on behalf for*bold*) - trying to develop a object that is easy to use for every one that requires simplicity to use
I understand that embarcadero do not wish to give their development products away but at the same time they are destroying thier own product!!!!!!!!
for their own users. If DCU's used a inscription process to protect their info.

Question
In the mean time how do I write my code (compiler instructions) so the compiler uses the *.BPL files that contain the Proxies.dcu file so DesignEditors.dcu can work in design time?

https://edn.embarcadero.com/article/27717

--
Dave Nottage [TeamB]
Find hints tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Lex Dean

Posts: 132
Registered: 3/26/07
Re: Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that inclu
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2017 1:03 PM   in response to: Dave Nottage in response to: Dave Nottage
I'm not making a package
I just want a simple *.DCU

this is saying even for testing I need to complete as a package.

I know I shopul;d not do thin in a forum thread
I'm considering using TCollection - TCollectionItem

But do not know how to link TCollectionItem to a TGraphicControl descendant so TCollection editor at design time display the TGraphicControl descendant in property manager.
Then I get away from Proxies.dcu as a solution to this problem
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Proxies.dcu, designide.dcp or a replacement to DesignEditors.dcu that inclu [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2017 8:04 PM   in response to: Lex Dean in response to: Lex Dean
Lex Dean wrote:

I'm not making a package
I just want a simple *.DCU

You CANNOT use Proxies.dcu or DesignIDE outside of a design-time
package. PERIOD!!! If your project requires them at run-time then you
are doing something seriously wrong.

I'm considering using TCollection - TCollectionItem

But do not know how to link TCollectionItem to a TGraphicControl
descendant so TCollection editor at design time display the
TGraphicControl descendant in property manager.

There have been NUMEROUS examples posted over the years showing how to
use TCollection in a component. Have you done any searching?

What you are asking for can go one of two different ways, which you
have not elaborated on what you actually want:

1. you want your collection items to refer to external TGraphicControl
controls. Declare a TCollectionItem descendant class that has a
published property of your TGraphicControl-derived class type, then
have your main component create a TOwnedCollection that uses your
TCollectionItem-derived class as its item type.

For example:

type
  TMyCollectionItem = class(TCollectionItem)
  private
    FControl: TMyGraphicControl;
    procedure SetControl(AValue: TMyGraphicControl);
  published
    Control: TMyGraphicControl read FControl write SetControl;
  end;
 
  TMyCollection = class(TOwnedCollection)
  public
    constructor Create(AOwner: TMyComponent); reintroduce;
  end;
 
  TMyComponent = class(TComponent)
  private
    FCollection: TMyCollection;
    procedure SetCollection(AValue: TMyCollection);
  protected
    procedure Notification(AComponent: TComponent; Operation:
TOperation); override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Collection: TMyCollection read FCollection write
SetCollection;
  end;
 
...
 
procedure TMyCollectionItem.SetControl(AValue: TMyGraphicControl);
var
  Comp: TComponent;
begin
  if FControl <> AValue then
  begin
    Comp := (Collection as TMyCollection).GetOwner as TComponent;
    if FControl <> nil then
      FControl.RemoveFreeNotification(Comp);
    FControl := AValue;
    if FControl <> nil then
      FControl.FreeNotification(Comp);
  end;
end;
 
constructor TMyCollection.Create(AOwner: TMyComponent);
begin
  inherited Create(AOwner, TMyCollectionItem);
end;
 
constructor TMyComponent.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FCollection := TMyCollection.Create(Self);
end;
 
destructor TMyComponent.Destroy;
begin
  FCollection.Free;
  inherited;
end;
 
procedure TMyComponent.Notification(AComponent: TComponent; Operation:
TOperation);
var
  I: Integer;
  Item: TMyCollectionItem;
begin
  inherited;
  if Operation = opRemove then
  begin
    for I := 0 to FCollection.Count-1 do
    begin
      Item := FCollection[I] as TMyCollectionItem;
      if Item.FControl = AComponent then
        Item.FControl := nil;
    end;
  end;
end;
 
procedure TMyComponent.SetCollection(AValue: TMyCollection);
begin
  FCollection.Assign(AValue);
end;

2. you want your collection items to own their own internal
TGraphicControl components, and you want the TGraphicControl's
properties to apear directly in the collection editor when a collection
item is selected. This gets quite a bit more involved, so I'm not
going to write an example here unless this is what you want.

--
Remy Lebeau (TeamB)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02