Пример #1
0
 internal void FixDwgIds(TDrawing Drawing, TSheet sSheet, bool UseObjId, TCopiedGen CopiedGen)
 {
     for (int i = 0; i < Count; i++)
     {
         this[i].FixDwgIds(Drawing, i, sSheet, UseObjId, CopiedGen);
     }
 }
Пример #2
0
        /// <summary>
        /// CreateFromData
        /// </summary>
        internal TNoteRecord(int aRow, int aCol, TRichString aTxt, string aAuthor, TDrawing Drawing, TImageProperties Properties,
                             ExcelFile xls, TSheet sSheet, bool ReadFromXlsx)
            : base((int)xlr.NOTE, aCol)
        {
            if ((aCol < 0) || (aCol > FlxConsts.Max_Columns))
            {
                XlsMessages.ThrowException(XlsErr.ErrXlsIndexOutBounds, aCol, "Column", 0, FlxConsts.Max_Columns);
            }

            Dwg = Drawing.AddNewComment(xls, Properties, sSheet, ReadFromXlsx);
            TEscherImageAnchorRecord Anchor = GetImageRecord();

            if (Anchor != null)
            {
                NoteTextBox = Anchor.SaveCommentCoords(sSheet, aRow, aCol);
            }

            Col         = aCol;
            OptionFlags = 0;   //option flags
            unchecked
            {
                ObjId = (UInt16)Dwg.ObjId;   //object id
            }

            Author = aAuthor;

            SetText(aTxt);
        }
Пример #3
0
        private bool AddToTree(TEscherClientDataRecord obj, bool MightNotBeFirst, IRowColSize Workbook)
        {
            TEscherOPTRecord CbObj    = (obj.Parent as TEscherSpContainerRecord).FindRec <TEscherOPTRecord>() as TEscherOPTRecord;
            TClientAnchor    CbAnchor = TDrawing.GetObjectAnchorAbsolute(CbObj, Workbook);

            for (int i = 1; i < Tree.Count; i++) // 0 is desktop
            {
                TEscherOPTRecord GrpObj  = (Tree[i].Group.Parent as TEscherSpContainerRecord).FindRec <TEscherOPTRecord>() as TEscherOPTRecord;
                TClientAnchor    GAnchor = TDrawing.GetObjectAnchorAbsolute(GrpObj, Workbook);

                if ((MightNotBeFirst || Tree[i].Buttons.Count == 0) && GAnchor.Contains(CbAnchor))
                {
                    AddRadioButton(obj, i);
                    return(true);
                }
            }

            if (MightNotBeFirst || Tree[0].Buttons.Count == 0)
            {
                AddRadioButton(obj, 0);
                return(true);
            }

            return(false);
        }
Пример #4
0
/*Now we keep range to insert on dwgofs. Inserting here could lead to inserting rows on the cells (and moving the red triangle down), but not on the note. Both must move together.
 *         internal override void ArrangeInsertRange(int Row, TXlsCellRange CellRange, int aRowCount, int aColCount, TSheetInfo SheetInfo)
 *      {
 *          if ((SheetInfo.InsSheet<0) || (SheetInfo.SourceFormulaSheet != SheetInfo.InsSheet)) return;  //this is also on the base.arrangeinsertrange, but we want to keep both inserts together. If we insert on the red triangle, we insert on the shape. If we don't we don't no matter that the shape is on range to insert.
 *
 *          base.ArrangeInsertRange (Row, CellRange, aRowCount, aColCount, SheetInfo);
 *          if ((Dwg!=null) && (Dwg.FindRoot()!=null))
 *          {
 *              Dwg.FindRoot().ArrangeInsertRange(CellRange, aRowCount, aColCount, SheetInfo, true);
 *          }
 *      }
 */
        internal void FixDwgIds(TDrawing Drawing, int Row, TSheet sSheet, bool UseObjId, TCopiedGen CopiedGen)
        {
            if (UseObjId)
            {
                Dwg = Drawing.FindObjId(ObjId);
            }
            else
            {
                if (Dwg != null)
                {
                    Dwg = Dwg.CopiedTo(CopiedGen) as TEscherClientDataRecord;
                }
                if (Dwg != null)
                {
                    ObjId = (UInt16)Dwg.ObjId;
                }
            }
            TEscherImageAnchorRecord Anchor = GetImageRecord();

            if (Anchor != null)
            {
                NoteTextBox = Anchor.SaveCommentCoords(sSheet, Row, Col);
            }
        }
Пример #5
0
        internal void AddNewComment(int Row, int Col, TRichString Txt, string Author, TDrawing Drawing, TImageProperties Properties,
                                    ExcelFile xls, TSheet sSheet, bool ReadFromXlsx)
        {
            TNoteRecord R = new TNoteRecord(Row, Col, Txt, Author, Drawing, Properties, xls, sSheet, ReadFromXlsx); //.CreateFromData

            AddRecord(R, Row);
        }