Board index » cppbuilder » Property Editor for a Set

Property Editor for a Set


2004-03-04 02:23:37 AM
cppbuilder94
Colleagues
Could some one please post some sample code for a Property Editor (for use
by Object Inspector) for a Set which is defined as:
template<class T, unsigned char minEl, unsigned char maxEl>class
__declspec(delphireturn) Set;
Regards
Ray Carpenter
 
 

Re:Property Editor for a Set

"Ray Carpenter" < XXXX@XXXXX.COM >wrote in message
Quote
Could some one please post some sample code for a
Property Editor (for use by Object Inspector) for a Set
The VCL already has a native property editor for Sets - TSetProperty. You
don't need to do anything extra to invoke it, the Object Inspector already
uses it when it encounters a Set property in a component. Just make sure
that the values of your Set elements are sequential and start from 0
upwards, that's all.
Gambit
 

Re:Property Editor for a Set

Remy
Thank you for your response.
When an uninitialsed Set is expanded in the Object Inspector, it shows the
value of all elements as false as would be expected. However, I cannot
change the value of any element to true, and so it appears that I am missing
something here.
Regards
Ray Carpenter
Remy Lebeau (TeamB) < XXXX@XXXXX.COM >wrote in message
Quote

"Ray Carpenter" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>Could some one please post some sample code for a
>Property Editor (for use by Object Inspector) for a Set

The VCL already has a native property editor for Sets - TSetProperty. You
don't need to do anything extra to invoke it, the Object Inspector already
uses it when it encounters a Set property in a component. Just make sure
that the values of your Set elements are sequential and start from 0
upwards, that's all.


Gambit


 

{smallsort}

Re:Property Editor for a Set

Ray Carpenter wrote:
Quote
Remy

Thank you for your response.

When an uninitialsed Set is expanded in the Object Inspector, it shows the
value of all elements as false as would be expected. However, I cannot
change the value of any element to true, and so it appears that I am missing
something here.

Do you have a 'write' accessor on your property ?
 

Re:Property Editor for a Set

I have no code at the moment for anything. If a write accessor is needed, I
would appreciate some sample code.
Regards
Ray Carpenter
OBones < XXXX@XXXXX.COM >wrote in message
Quote
Ray Carpenter wrote:

>Remy
>
>Thank you for your response.
>
>When an uninitialsed Set is expanded in the Object Inspector, it shows
the
>value of all elements as false as would be expected. However, I cannot
>change the value of any element to true, and so it appears that I am
missing
>something here.
>

Do you have a 'write' accessor on your property ?

 

Re:Property Editor for a Set

Ray Carpenter wrote:
Quote
I have no code at the moment for anything. If a write accessor is needed, I
would appreciate some sample code.

type
TOptions = (opOne, opTwo, opThree);
TOptionsSet = set of TOptions
TMyComp = class(TComponent)
private
FOptions : TOptionsSet;
published
property Options: TOptionsSet read FOptions write FOptions;
end;
This should be enough.
 

Re:Property Editor for a Set

"Ray Carpenter" < XXXX@XXXXX.COM >wrote in message
Quote
When an uninitialsed Set is expanded in the Object Inspector, it
shows the value of all elements as false as would be expected.
However, I cannot change the value of any element to true, and
so it appears that I am missing something here.
I would suspect a bug in your own component code before I suspect a bug in
the native editors. Please show your actual code for the property in
question.
Gambit
 

Re:Property Editor for a Set

"OBones" < XXXX@XXXXX.COM >wrote in message
Quote
Do you have a 'write' accessor on your property ?
That is not needed for a Set property, although it won't hurt anything,
either.
Gambit
 

Re:Property Editor for a Set

"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
That is not needed for a Set property, although it
won't hurt anything, either.
Sorry, I thought you meant to have a setter method, not a write specifier in
general.
Although, if no write specifier were present, the property would not appear
in the Object Inspector at all to begin with.
Gambit