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

x
?
Solved

Adding component selection to your created component's object inspector

Posted on 2002-04-17
5
Medium Priority
?
274 Views
Last Modified: 2010-04-04
I am creating a component, and one of the published properities (to show up in the object inspector) needs to be a drop-down selection box that is populated with all of the TTable components on the current form.  I tried looking at the .pas files for some of the standard VCL components that do this, but I couldnt follow all of the code.

Any thoughts  on how to do this?
chmod101
0
Comment
Question by:chmod101
[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
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6947778
marker for coming back later . . .
0
 
LVL 10

Expert Comment

by:Jacco
ID: 6948131
Normally you don't have to do anything for that.

TComponentProperty does all that for you.

The property must be in the published section of the component.

Regards Jacco

(I am verifying this at the moment)
0
 
LVL 10

Accepted Solution

by:
Jacco earned 140 total points
ID: 6948145
The following code tested OK with what I said on D5. What might be the problem is the name of your property (some property editors are registers only by name and work for all classes). Can you give us the name of the property and your version of Delphi?

unit Test;

interface

uses
  Classes, Db, DbTables;

type
  TMyComp = class(TComponent)
  private
    fTable: TTable;
  published
    property Table: TTable read fTable write fTable;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Jacco', [TMyComp]);
end;

end.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6948338
yep, i thought this,
but didn't had the time for a check
0
 

Author Comment

by:chmod101
ID: 6962851
Thanks Jacco,

I haven't done anything  like this before, so I didn't know that you could just declare the property as a TTable property, and that Delphi would automatically populate a listing of all TTables available.

Thanks for the help.
chmod101
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

610 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