Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VCL Component Creation Problem

Posted on 2000-05-03
4
Medium Priority
?
140 Views
Last Modified: 2010-04-04
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:gavar
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:divnet
ID: 2776933
I think this is worth more then 50 points! but here is the full source for a component to do what you want it to.

unit testIT;

interface

uses
  Windows, Messages, Classes, Controls, Graphics, extCtrls, stdctrls,
  Forms, sysutils, dialogs;

type
  tData = Class(TPersistent)
  private
    x,y : integer;
  public
  published
    property DataX : Integer read x write x default 0;
    property DataY : Integer read y write y default 1;
  end;

  TtestIT = Class(TComponent)
  private
    fdata : tdata;
    FEnabled : Boolean;
    procedure SetEnabled(Value: Boolean);
  protected
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Enabled : Boolean read FEnabled write SetEnabled default True;
    property data : tdata read fdata write fdata;
  end;


procedure Register;

implementation

constructor Ttestit.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FEnabled := True;
  fdata := tdata.create;
end;
procedure TtestIt.SetEnabled(Value: Boolean); begin if Value <> FEnabled then FEnabled := Value; end;
destructor TtestIT.Destroy; Begin FEnabled := False; inherited Destroy; end;

procedure Register;
begin
  RegisterComponents('Test IT', [tTestit]);
end;

end.
0
 

Author Comment

by:gavar
ID: 2776963
Adjusted points from 50 to 480
0
 
LVL 1

Accepted Solution

by:
divnet earned 2000 total points
ID: 2776989
My Answer was my comment up above.

0
 

Author Comment

by:gavar
ID: 2777017
Adjusted points from 480 to 500
0

Featured Post

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!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

877 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