Page 1 of 1

New custom Component

PostPosted: March 16th, 2009, 11:18 am
by gallo
I am Creating a new component derived from TCustomGropuBox. I had implemented some new properties in this component such as "TYpe" and "Status".
this two properties are of Unumerated type tha means they have a Enumerated type as reference:

TType=(Station,Pallet);
TStatus=(OnWorking,Done,Raw,Locked)

Now I would like to influence the contents of propertry "Status" dependig to what user select in "Type". To be more clear, if the user select "Pallet" in "Type" in the Property "Satus" the option should be as report above, if instead the user select the option "Station" in "Type" the following option should be avaiable in "Status":

TStatus=(Enabled, disabled);

Do you Known how I can mamde it in Delhi?

Thanks

Re: New custom Component

PostPosted: March 16th, 2009, 2:42 pm
by Kambiz
According to the fact that data types are static, you cannot do what you want.

Instead, use two status data types, one for station and the other for pallet.

Re: New custom Component

PostPosted: March 18th, 2009, 7:32 am
by gallo
Thanks for your quickly answer.

Ok I will use two properties, but can I disable/hide one of two properties in depending of what the user choose in "Type" (pallet or station).

I have one more question.
It is possible use the Properties "Trasparent" which is tipically of a "TLabel" component in my "GroupBox" component, I have try in diferent way without result.
Of course if you have an other idea it will be good aniway( I need to draw a drawing in my component but with the background color trasparent).

Thanks in advance.

Re: New custom Component

PostPosted: March 18th, 2009, 9:33 am
by Kambiz
No, you cannot hide/show a property in object inspector.

Just defining the Transparent property doesn't make a control transparent. You have to override wither WM_ERASEBKGND message or Paint method to draw parent's background on the control's canvas. For this purpose you can use theme manager methods. Searching the net may show you some other options for drawing parent's background.