94 lines
2.4 KiB
Plaintext
94 lines
2.4 KiB
Plaintext
type SrgbClr = class(OpenXmlElement)
|
|
public
|
|
function Create();overload;
|
|
function Create(_node: XmlNode);overload;
|
|
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
|
|
function Init();override;
|
|
function Copy(_obj: SrgbClr);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Val read ReadXmlAttrVal write WriteXmlAttrVal;
|
|
function ReadXmlAttrVal();
|
|
function WriteXmlAttrVal(_value);
|
|
|
|
// normal property
|
|
property Alpha read ReadXmlChildAlpha;
|
|
function ReadXmlChildAlpha();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrVal: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildAlpha: PureVal;
|
|
|
|
end;
|
|
|
|
function SrgbClr.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "a", "srgbClr");
|
|
end;
|
|
|
|
function SrgbClr.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function SrgbClr.Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
|
|
begin
|
|
setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200);
|
|
class(OpenXmlElement).Create(_parent, _prefix, _local_name);
|
|
end;
|
|
|
|
function SrgbClr.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"val": makeweakref(thisFunction(WriteXmlAttrVal)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "aplha": array(0, makeweakref(thisFunction(ReadXmlChildAlpha))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function SrgbClr.Copy(_obj: SrgbClr);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Val) then
|
|
{self.}Val := _obj.Val;
|
|
if not ifnil(_obj.XmlChildAlpha) then
|
|
{self.}Alpha.Copy(_obj.XmlChildAlpha);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function SrgbClr.ReadXmlAttrVal();
|
|
begin
|
|
return {self.}XmlAttrVal.Value;
|
|
end;
|
|
|
|
function SrgbClr.WriteXmlAttrVal(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrVal) then
|
|
begin
|
|
{self.}XmlAttrVal := new OpenXmlAttribute("", "val", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrVal;
|
|
end
|
|
{self.}XmlAttrVal.Value := _value;
|
|
end;
|
|
|
|
function SrgbClr.ReadXmlChildAlpha();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildAlpha) then
|
|
begin
|
|
{self.}XmlChildAlpha := new PureVal(self, {self.}Prefix, "aplha");
|
|
container_.Set({self.}XmlChildAlpha);
|
|
end
|
|
return {self.}XmlChildAlpha;
|
|
end;
|