public override object Clone() { EscherTextboxRecord etr = new EscherTextboxRecord(); etr.Options = (this.Options); etr.RecordId = (this.RecordId); etr._thedata = (byte[])this._thedata.Clone(); return(etr); }
protected override EscherContainerRecord CreateSpContainer() { EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherClientDataRecord clientData = new EscherClientDataRecord(); EscherTextboxRecord escherTextbox = new EscherTextboxRecord(); spContainer.RecordId = (EscherContainerRecord.SP_CONTAINER); spContainer.Options = ((short)0x000F); sp.RecordId = (EscherSpRecord.RECORD_ID); sp.Options = ((short)((EscherAggregate.ST_TEXTBOX << 4) | 0x2)); sp.Flags = (EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE); opt.RecordId = (EscherOptRecord.RECORD_ID); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTID, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__WRAPTEXT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__ANCHORTEXT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00080000)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTLEFT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTRIGHT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTTOP, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTBOTTOM, 0)); opt.SetEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, LINESTYLE_SOLID)); opt.SetEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008)); opt.SetEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT)); opt.SetEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT)); opt.SetEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT)); opt.SetEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE)); opt.SetEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x080000)); EscherRecord anchor = Anchor.GetEscherAnchor(); clientData.RecordId = (EscherClientDataRecord.RECORD_ID); clientData.Options = ((short)0x0000); escherTextbox.RecordId = (EscherTextboxRecord.RECORD_ID); escherTextbox.Options = ((short)0x0000); spContainer.AddChildRecord(sp); spContainer.AddChildRecord(opt); spContainer.AddChildRecord(anchor); spContainer.AddChildRecord(clientData); spContainer.AddChildRecord(escherTextbox); return spContainer; }
/// <summary> /// Creates the lowerlevel escher records for this shape. /// </summary> /// <param name="hssfShape">The HSSF shape.</param> /// <param name="shapeId">The shape id.</param> /// <returns></returns> private EscherContainerRecord CreateSpContainer(HSSFTextbox hssfShape, int shapeId) { HSSFTextbox shape = hssfShape; EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherRecord anchor = new EscherClientAnchorRecord(); EscherClientDataRecord clientData = new EscherClientDataRecord(); escherTextbox = new EscherTextboxRecord(); spContainer.RecordId=EscherContainerRecord.SP_CONTAINER; spContainer.Options=(short)0x000F; sp.RecordId=EscherSpRecord.RECORD_ID; sp.Options=(short)((EscherAggregate.ST_TEXTBOX << 4) | 0x2); sp.ShapeId=shapeId; sp.Flags=EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE; opt.RecordId=EscherOptRecord.RECORD_ID; // opt.AddEscherProperty( new EscherBoolProperty( EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 262144 ) ); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTID, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTLEFT, shape.MarginLeft)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTRIGHT, shape.MarginRight)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTBOTTOM, shape.MarginBottom)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTTOP, shape.MarginTop)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__WRAPTEXT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__ANCHORTEXT, 0)); opt.AddEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00080000)); AddStandardOptions(shape, opt); HSSFAnchor userAnchor = shape.Anchor; // if (userAnchor.IsHorizontallyFlipped()) // sp.Flags(sp.Flags | EscherSpRecord.FLAG_FLIPHORIZ); // if (userAnchor.IsVerticallyFlipped()) // sp.Flags(sp.Flags | EscherSpRecord.FLAG_FLIPVERT); anchor = CreateAnchor(userAnchor); clientData.RecordId=EscherClientDataRecord.RECORD_ID; clientData.Options=(short)0x0000; escherTextbox.RecordId=EscherTextboxRecord.RECORD_ID; escherTextbox.Options=(short)0x0000; spContainer.AddChildRecord(sp); spContainer.AddChildRecord(opt); spContainer.AddChildRecord(anchor); spContainer.AddChildRecord(clientData); spContainer.AddChildRecord(escherTextbox); return spContainer; }
private TextObjectRecord GetOrCreateTextObjRecord() { if (GetTextObjectRecord() == null) { _textObjectRecord = CreateTextObjRecord(); } EscherTextboxRecord escherTextbox = (EscherTextboxRecord)GetEscherContainer().GetChildById(EscherTextboxRecord.RECORD_ID); if (null == escherTextbox) { escherTextbox = new EscherTextboxRecord(); escherTextbox.RecordId = (EscherTextboxRecord.RECORD_ID); escherTextbox.Options = ((short)0x0000); GetEscherContainer().AddChildRecord(escherTextbox); Patriarch.getBoundAggregate().AssociateShapeToObjRecord(escherTextbox, _textObjectRecord); } return _textObjectRecord; }
protected override EscherContainerRecord CreateSpContainer() { EscherContainerRecord spContainer = new EscherContainerRecord(); spContainer.RecordId=EscherContainerRecord.SP_CONTAINER; spContainer.Options = ((short)0x000F); EscherSpRecord sp = new EscherSpRecord(); sp.RecordId = (EscherSpRecord.RECORD_ID); sp.Flags = (EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE); sp.Version = ((short)0x2); EscherClientDataRecord clientData = new EscherClientDataRecord(); clientData.RecordId = (EscherClientDataRecord.RECORD_ID); clientData.Options = ((short)(0x0000)); EscherOptRecord optRecord = new EscherOptRecord(); optRecord.SetEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, LINESTYLE_SOLID)); optRecord.SetEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008)); // optRecord.SetEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT)); optRecord.SetEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT)); optRecord.SetEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT)); optRecord.SetEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE)); optRecord.SetEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008)); optRecord.SetEscherProperty(new EscherShapePathProperty(EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX)); optRecord.SetEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x080000)); optRecord.RecordId = EscherOptRecord.RECORD_ID; EscherTextboxRecord escherTextbox = new EscherTextboxRecord(); escherTextbox.RecordId = (EscherTextboxRecord.RECORD_ID); escherTextbox.Options = (short)0x0000; spContainer.AddChildRecord(sp); spContainer.AddChildRecord(optRecord); spContainer.AddChildRecord(this.Anchor.GetEscherAnchor()); spContainer.AddChildRecord(clientData); spContainer.AddChildRecord(escherTextbox); return spContainer; }