Solved

Component Building Problem

Posted on 2000-05-03
7
125 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
Industry Leaders: 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 100 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 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