141 lines
3.8 KiB
Plaintext
141 lines
3.8 KiB
Plaintext
type PgSz = 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: PgSz);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property W read ReadXmlAttrW write WriteXmlAttrW;
|
|
property H read ReadXmlAttrH write WriteXmlAttrH;
|
|
property Orient read ReadXmlAttrOrient write WriteXmlAttrOrient;
|
|
property Code read ReadXmlAttrCode write WriteXmlAttrCode;
|
|
function ReadXmlAttrW();
|
|
function WriteXmlAttrW(_value);
|
|
function ReadXmlAttrH();
|
|
function WriteXmlAttrH(_value);
|
|
function ReadXmlAttrOrient();
|
|
function WriteXmlAttrOrient(_value);
|
|
function ReadXmlAttrCode();
|
|
function WriteXmlAttrCode(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrW: OpenXmlAttribute;
|
|
XmlAttrH: OpenXmlAttribute;
|
|
XmlAttrOrient: OpenXmlAttribute;
|
|
XmlAttrCode: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function PgSz.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "pgSz");
|
|
end;
|
|
|
|
function PgSz.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function PgSz.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 PgSz.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
pre + "w": makeweakref(thisFunction(WriteXmlAttrW)),
|
|
pre + "h": makeweakref(thisFunction(WriteXmlAttrH)),
|
|
pre + "orient": makeweakref(thisFunction(WriteXmlAttrOrient)),
|
|
pre + "code": makeweakref(thisFunction(WriteXmlAttrCode)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function PgSz.Copy(_obj: PgSz);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.W) then
|
|
{self.}W := _obj.W;
|
|
if not ifnil(_obj.H) then
|
|
{self.}H := _obj.H;
|
|
if not ifnil(_obj.Orient) then
|
|
{self.}Orient := _obj.Orient;
|
|
if not ifnil(_obj.Code) then
|
|
{self.}Code := _obj.Code;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function PgSz.ReadXmlAttrW();
|
|
begin
|
|
return {self.}XmlAttrW.Value;
|
|
end;
|
|
|
|
function PgSz.WriteXmlAttrW(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrW) then
|
|
begin
|
|
{self.}XmlAttrW := new OpenXmlAttribute({self.}Prefix, "w", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrW;
|
|
end
|
|
{self.}XmlAttrW.Value := _value;
|
|
end;
|
|
|
|
function PgSz.ReadXmlAttrH();
|
|
begin
|
|
return {self.}XmlAttrH.Value;
|
|
end;
|
|
|
|
function PgSz.WriteXmlAttrH(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrH) then
|
|
begin
|
|
{self.}XmlAttrH := new OpenXmlAttribute({self.}Prefix, "h", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrH;
|
|
end
|
|
{self.}XmlAttrH.Value := _value;
|
|
end;
|
|
|
|
function PgSz.ReadXmlAttrOrient();
|
|
begin
|
|
return {self.}XmlAttrOrient.Value;
|
|
end;
|
|
|
|
function PgSz.WriteXmlAttrOrient(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrOrient) then
|
|
begin
|
|
{self.}XmlAttrOrient := new OpenXmlAttribute({self.}Prefix, "orient", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrOrient;
|
|
end
|
|
{self.}XmlAttrOrient.Value := _value;
|
|
end;
|
|
|
|
function PgSz.ReadXmlAttrCode();
|
|
begin
|
|
return {self.}XmlAttrCode.Value;
|
|
end;
|
|
|
|
function PgSz.WriteXmlAttrCode(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrCode) then
|
|
begin
|
|
{self.}XmlAttrCode := new OpenXmlAttribute({self.}Prefix, "code", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrCode;
|
|
end
|
|
{self.}XmlAttrCode.Value := _value;
|
|
end;
|