Is it possible to make custom properties read-only

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Is it possible to make custom properties read-only

Postby Taygete » Sat May 31, 2014 4:12 pm

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.
Taygete
Active Member
 
Posts: 29
Joined: Wed May 14, 2014 8:53 am

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

Postby hungerburg » Sat May 31, 2014 7:40 pm

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.
User avatar
hungerburg
Senior Member
 
Posts: 125
Joined: Fri May 28, 2010 7:35 pm

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

Postby Taygete » Sun Jun 01, 2014 6:00 am

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.
Taygete
Active Member
 
Posts: 29
Joined: Wed May 14, 2014 8:53 am

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

Postby hungerburg » Tue Jun 03, 2014 10:19 am

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.
User avatar
hungerburg
Senior Member
 
Posts: 125
Joined: Fri May 28, 2010 7:35 pm

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

Postby Taygete » Tue Jun 03, 2014 3:26 pm

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.
Taygete
Active Member
 
Posts: 29
Joined: Wed May 14, 2014 8:53 am

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

Postby andrew » Thu Jun 05, 2014 8:38 am

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?
User avatar
andrew
Site Admin
 
Posts: 2567
Joined: Fri Mar 30, 2007 6:07 am

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

Postby Taygete » Thu Jun 05, 2014 4:46 pm

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.
Taygete
Active Member
 
Posts: 29
Joined: Wed May 14, 2014 8:53 am


Return to QCAD 3 Developers and Contributors

Who is online

Users browsing this forum: No registered users and 2 guests

cron