public static void ResizeColumn(Panel panel, bool right) { if (panel == null) throw new ArgumentNullException("panel"); var view = panel.ViewMode; var plan = panel.GetPlan(view) ?? panel.ViewPlan; if (plan.Columns.Length != 2) return; int width = panel.Window.Width - 2; plan.Columns[0].Width = 0; if (plan.Columns[1].Width == 0) plan.Columns[1].Width = width / 2; int width2 = plan.Columns[1].Width; if (right) { --width2; if (width2 < 1) return; } else { ++width2; if (width2 > width - 2) return; } plan.Columns[1].Width = width2; panel.SetPlan(view, plan); panel.Redraw(); }
public static void SwitchFullScreen(Panel panel) { if (panel == null) throw new ArgumentNullException("panel"); // get/make the plan var iViewMode = panel.ViewMode; var plan = panel.GetPlan(iViewMode) ?? panel.ViewPlan; // drop widths of text columns foreach(var c in plan.Columns) if (c.Kind == "N" || c.Kind == "Z" || c.Kind == "O") c.Width = 0; // switch plan.IsFullScreen = !plan.IsFullScreen; // set panel.SetPlan(iViewMode, plan); panel.Redraw(); }