126 lines
3.5 KiB
Plaintext
126 lines
3.5 KiB
Plaintext
type SchemeClr = 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: SchemeClr);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Val read ReadXmlAttrVal write WriteXmlAttrVal;
|
|
function ReadXmlAttrVal();
|
|
function WriteXmlAttrVal(_value);
|
|
|
|
// normal property
|
|
property LumMod read ReadXmlChildLumMod;
|
|
property SatMod read ReadXmlChildSatMod;
|
|
property Tint read ReadXmlChildTint;
|
|
function ReadXmlChildLumMod();
|
|
function ReadXmlChildSatMod();
|
|
function ReadXmlChildTint();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrVal: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildLumMod: PureVal;
|
|
XmlChildSatMod: PureVal;
|
|
XmlChildTint: PureVal;
|
|
|
|
end;
|
|
|
|
function SchemeClr.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "a", "schemeClr");
|
|
end;
|
|
|
|
function SchemeClr.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function SchemeClr.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 SchemeClr.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"val": makeweakref(thisFunction(WriteXmlAttrVal)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "lumMod": array(0, makeweakref(thisFunction(ReadXmlChildLumMod))),
|
|
pre + "satMod": array(1, makeweakref(thisFunction(ReadXmlChildSatMod))),
|
|
pre + "tint": array(2, makeweakref(thisFunction(ReadXmlChildTint))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function SchemeClr.Copy(_obj: SchemeClr);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.XmlChildLumMod) then
|
|
{self.}LumMod.Copy(_obj.XmlChildLumMod);
|
|
if not ifnil(_obj.XmlChildSatMod) then
|
|
{self.}SatMod.Copy(_obj.XmlChildSatMod);
|
|
if not ifnil(_obj.XmlChildTint) then
|
|
{self.}Tint.Copy(_obj.XmlChildTint);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function SchemeClr.ReadXmlAttrVal();
|
|
begin
|
|
return {self.}XmlAttrVal.Value;
|
|
end;
|
|
|
|
function SchemeClr.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 SchemeClr.ReadXmlChildLumMod();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildLumMod) then
|
|
begin
|
|
{self.}XmlChildLumMod := new PureVal(self, {self.}Prefix, "lumMod");
|
|
container_.Set({self.}XmlChildLumMod);
|
|
end
|
|
return {self.}XmlChildLumMod;
|
|
end;
|
|
|
|
function SchemeClr.ReadXmlChildSatMod();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildSatMod) then
|
|
begin
|
|
{self.}XmlChildSatMod := new PureVal(self, {self.}Prefix, "satMod");
|
|
container_.Set({self.}XmlChildSatMod);
|
|
end
|
|
return {self.}XmlChildSatMod;
|
|
end;
|
|
|
|
function SchemeClr.ReadXmlChildTint();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildTint) then
|
|
begin
|
|
{self.}XmlChildTint := new PureVal(self, {self.}Prefix, "tint");
|
|
container_.Set({self.}XmlChildTint);
|
|
end
|
|
return {self.}XmlChildTint;
|
|
end;
|