Jump to content
wuwuxin

Is it possible to dynamically generate an editor GUI based on a data type class?

Recommended Posts

Is there any existing library or framework that can automatically (dynamically) generate an editor user interface for a user defined class?  For example,

 

TSex = (Male, Female);

 

TMyFunkyDataType = class

    Name: String;  // --- this will generate a text editor

    Sex: TSex;   // --- this will generate a drop down box

end;

Share this post


Link to post
Posted (edited)
3 hours ago, wuwuxin said:

Is there any existing library or framework that can automatically (dynamically) generate an editor user interface for a user defined class?

There are 3rd party Object Inspectors available, if you search around.

 

Or, you could write your own editor using the VCL's TValueListEditor component and some manual RTTI logic.

 

Edited by Remy Lebeau
  • Thanks 1

Share this post


Link to post
14 hours ago, wuwuxin said:

TSex = (Male, Female);

Joke: In today's world you are better suited with a string type.

  • Haha 2

Share this post


Link to post
2 hours ago, aehimself said:

Joke: In today's world you are better suited with a string type. 

You think 26 Characters are enough ? 🤔

  • Haha 1

Share this post


Link to post
20 hours ago, aehimself said:

Joke: In today's world you are better suited with a string type.

Just add "Other", profit 🙂

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×