Page 1 of 1

Is it possible to make custom properties read-only

Posted: Sat May 31, 2014 4:12 pm
by Taygete
Hi,

I have done a search and haven't been able to find this feature.

I currently set some custom properties in a script which the user can then view and change in the property editor, however there is some data I would like to make read-only so the user cannot change it.

Ideally I would like to be able to set a flag when setting the custom property to be read-only (or another choice might be to make it visible/hidden in the property editor), is this possible?

Thanks,

Andrew.

Re: Is it possible to make custom properties read-only

Posted: Sat May 31, 2014 7:40 pm
by hungerburg
Not an authoritative answer, but I studied xdata in the dxf spec and there is no such flag there. As dxf is the standard file format in qcad such a feature would require a proprietary extension.

Re: Is it possible to make custom properties read-only

Posted: Sun Jun 01, 2014 6:00 am
by Taygete
hungerburg wrote:Not an authoritative answer, but I studied xdata in the dxf spec and there is no such flag there. As dxf is the standard file format in qcad such a feature would require a proprietary extension.
Hi hungerburg,

Thanks for the info, I guess that is why there isn't this option already.

Andrew.

Re: Is it possible to make custom properties read-only

Posted: Tue Jun 03, 2014 10:19 am
by hungerburg
You could put the data that you want to hide from the users below a different APPID than the one users are to modify themselves, so there is at least some visual separation.

Re: Is it possible to make custom properties read-only

Posted: Tue Jun 03, 2014 3:26 pm
by Taygete
hungerburg wrote:You could put the data that you want to hide from the users below a different APPID than the one users are to modify themselves, so there is at least some visual separation.
Hi hungerburg,

Thanks for the idea, I will take a look into that.

Andrew.

Re: Is it possible to make custom properties read-only

Posted: Thu Jun 05, 2014 8:38 am
by andrew
There's definitely some room for improvement for the handling of custom properties.
QCAD stores custom properties as strings in the format 'key:value".

This notation is entirely QCAD specific and could be extended to contain other information such as:
ReadOnly,                  // Property is read only
Invisible,                 // Property is not displayed
Angle,                     // Property is an angle (shown in user preferred angle unit)
RichText,                  // Property is rich text and can be edited as such
Style,                     // Property is a text style (font)
Label,                     // Property is a label (suggests context menu to insert symbols)
Pattern,                   // Property is a hatch pattern name
Integer,                   // Property is an integer number
Double,                    // Property is a double (real) number
Boolean,                   // Property is a boolean (true or false)
List                       // Property is one of several choices presented in a combo box
And possibly others. Any thoughts?

Re: Is it possible to make custom properties read-only

Posted: Thu Jun 05, 2014 4:46 pm
by Taygete
andrew wrote:There's definitely some room for improvement for the handling of custom properties.
QCAD stores custom properties as strings in the format 'key:value".

This notation is entirely QCAD specific and could be extended to contain other information such as:
ReadOnly,                  // Property is read only
Invisible,                 // Property is not displayed
Angle,                     // Property is an angle (shown in user preferred angle unit)
RichText,                  // Property is rich text and can be edited as such
Style,                     // Property is a text style (font)
Label,                     // Property is a label (suggests context menu to insert symbols)
Pattern,                   // Property is a hatch pattern name
Integer,                   // Property is an integer number
Double,                    // Property is a double (real) number
Boolean,                   // Property is a boolean (true or false)
List                       // Property is one of several choices presented in a combo box
And possibly others. Any thoughts?
Hi Andrew,

All those on your list are good ideas, the readonly and invisible are particularly interesting to me.

I will have a think on this and if I come up with any questions or further ideas will post back.

Thanks,

Andrew.