Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Component Building Problem

Posted on 2000-05-03
7
Medium Priority
?
127 Views
Last Modified: 2011-08-18
I need to make a component that when you use object inspector you see information in groups.

 I.E. there is a little + symbol beside each group and when you double click on it, you can edit the data in that group.

 I.E. When you put a label on a form, and edit the label with the object inspector(window) you see...

Align
Alignment
+Anchors
AutoSize

If someone can give me a very simple working component that does this that would be great. I Will give more points depending on the answer.

My component has to look like this...

MyComponent
+DataA
      .ValueX : Integer
      .ValueY : Integer
+DataB
      .ValueX : Integer
      .ValueY : Integer
.Means : Integer
0
Comment
Question by:divnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:netbeto
ID: 2775032
Hy divnet,
i don't have the right code now, but you just must to create the propert in the publich place and use array to make what you want.

hope to had give you a help,

cheers,

NetBeto
0
 
LVL 15

Expert Comment

by:simonet
ID: 2775072
You need to derive the class fom TPersistent and then make that class a property of your component.

Alex
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 2775340
I agree with simonet.
Do smth like this:

TPersistentData= class(TPersitent)
private
  FValueX: Integer;
  FValueY: Integer;
published
  ValueX: Integer read FValueX write FValueX;
  ValueY: Integer read FValueY write FValueY;
end;

TMyComponent= class(TComponent)
privte
  FDataA, FDataB: TPersitentData;
public
  constructor Create(AOwner: TComponent); override; // create your persistent objects in the constructor
  destructor Destroy; override; // and destroy them before destroying the component
published
  DataA: TPerstentData read FDataA;
  DataB: TPerstentData read FDataB;
end;

Regards, ptm.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:ptmcomp
ID: 2775345
Seams that my computer is hungry and eat some chars... >;o)
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 400 total points
ID: 2775348
Here is a working example (derived from TPanel) that should help you on the right track:


unit MyPanel;

interface

uses  
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls;

type
  TMyProperty = class(TPersistent)
  private
    { Private declarations }
    FValue1: Integer;
    FValue2: Integer;
    FValue3: Boolean;
  protected
    { Protected declarations }
  public
    { Public declarations }
  published
    { Published declarations }
    property Value1: Integer read FValue1 write FValue1;
    property Value2: Integer read FValue2 write FValue2;
    property Value3: Boolean read FValue3 write FValue3;
  end;

  TMyPanel = class(TPanel)
  private
    { Private declarations }
    FMyProperty: TMyProperty;
  protected
    { Protected declarations }
  public
    { Public declarations }
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Published declarations }
    property MyProperty: TMyProperty read FMyProperty write FMyProperty;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Epsylon', [TMyPanel]);
end;

{ TMyPanel }

constructor TMyPanel.Create(AOwner: TComponent);
begin
  inherited;
  FMyProperty := TMyProperty.Create;
end;

destructor TMyPanel.Destroy;
begin
  inherited;
  FMyProperty.Free;
end;

end.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2775355
Sorry ptm, didn't see you comment   :o)

my code is complete though....
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 2778045
There are only two minutes between posting the comments >8o|
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question