| 1 |
{ -*- buffer-read-only: t -*- |
| 2 |
|
| 3 |
Copyright 2018-2022 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 |
{ Automatically generated wrapper to make vectors/colors persistent. |
| 18 |
|
| 19 |
Do not edit this file manually! |
| 20 |
Instead |
| 21 |
- edit tools/internal/generate-persistent-vectors/persistent_vectors_input.txt |
| 22 |
- and run generate-persistent-vectors in that directory. |
| 23 |
} |
| 24 |
|
| 25 |
{$ifdef read_interface_class} |
| 26 |
strict private |
| 27 |
FTextColorPersistent: TCastleColorPersistent; |
| 28 |
function GetTextColorForPersistent: TCastleColor; |
| 29 |
procedure SetTextColorForPersistent(const AValue: TCastleColor); |
| 30 |
published |
| 31 |
{ @link(TextColor) that can be visually edited in |
| 32 |
Castle Game Engine Editor, Lazarus and Delphi. |
| 33 |
Normal user code does not need to deal with this, |
| 34 |
instead read or write @link(TextColor) directly. |
| 35 |
|
| 36 |
@seealso TextColor } |
| 37 |
property TextColorPersistent: TCastleColorPersistent read FTextColorPersistent ; |
| 38 |
{$endif read_interface_class} |
| 39 |
|
| 40 |
{$ifdef read_implementation_methods} |
| 41 |
function TCastleAbstractSlider.GetTextColorForPersistent: TCastleColor; |
| 42 |
begin |
| 43 |
Result := TextColor; |
| 44 |
end; |
| 45 |
|
| 46 |
procedure TCastleAbstractSlider.SetTextColorForPersistent(const AValue: TCastleColor); |
| 47 |
begin |
| 48 |
TextColor := AValue; |
| 49 |
end; |
| 50 |
{$endif read_implementation_methods} |
| 51 |
|
| 52 |
{$ifdef read_implementation_constructor} |
| 53 |
FTextColorPersistent := TCastleColorPersistent.Create(nil); |
| 54 |
{ Note that some classes (like TCastleVector3Persistent) call SetSubComponent(true) |
| 55 |
on themselves, for backward compatibility. But we should not depend on it, |
| 56 |
some classes (like TFloatRectanglePersisten) may not call it. |
| 57 |
The responsibility of calling "SetSubComponent(true)" should be on the owner |
| 58 |
in general (this is more functional, and more standard too). } |
| 59 |
FTextColorPersistent.SetSubComponent(true); |
| 60 |
FTextColorPersistent.InternalGetValue := {$ifdef FPC}@{$endif}GetTextColorForPersistent; |
| 61 |
FTextColorPersistent.InternalSetValue := {$ifdef FPC}@{$endif}SetTextColorForPersistent; |
| 62 |
FTextColorPersistent.InternalDefaultValue := TextColor; // current value is default |
| 63 |
{$endif read_implementation_constructor} |
| 64 |
|
| 65 |
{$ifdef read_implementation_destructor} |
| 66 |
FreeAndNil(FTextColorPersistent); |
| 67 |
{$endif read_implementation_destructor} |
| 68 |
|