| 1 |
{%MainUnit castlepropedits.pas} |
| 2 |
{ |
| 3 |
Copyright 2010-2019 Michalis Kamburelis. |
| 4 |
|
| 5 |
This file is part of "Castle Game Engine". |
| 6 |
|
| 7 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 8 |
included in this distribution, for details about the copyright. |
| 9 |
|
| 10 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
---------------------------------------------------------------------------- |
| 15 |
} |
| 16 |
|
| 17 |
{ TSubPropertiesEditor ----------------------------------------------------- } |
| 18 |
|
| 19 |
{$ifdef read_interface} |
| 20 |
type |
| 21 |
{ Editor for any published SubComponent, you want to be able to |
| 22 |
expand it in the LCL object inspector. } |
| 23 |
TSubPropertiesEditor = class(TClassPropertyEditor) |
| 24 |
public |
| 25 |
function GetAttributes: TPropertyAttributes; override; |
| 26 |
end; |
| 27 |
|
| 28 |
{$endif read_interface} |
| 29 |
|
| 30 |
{$ifdef read_implementation} |
| 31 |
|
| 32 |
function TSubPropertiesEditor.GetAttributes: TPropertyAttributes; |
| 33 |
begin |
| 34 |
Result := [ |
| 35 |
paMultiSelect, |
| 36 |
paSubProperties, |
| 37 |
paReadOnly, |
| 38 |
|
| 39 |
{ This way changing vector value, like editing TCastleTransform.Translation |
| 40 |
as a whole vector to "1 2 3", is more natural: when you press enter to |
| 41 |
change the vector, the expanded component value (like X: 1) also automatically |
| 42 |
updates. |
| 43 |
|
| 44 |
Without this flag, the expanded component value (like X: 1) is changed |
| 45 |
only when focus shifts to a different property in OI. } |
| 46 |
paVolatileSubProperties |
| 47 |
]; |
| 48 |
end; |
| 49 |
|
| 50 |
{$endif read_implementation} |