/** * 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, LF.Utils.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)LF.Utils.NPOI.SS.UserModel.PanePosition.LOWER_RIGHT; }
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 (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); }