public override Object Clone() { PaneRecord rec = new PaneRecord(); rec.field_1_x = field_1_x; rec.field_2_y = field_2_y; rec.field_3_topRow = field_3_topRow; rec.field_4_leftColumn = field_4_leftColumn; rec.field_5_activePane = field_5_activePane; return(rec); }
public void TestLoad() { PaneRecord record = new PaneRecord(TestcaseRecordInputStream.Create((short)0x41, data)); Assert.AreEqual((short)1, record.X); Assert.AreEqual((short)2, record.Y); Assert.AreEqual((short)3, record.TopRow); Assert.AreEqual((short)4, record.LeftColumn); Assert.AreEqual(PaneRecord.ACTIVE_PANE_LOWER_LEFT, record.ActivePane); Assert.AreEqual(14, record.RecordSize); }
public void TestStore() { PaneRecord record = new PaneRecord(); record.X=((short)1); record.Y=((short)2); record.TopRow=((short)3); record.LeftColumn=((short)4); record.ActivePane=(PaneRecord.ACTIVE_PANE_LOWER_LEFT); byte[] recordBytes = record.Serialize(); Assert.AreEqual(recordBytes.Length - 4, data.Length); for (int i = 0; i < data.Length; i++) Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i); }
public override Object Clone() { PaneRecord rec = new PaneRecord(); rec.field_1_x = field_1_x; rec.field_2_y = field_2_y; rec.field_3_topRow = field_3_topRow; rec.field_4_leftColumn = field_4_leftColumn; rec.field_5_activePane = field_5_activePane; return rec; }
/** * Creates a split pane. Any existing freezepane or split pane is overwritten. * @param xSplitPos Horizonatal position of split (in 1/20th of a point). * @param ySplitPos Vertical position of split (in 1/20th of a point). * @param topRow Top row visible in bottom pane * @param leftmostColumn Left column visible in right pane. * @param activePane Active pane. One of: PANE_LOWER_RIGHT, * PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT * @see #PANE_LOWER_LEFT * @see #PANE_LOWER_RIGHT * @see #PANE_UPPER_LEFT * @see #PANE_UPPER_RIGHT */ public void CreateSplitPane(int xSplitPos, int ySplitPos, int topRow, int leftmostColumn, NPOI.SS.UserModel.PanePosition activePane) { int paneLoc = FindFirstRecordLocBySid(PaneRecord.sid); if (paneLoc != -1) records.RemoveAt(paneLoc); int loc = FindFirstRecordLocBySid(WindowTwoRecord.sid); PaneRecord r = new PaneRecord(); r.X = ((short)xSplitPos); r.Y = ((short)ySplitPos); r.TopRow = ((short)topRow); r.LeftColumn = ((short)leftmostColumn); r.ActivePane = ((short)activePane); records.Insert(loc + 1, r); windowTwo.FreezePanes = (false); windowTwo.FreezePanesNoSplit = (false); SelectionRecord sel = (SelectionRecord)FindFirstRecordBySid(SelectionRecord.sid); sel.Pane = (byte)NPOI.SS.UserModel.PanePosition.LOWER_RIGHT; }
/** * Creates a split (freezepane). Any existing freezepane or split pane Is overwritten. * @param colSplit Horizonatal position of split. * @param rowSplit Vertical position of split. * @param topRow Top row visible in bottom pane * @param leftmostColumn Left column visible in right pane. */ public void CreateFreezePane(int colSplit, int rowSplit, int topRow, int leftmostColumn) { int paneLoc = FindFirstRecordLocBySid(PaneRecord.sid); if (paneLoc != -1) records.RemoveAt(paneLoc); // If both colSplit and rowSplit are zero then the existing freeze pane is removed if (colSplit == 0 && rowSplit == 0) { windowTwo.FreezePanes = (false); windowTwo.FreezePanesNoSplit = (false); SelectionRecord sel = (SelectionRecord)FindFirstRecordBySid(SelectionRecord.sid); sel.Pane = (PaneInformation.PANE_UPPER_LEFT); return; } int loc = FindFirstRecordLocBySid(WindowTwoRecord.sid); PaneRecord pane = new PaneRecord(); pane.X = ((short)colSplit); pane.Y = ((short)rowSplit); pane.TopRow = ((short)topRow); pane.LeftColumn = ((short)leftmostColumn); if (rowSplit == 0) { pane.TopRow = ((short)0); pane.ActivePane = ((short)1); } else if (colSplit == 0) { pane.LeftColumn = ((short)0); pane.ActivePane = ((short)2); } else { pane.ActivePane = ((short)0); } records.Insert(loc + 1, pane); windowTwo.FreezePanes = (true); windowTwo.FreezePanesNoSplit = (true); SelectionRecord sel1 = (SelectionRecord)FindFirstRecordBySid(SelectionRecord.sid); sel1.Pane = ((byte)pane.ActivePane); }
/** * Creates a split (freezepane). Any existing freezepane or split pane Is overwritten. * @param colSplit Horizonatal position of split. * @param rowSplit Vertical position of split. * @param topRow Top row visible in bottom pane * @param leftmostColumn Left column visible in right pane. */ public void CreateFreezePane(int colSplit, int rowSplit, int topRow, int leftmostColumn) { int paneLoc = FindFirstRecordLocBySid(PaneRecord.sid); if (paneLoc != -1) records.RemoveAt(paneLoc); int loc = FindFirstRecordLocBySid(WindowTwoRecord.sid); PaneRecord pane = new PaneRecord(); pane.X = ((short)colSplit); pane.Y = ((short)rowSplit); pane.TopRow = ((short)topRow); pane.LeftColumn = ((short)leftmostColumn); if (rowSplit == 0) { pane.TopRow = ((short)0); pane.ActivePane = ((short)1); } else if (colSplit == 0) { pane.LeftColumn = ((short)64); pane.ActivePane = ((short)2); } else { pane.ActivePane = ((short)0); } records.Insert(loc + 1, pane); windowTwo.FreezePanes = (true); windowTwo.FreezePanesNoSplit = (true); SelectionRecord sel = (SelectionRecord)FindFirstRecordBySid(SelectionRecord.sid); sel.Pane = ((byte)pane.ActivePane); }