/// <summary> /// Construct a new textbox with the given parent and anchor. /// </summary> /// <param name="parent">The parent.</param> /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param> public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { HorizontalAlignment = HorizontalTextAlignment.Left; VerticalAlignment = VerticalTextAlignment.Top; this.String = (new HSSFRichTextString("")); }
/// <summary> /// Constructs a picture object. /// </summary> /// <param name="parent">The parent.</param> /// <param name="anchor">The anchor.</param> public HSSFPicture(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { base.ShapeType = (OBJECT_TYPE_PICTURE); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0]; cod.ObjectType = CommonObjectType.Picture; }
/// <summary> /// Create a new shape with the specified parent and anchor. /// </summary> /// <param name="parent">The parent.</param> /// <param name="anchor">The anchor.</param> public HSSFShape(HSSFShape parent, HSSFAnchor anchor) { this.parent = parent; this.anchor = anchor; this._escherContainer = CreateSpContainer(); _optRecord = (EscherOptRecord)_escherContainer.GetChildById(EscherOptRecord.RECORD_ID); _objRecord = CreateObjRecord(); }
public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { base.ShapeType = (OBJECT_TYPE_COMBO_BOX); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0]; cod.ObjectType = CommonObjectType.ComboBox; }
public bool RemoveShape(HSSFShape shape) { bool isRemoved = GetEscherContainer().RemoveChildRecord(shape.GetEscherContainer()); if (isRemoved) { shape.AfterRemove(this.Patriarch); shapes.Remove(shape); } return(isRemoved); }
/** * @param shape to be removed * @return true of shape is removed */ public bool RemoveShape(HSSFShape shape) { bool isRemoved = _mainSpgrContainer.RemoveChildRecord(shape.GetEscherContainer()); if (isRemoved) { shape.AfterRemove(this); _shapes.Remove(shape); } return(isRemoved); }
internal override void AfterRemove(HSSFPatriarch patriarch) { patriarch.GetBoundAggregate().RemoveShapeToObjRecord(GetEscherContainer().ChildContainers[0] .GetChildById(EscherClientDataRecord.RECORD_ID)); for (int i = 0; i < shapes.Count; i++) { HSSFShape shape = (HSSFShape)shapes[i]; RemoveShape(shape); shape.AfterRemove(Patriarch); } shapes.Clear(); }
private void SetFlipFlags(HSSFShape shape) { EscherSpRecord sp = (EscherSpRecord)shape.GetEscherContainer().GetChildById(EscherSpRecord.RECORD_ID); if (shape.Anchor.IsHorizontallyFlipped) { sp.Flags = (sp.Flags | EscherSpRecord.FLAG_FLIPHORIZ); } if (shape.Anchor.IsVerticallyFlipped) { sp.Flags = (sp.Flags | EscherSpRecord.FLAG_FLIPVERT); } }
private void OnCreate(HSSFShape shape) { EscherContainerRecord spgrContainer = _boundAggregate.GetEscherContainer().ChildContainers[0]; EscherContainerRecord spContainer = shape.GetEscherContainer(); int shapeId = NewShapeId(); shape.ShapeId = shapeId; spgrContainer.AddChildRecord(spContainer); shape.AfterInsert(this); SetFlipFlags(shape); }
/// <summary> /// Construct a new comment with the given parent and anchor. /// </summary> /// <param name="parent"></param> /// <param name="anchor">defines position of this anchor in the sheet</param> public HSSFComment(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { _note = CreateNoteRecord(); //default color for comments FillColor = 0x08000050; //by default comments are hidden Visible = false; Author = ""; CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0]; cod.ObjectType = CommonObjectType.Comment; }
private void OnCreate(HSSFShape shape) { if (this.Patriarch != null) { EscherContainerRecord spContainer = shape.GetEscherContainer(); int shapeId = this.Patriarch.NewShapeId(); shape.ShapeId = (shapeId); GetEscherContainer().AddChildRecord(spContainer); shape.AfterInsert(Patriarch); EscherSpRecord sp; if (shape is HSSFShapeGroup) { sp = (EscherSpRecord)shape.GetEscherContainer().ChildContainers[0].GetChildById(EscherSpRecord.RECORD_ID); } else { sp = (EscherSpRecord)shape.GetEscherContainer().GetChildById(EscherSpRecord.RECORD_ID); } sp.Flags = sp.Flags | EscherSpRecord.FLAG_CHILD; } }
public HSSFPolygon(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { }
public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { _spgrRecord = (EscherSpgrRecord)((EscherContainerRecord)GetEscherContainer().GetChild(0)).GetChildById(EscherSpgrRecord.RECORD_ID); }
public void AddShape(HSSFShape shape) { shape.Patriarch = (this.Patriarch); shape.Parent = (this); shapes.Add(shape); }
/** * add a shape to this drawing */ public void AddShape(HSSFShape shape) { shape.Patriarch = this; _shapes.Add(shape); }
/// <summary> /// Initializes a new instance of the <see cref="HSSFSimpleShape"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="anchor">The anchor.</param> public HSSFSimpleShape(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { _textObjectRecord = CreateTextObjRecord(); }