private static void RelaxModeOn(Form1 form) { XtraTabControl pagesTabControl = form.pagesTabControl; ToolStrip sessionToolStrip = form.sessionToolStrip; ToolStripMenuItem fullscreenToolStripMenuItem = form.fullscreenToolStripMenuItem; pagesTabControl.ContextMenuStrip = null; pagesTabControl.ShowTabHeader = DefaultBoolean.False; fullscreenToolStripMenuItem.Text = LanguageUtil.GetCurrentLanguageString("ExitRelaxMode", className); fullscreenToolStripMenuItem.Visible = true; WindowManager.CheckToolbar(form, true, false, false); WindowManager.CheckStatusBar(form, true, false, false); WindowManager.CheckLineNumbers(form, false, false); WindowManager.CheckWordWrap(form, false, false); WindowManager.CheckInternalExplorer(form, false, false); WindowManager.CheckSearchReplacePanel(form, false, false); sessionToolStrip.Visible = false; form.FormBorderStyle = FormBorderStyle.None; form.TopMost = true; form.WindowState = FormWindowState.Normal; form.Size = new Size(Screen.FromControl(form).Bounds.Width, Screen.FromControl(form).Bounds.Height); form.SetDesktopLocation(0, 0); #if Debug form.TopMost = false; #endif AddRelaxModeMargins(form); if (ColumnRulerManager.IsPanelOpen(pagesTabControl.SelectedTabPage)) { ColumnRulerManager.ClosePanel(pagesTabControl.SelectedTabPage); } if (CustomFilesManager.IsHostsSectionPanelOpen(form)) { CustomFilesManager.ToggleHostsSectionPanel(form); } if (CustomFilesManager.IsAnnotationPanelOpen(form)) { CustomFilesManager.HideAnnotationPanel(form); } }
private static void OpenPanel(Form1 form, XtraTabPage tabPage) { CustomRichTextBox pageTextBox = ProgramUtil.GetPageTextBox(tabPage); CustomLineNumbers customLineNumbers = ProgramUtil.GetCustomLineNumbers(tabPage); bool wasHostsSectionOpen = false; if (CustomFilesManager.IsHostsSectionPanelOpen(form)) { wasHostsSectionOpen = true; CustomFilesManager.ToggleHostsSectionPanel(form, true); } String annotationText = String.Empty; if (CustomFilesManager.IsAnnotationPanelOpen(form)) { annotationText = CustomFilesManager.GetAnnotationPanelText(form); CustomFilesManager.ToggleAnnotationPanel(form, true); } int left = 0; if (ConfigUtil.GetBoolParameter("LineNumbersVisible")) { left = customLineNumbers.Width; } //Panel RichTextBox columnRulerTextBox = new RichTextBox { Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left, BackColor = pageTextBox.BackColor, BorderStyle = BorderStyle.None, Font = pageTextBox.Font, //ForeColor = pageTextBox.ForeColor, ForeColor = SystemColors.AppWorkspace, Height = Convert.ToInt32(pageTextBox.Font.GetHeight() * 2 + 5), //35 Left = left, Multiline = true, Name = "columnRulerTextBox", ReadOnly = true, ScrollBars = RichTextBoxScrollBars.None, ShortcutsEnabled = false, Text = ConstantUtil.columnsHeader, Width = pageTextBox.Width + 1, WordWrap = false }; CustomPanel columnRulerPanel = new CustomPanel { Dock = DockStyle.Top, Height = columnRulerTextBox.Height + 1, Name = "columnRulerPanel", Width = tabPage.Width, HorizontalLine = true, MarginLeftHorizontalLine = tabPage.Width - columnRulerTextBox.Width - 5 }; columnRulerPanel.Controls.Add(columnRulerTextBox); tabPage.Controls.Add(columnRulerPanel); if (wasHostsSectionOpen) { CustomFilesManager.ToggleHostsSectionPanel(form, true); } if (!String.IsNullOrEmpty(annotationText)) { CustomFilesManager.ToggleAnnotationPanel(form); CustomFilesManager.SetAnnotationPanelText(form, annotationText); } pageTextBox.Focus(); }