From a1fc3d5eb1cf0eb9078b622305f0c1f1a7e7a520 Mon Sep 17 00:00:00 2001 From: niksedk Date: Wed, 16 Aug 2023 11:37:58 +0200 Subject: [PATCH] Use simple text box for better dark theme --- src/ui/Controls/NikseTextBox.cs | 8 + src/ui/Controls/SETextBox.cs | 18 ++ src/ui/Forms/AddToNames.Designer.cs | 4 +- .../Forms/Assa/ApplyCustomStyles.Designer.cs | 17 +- src/ui/Forms/Assa/ApplyCustomStyles.cs | 2 +- src/ui/Forms/Assa/AssaProperties.Designer.cs | 32 +-- src/ui/Forms/Assa/AssaStyles.Designer.cs | 4 +- src/ui/Forms/Assa/TagHistory.Designer.cs | 15 +- src/ui/Forms/BatchConvert.Designer.cs | 4 +- src/ui/Forms/ChangeCasingNames.Designer.cs | 4 +- src/ui/Forms/CheckForUpdates.Designer.cs | 6 +- src/ui/Forms/FixCommonErrors.Designer.cs | 18 +- src/ui/Forms/GoToLine.Designer.cs | 4 +- src/ui/Forms/ImportText.Designer.cs | 4 +- src/ui/Forms/ModifySelection.Designer.cs | 4 +- src/ui/Forms/MultipleReplace.Designer.cs | 12 +- .../Forms/Networking/NetworkJoin.Designer.cs | 8 +- .../Forms/Networking/NetworkStart.Designer.cs | 8 +- src/ui/Forms/Options/WordLists.Designer.cs | 20 +- src/ui/Forms/SpellCheck.Designer.cs | 8 +- src/ui/Forms/StartNumberingFrom.Designer.cs | 4 +- src/ui/Forms/Statistics.Designer.cs | 18 +- src/ui/Forms/TextPrompt.Designer.cs | 4 +- .../TranslateViaCopyPaste.Designer.cs | 10 +- src/ui/Logic/AssaTagHelper.cs | 271 +++++++++++++++++- src/ui/Logic/DarkTheme.cs | 10 + src/ui/SubtitleEdit.csproj | 3 + 27 files changed, 406 insertions(+), 114 deletions(-) create mode 100644 src/ui/Controls/NikseTextBox.cs diff --git a/src/ui/Controls/NikseTextBox.cs b/src/ui/Controls/NikseTextBox.cs new file mode 100644 index 000000000..d59ce63b5 --- /dev/null +++ b/src/ui/Controls/NikseTextBox.cs @@ -0,0 +1,8 @@ +using System.Windows.Forms; + +namespace Nikse.SubtitleEdit.Controls +{ + public class NikseTextBox : TextBox + { + } +} diff --git a/src/ui/Controls/SETextBox.cs b/src/ui/Controls/SETextBox.cs index cce519824..b387f340c 100644 --- a/src/ui/Controls/SETextBox.cs +++ b/src/ui/Controls/SETextBox.cs @@ -775,6 +775,24 @@ namespace Nikse.SubtitleEdit.Controls } } + public string[] Lines + { + get + { + if (_simpleTextBox != null) + { + return _simpleTextBox.Lines; + } + + if (_uiTextBox != null) + { + return _uiTextBox.Lines; + } + + return Array.Empty(); + } + } + public async Task CheckForLanguageChange(Subtitle subtitle) { if (_uiTextBox == null) diff --git a/src/ui/Forms/AddToNames.Designer.cs b/src/ui/Forms/AddToNames.Designer.cs index 1b7704308..eb4ecc6bd 100644 --- a/src/ui/Forms/AddToNames.Designer.cs +++ b/src/ui/Forms/AddToNames.Designer.cs @@ -21,7 +21,7 @@ { this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); - this.textBoxAddName = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxAddName = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelDescription = new System.Windows.Forms.Label(); this.comboBoxDictionaries = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.labelLanguage = new System.Windows.Forms.Label(); @@ -129,7 +129,7 @@ private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxAddName; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxAddName; private System.Windows.Forms.Label labelDescription; private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxDictionaries; private System.Windows.Forms.Label labelLanguage; diff --git a/src/ui/Forms/Assa/ApplyCustomStyles.Designer.cs b/src/ui/Forms/Assa/ApplyCustomStyles.Designer.cs index 2baac47d2..4c8ef8b93 100644 --- a/src/ui/Forms/Assa/ApplyCustomStyles.Designer.cs +++ b/src/ui/Forms/Assa/ApplyCustomStyles.Designer.cs @@ -1,4 +1,6 @@  +using System.Windows.Forms; + namespace Nikse.SubtitleEdit.Forms.Assa { sealed partial class ApplyCustomStyles @@ -44,7 +46,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa this.buttonHistory = new System.Windows.Forms.Button(); this.buttonTogglePreview = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.seTextBox1 = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.seTextBox1 = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.groupBoxApplyTo.SuspendLayout(); this.groupBoxPreview.SuspendLayout(); @@ -209,25 +211,18 @@ namespace Nikse.SubtitleEdit.Forms.Assa | System.Windows.Forms.AnchorStyles.Right))); this.seTextBox1.BackColor = System.Drawing.SystemColors.WindowFrame; this.seTextBox1.ContextMenuStrip = this.contextMenuStrip1; - this.seTextBox1.CurrentLanguage = ""; - this.seTextBox1.CurrentLineIndex = 0; this.seTextBox1.HideSelection = true; - this.seTextBox1.IsDictionaryDownloaded = true; - this.seTextBox1.IsSpellCheckerInitialized = false; - this.seTextBox1.IsSpellCheckRequested = false; - this.seTextBox1.IsWrongWord = false; - this.seTextBox1.LanguageChanged = false; this.seTextBox1.Location = new System.Drawing.Point(12, 40); this.seTextBox1.Multiline = true; this.seTextBox1.Name = "seTextBox1"; this.seTextBox1.Padding = new System.Windows.Forms.Padding(1); - this.seTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; + this.seTextBox1.ScrollBars = ScrollBars.None; this.seTextBox1.SelectedText = ""; this.seTextBox1.SelectionLength = 0; this.seTextBox1.SelectionStart = 0; this.seTextBox1.Size = new System.Drawing.Size(522, 156); this.seTextBox1.TabIndex = 0; - this.seTextBox1.TextBoxFont = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold); + this.seTextBox1.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold); // // contextMenuStrip1 // @@ -269,7 +264,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa #endregion - private Controls.SETextBox seTextBox1; + private Controls.NikseTextBox seTextBox1; private System.Windows.Forms.GroupBox groupBoxApplyTo; private System.Windows.Forms.GroupBox groupBoxPreview; private System.Windows.Forms.Label labelOverrideTags; diff --git a/src/ui/Forms/Assa/ApplyCustomStyles.cs b/src/ui/Forms/Assa/ApplyCustomStyles.cs index 6b3b6aa36..dbec1ba79 100644 --- a/src/ui/Forms/Assa/ApplyCustomStyles.cs +++ b/src/ui/Forms/Assa/ApplyCustomStyles.cs @@ -119,7 +119,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa } } - private ListBox DoIntellisense(SETextBox tb, ListBox intellisenseListBox) + private ListBox DoIntellisense(NikseTextBox tb, ListBox intellisenseListBox) { if (intellisenseListBox == null) { diff --git a/src/ui/Forms/Assa/AssaProperties.Designer.cs b/src/ui/Forms/Assa/AssaProperties.Designer.cs index c55fe8b8b..382e6f117 100644 --- a/src/ui/Forms/Assa/AssaProperties.Designer.cs +++ b/src/ui/Forms/Assa/AssaProperties.Designer.cs @@ -31,19 +31,19 @@ this.groupBoxScript = new System.Windows.Forms.GroupBox(); this.labelUpdateDetails = new System.Windows.Forms.Label(); this.labelUpdatedBy = new System.Windows.Forms.Label(); - this.textBoxSyncPoint = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxUpdatedBy = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxUpdateDetails = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxSyncPoint = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxUpdatedBy = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxUpdateDetails = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelSyncPoint = new System.Windows.Forms.Label(); this.labelTiming = new System.Windows.Forms.Label(); this.labelEditing = new System.Windows.Forms.Label(); this.labelTranslation = new System.Windows.Forms.Label(); - this.textBoxTranslation = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxEditing = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxTiming = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxOriginalScript = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxTranslation = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxEditing = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxTiming = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxOriginalScript = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelOriginalScript = new System.Windows.Forms.Label(); - this.textBoxTitle = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxTitle = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelTitle = new System.Windows.Forms.Label(); this.groupBoxOptions = new System.Windows.Forms.GroupBox(); this.comboBoxScaleBorderAndShadow = new Nikse.SubtitleEdit.Controls.NikseComboBox(); @@ -435,19 +435,19 @@ private System.Windows.Forms.GroupBox groupBoxOptions; private System.Windows.Forms.Label labelUpdateDetails; private System.Windows.Forms.Label labelUpdatedBy; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxSyncPoint; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxUpdatedBy; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxUpdateDetails; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxSyncPoint; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxUpdatedBy; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxUpdateDetails; private System.Windows.Forms.Label labelSyncPoint; private System.Windows.Forms.Label labelTiming; private System.Windows.Forms.Label labelEditing; private System.Windows.Forms.Label labelTranslation; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxTranslation; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxEditing; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxTiming; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxOriginalScript; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxTranslation; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxEditing; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxTiming; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxOriginalScript; private System.Windows.Forms.Label labelOriginalScript; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxTitle; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxTitle; private System.Windows.Forms.Label labelTitle; private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxWrapStyle; private System.Windows.Forms.Label labelWrapStyle; diff --git a/src/ui/Forms/Assa/AssaStyles.Designer.cs b/src/ui/Forms/Assa/AssaStyles.Designer.cs index ed48d66c5..d789e2ee4 100644 --- a/src/ui/Forms/Assa/AssaStyles.Designer.cs +++ b/src/ui/Forms/Assa/AssaStyles.Designer.cs @@ -71,7 +71,7 @@ this.numericUpDownShadowWidth = new Nikse.SubtitleEdit.Controls.NikseUpDown(); this.numericUpDownOutline = new Nikse.SubtitleEdit.Controls.NikseUpDown(); this.labelShadow = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.textBoxStyleName = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxStyleName = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelStyleName = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.groupBoxMargins = new System.Windows.Forms.GroupBox(); this.numericUpDownMarginVertical = new Nikse.SubtitleEdit.Controls.NikseUpDown(); @@ -1715,7 +1715,7 @@ private Nikse.SubtitleEdit.Controls.NikseUpDown numericUpDownFontSize; private System.Windows.Forms.CheckBox checkBoxFontItalic; private System.Windows.Forms.CheckBox checkBoxFontBold; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxStyleName; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxStyleName; private Nikse.SubtitleEdit.Controls.NikseLabel labelStyleName; private System.Windows.Forms.PictureBox pictureBoxPreview; private System.Windows.Forms.Button buttonRemoveAll; diff --git a/src/ui/Forms/Assa/TagHistory.Designer.cs b/src/ui/Forms/Assa/TagHistory.Designer.cs index 079c958db..91bc311d6 100644 --- a/src/ui/Forms/Assa/TagHistory.Designer.cs +++ b/src/ui/Forms/Assa/TagHistory.Designer.cs @@ -1,4 +1,6 @@  +using System.Windows.Forms; + namespace Nikse.SubtitleEdit.Forms.Assa { sealed partial class TagHistory @@ -29,7 +31,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa /// private void InitializeComponent() { - this.seTextBoxOverrideStyle = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.seTextBoxOverrideStyle = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.listBoxHistory = new System.Windows.Forms.ListBox(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); @@ -41,19 +43,12 @@ namespace Nikse.SubtitleEdit.Forms.Assa | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.seTextBoxOverrideStyle.BackColor = System.Drawing.SystemColors.WindowFrame; - this.seTextBoxOverrideStyle.CurrentLanguage = ""; - this.seTextBoxOverrideStyle.CurrentLineIndex = 0; this.seTextBoxOverrideStyle.HideSelection = true; - this.seTextBoxOverrideStyle.IsDictionaryDownloaded = true; - this.seTextBoxOverrideStyle.IsSpellCheckerInitialized = false; - this.seTextBoxOverrideStyle.IsSpellCheckRequested = false; - this.seTextBoxOverrideStyle.IsWrongWord = false; - this.seTextBoxOverrideStyle.LanguageChanged = false; this.seTextBoxOverrideStyle.Location = new System.Drawing.Point(12, 254); this.seTextBoxOverrideStyle.Multiline = true; this.seTextBoxOverrideStyle.Name = "seTextBoxOverrideStyle"; this.seTextBoxOverrideStyle.Padding = new System.Windows.Forms.Padding(1); - this.seTextBoxOverrideStyle.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; + this.seTextBoxOverrideStyle.ScrollBars = ScrollBars.None; this.seTextBoxOverrideStyle.SelectedText = ""; this.seTextBoxOverrideStyle.SelectionLength = 0; this.seTextBoxOverrideStyle.SelectionStart = 0; @@ -119,7 +114,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa #endregion - private Controls.SETextBox seTextBoxOverrideStyle; + private Controls.NikseTextBox seTextBoxOverrideStyle; private System.Windows.Forms.ListBox listBoxHistory; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOK; diff --git a/src/ui/Forms/BatchConvert.Designer.cs b/src/ui/Forms/BatchConvert.Designer.cs index c3c9bfba1..b1a9ea1aa 100644 --- a/src/ui/Forms/BatchConvert.Designer.cs +++ b/src/ui/Forms/BatchConvert.Designer.cs @@ -159,7 +159,7 @@ namespace Nikse.SubtitleEdit.Forms this.buttonStyles = new System.Windows.Forms.Button(); this.buttonChooseFolder = new System.Windows.Forms.Button(); this.comboBoxSubtitleFormats = new Nikse.SubtitleEdit.Controls.NikseComboBox(); - this.textBoxOutputFolder = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxOutputFolder = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelEncoding = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.radioButtonSaveInSourceFolder = new System.Windows.Forms.RadioButton(); this.comboBoxEncoding = new Nikse.SubtitleEdit.Controls.NikseComboBox(); @@ -2206,7 +2206,7 @@ namespace Nikse.SubtitleEdit.Forms private System.Windows.Forms.LinkLabel linkLabelOpenOutputFolder; private System.Windows.Forms.CheckBox checkBoxOverwrite; private System.Windows.Forms.Button buttonChooseFolder; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxOutputFolder; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxOutputFolder; private System.Windows.Forms.RadioButton radioButtonSaveInSourceFolder; private System.Windows.Forms.ListView listViewConvertOptions; private System.Windows.Forms.ColumnHeader ActionCheckBox; diff --git a/src/ui/Forms/ChangeCasingNames.Designer.cs b/src/ui/Forms/ChangeCasingNames.Designer.cs index f0fed8af3..dc9a15c8b 100644 --- a/src/ui/Forms/ChangeCasingNames.Designer.cs +++ b/src/ui/Forms/ChangeCasingNames.Designer.cs @@ -33,7 +33,7 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.groupBoxNames = new System.Windows.Forms.GroupBox(); this.buttonAddCustomNames = new System.Windows.Forms.Button(); - this.textBoxExtraNames = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxExtraNames = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelExtraNames = new System.Windows.Forms.Label(); this.buttonInverseSelection = new System.Windows.Forms.Button(); this.buttonSelectAll = new System.Windows.Forms.Button(); @@ -341,7 +341,7 @@ private System.Windows.Forms.Button buttonInverseSelection; private System.Windows.Forms.Button buttonSelectAll; private System.Windows.Forms.Button buttonAddCustomNames; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxExtraNames; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxExtraNames; private System.Windows.Forms.Label labelExtraNames; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSelectAll; diff --git a/src/ui/Forms/CheckForUpdates.Designer.cs b/src/ui/Forms/CheckForUpdates.Designer.cs index 90fe13459..37d98ea25 100644 --- a/src/ui/Forms/CheckForUpdates.Designer.cs +++ b/src/ui/Forms/CheckForUpdates.Designer.cs @@ -32,7 +32,7 @@ namespace Nikse.SubtitleEdit.Forms { this.components = new System.ComponentModel.Container(); this.labelStatus = new System.Windows.Forms.Label(); - this.textBoxChangeLog = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxChangeLog = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonDownloadAndInstall = new System.Windows.Forms.Button(); this.timerCheckForUpdates = new System.Windows.Forms.Timer(this.components); @@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Forms this.textBoxChangeLog.Multiline = true; this.textBoxChangeLog.Name = "textBoxChangeLog"; this.textBoxChangeLog.ReadOnly = true; - this.textBoxChangeLog.ScrollBars = RichTextBoxScrollBars.Both; + this.textBoxChangeLog.ScrollBars = ScrollBars.Both; this.textBoxChangeLog.Size = new System.Drawing.Size(618, 53); this.textBoxChangeLog.TabIndex = 4; // @@ -128,7 +128,7 @@ namespace Nikse.SubtitleEdit.Forms #endregion private System.Windows.Forms.Label labelStatus; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxChangeLog; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxChangeLog; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonDownloadAndInstall; private System.Windows.Forms.Timer timerCheckForUpdates; diff --git a/src/ui/Forms/FixCommonErrors.Designer.cs b/src/ui/Forms/FixCommonErrors.Designer.cs index 60e4d4e4f..d883ed4fe 100644 --- a/src/ui/Forms/FixCommonErrors.Designer.cs +++ b/src/ui/Forms/FixCommonErrors.Designer.cs @@ -1,4 +1,5 @@ -using Nikse.SubtitleEdit.Controls; +using System.Windows.Forms; +using Nikse.SubtitleEdit.Controls; using Nikse.SubtitleEdit.Core.Common; namespace Nikse.SubtitleEdit.Forms @@ -89,7 +90,7 @@ namespace Nikse.SubtitleEdit.Forms this.labelStartTime = new System.Windows.Forms.Label(); this.labelTextLineTotal = new System.Windows.Forms.Label(); this.labelTextLineLengths = new System.Windows.Forms.Label(); - this.textBoxListViewText = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxListViewText = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.tabPageLog = new System.Windows.Forms.TabPage(); this.textBoxFixedIssues = new System.Windows.Forms.TextBox(); this.labelNumberOfImportantLogMessages = new System.Windows.Forms.Label(); @@ -771,26 +772,19 @@ namespace Nikse.SubtitleEdit.Forms this.textBoxListViewText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBoxListViewText.BackColor = System.Drawing.SystemColors.WindowFrame; - this.textBoxListViewText.CurrentLanguage = ""; - this.textBoxListViewText.CurrentLineIndex = 0; this.textBoxListViewText.HideSelection = false; - this.textBoxListViewText.IsDictionaryDownloaded = true; - this.textBoxListViewText.IsSpellCheckerInitialized = false; - this.textBoxListViewText.IsSpellCheckRequested = false; - this.textBoxListViewText.IsWrongWord = false; - this.textBoxListViewText.LanguageChanged = false; this.textBoxListViewText.Location = new System.Drawing.Point(194, 12); this.textBoxListViewText.MaxLength = 32767; this.textBoxListViewText.Multiline = true; this.textBoxListViewText.Name = "textBoxListViewText"; this.textBoxListViewText.Padding = new System.Windows.Forms.Padding(1); - this.textBoxListViewText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; + this.textBoxListViewText.ScrollBars = ScrollBars.None; this.textBoxListViewText.SelectedText = ""; this.textBoxListViewText.SelectionLength = 0; this.textBoxListViewText.SelectionStart = 0; this.textBoxListViewText.Size = new System.Drawing.Size(427, 64); this.textBoxListViewText.TabIndex = 118; - this.textBoxListViewText.TextBoxFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxListViewText.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxListViewText.UseSystemPasswordChar = false; this.textBoxListViewText.TextChanged += new System.EventHandler(this.TextBoxListViewTextTextChanged); this.textBoxListViewText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextKeyDown); @@ -905,7 +899,7 @@ namespace Nikse.SubtitleEdit.Forms private SubtitleListView subtitleListView1; private System.Windows.Forms.Label labelTextLineTotal; private System.Windows.Forms.Label labelTextLineLengths; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxListViewText; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxListViewText; private System.Windows.Forms.Button buttonFixesApply; private System.Windows.Forms.Button buttonFixesInverse; private System.Windows.Forms.Button buttonFixesSelectAll; diff --git a/src/ui/Forms/GoToLine.Designer.cs b/src/ui/Forms/GoToLine.Designer.cs index bf84f75c3..06aef8c95 100644 --- a/src/ui/Forms/GoToLine.Designer.cs +++ b/src/ui/Forms/GoToLine.Designer.cs @@ -31,7 +31,7 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GoToLine)); this.labelGoToLine = new System.Windows.Forms.Label(); this.buttonOK = new System.Windows.Forms.Button(); - this.textBox1 = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBox1 = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); // @@ -85,7 +85,7 @@ private System.Windows.Forms.Label labelGoToLine; private System.Windows.Forms.Button buttonOK; - private Nikse.SubtitleEdit.Controls.SETextBox textBox1; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBox1; private System.Windows.Forms.Button buttonCancel; } } \ No newline at end of file diff --git a/src/ui/Forms/ImportText.Designer.cs b/src/ui/Forms/ImportText.Designer.cs index 9ed7333a0..864a59264 100644 --- a/src/ui/Forms/ImportText.Designer.cs +++ b/src/ui/Forms/ImportText.Designer.cs @@ -32,7 +32,7 @@ this.buttonOpenText = new System.Windows.Forms.Button(); this.groupBoxImportText = new System.Windows.Forms.GroupBox(); this.checkBoxMultipleFiles = new System.Windows.Forms.CheckBox(); - this.textBoxText = new System.Windows.Forms.TextBox(); + this.textBoxText = new Controls.NikseTextBox(); this.listViewInputFiles = new System.Windows.Forms.ListView(); this.columnHeaderFName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -789,7 +789,7 @@ private System.Windows.Forms.Button buttonOpenText; private Controls.SubtitleListView SubtitleListview1; private System.Windows.Forms.GroupBox groupBoxImportText; - private System.Windows.Forms.TextBox textBoxText; + private Controls.NikseTextBox textBoxText; private System.Windows.Forms.GroupBox groupBoxImportOptions; private System.Windows.Forms.GroupBox groupBoxImportResult; private System.Windows.Forms.OpenFileDialog openFileDialog1; diff --git a/src/ui/Forms/ModifySelection.Designer.cs b/src/ui/Forms/ModifySelection.Designer.cs index f09176cfd..3bee20ef8 100644 --- a/src/ui/Forms/ModifySelection.Designer.cs +++ b/src/ui/Forms/ModifySelection.Designer.cs @@ -38,7 +38,7 @@ this.numericUpDownDuration = new Nikse.SubtitleEdit.Controls.NikseUpDown(); this.checkBoxCaseSensitive = new System.Windows.Forms.CheckBox(); this.comboBoxRule = new Nikse.SubtitleEdit.Controls.NikseComboBox(); - this.textBoxText = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxText = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.listViewStyles = new System.Windows.Forms.ListView(); this.columnHeaderStyleName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.buttonCancel = new System.Windows.Forms.Button(); @@ -365,7 +365,7 @@ private System.Windows.Forms.RadioButton radioButtonAddToSelection; private System.Windows.Forms.RadioButton radioButtonNewSelection; private System.Windows.Forms.GroupBox groupBoxRule; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxText; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxText; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonApply; diff --git a/src/ui/Forms/MultipleReplace.Designer.cs b/src/ui/Forms/MultipleReplace.Designer.cs index 5f15a4863..7ce317670 100644 --- a/src/ui/Forms/MultipleReplace.Designer.cs +++ b/src/ui/Forms/MultipleReplace.Designer.cs @@ -41,11 +41,11 @@ this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.groupBoxReplaces = new System.Windows.Forms.GroupBox(); this.labelDescription = new System.Windows.Forms.Label(); - this.textBoxDescription = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxDescription = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.radioButtonRegEx = new System.Windows.Forms.RadioButton(); this.radioButtonCaseSensitive = new System.Windows.Forms.RadioButton(); - this.textBoxFind = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxReplace = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxFind = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxReplace = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonUpdate = new System.Windows.Forms.Button(); this.buttonAdd = new System.Windows.Forms.Button(); this.labelFindWhat = new System.Windows.Forms.Label(); @@ -825,11 +825,11 @@ private System.Windows.Forms.ColumnHeader columnHeader6; private System.Windows.Forms.Label labelFindWhat; private System.Windows.Forms.Label labelReplaceWith; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxReplace; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxReplace; private System.Windows.Forms.RadioButton radioButtonRegEx; private System.Windows.Forms.RadioButton radioButtonCaseSensitive; private System.Windows.Forms.RadioButton radioButtonNormal; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxFind; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxFind; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonAdd; @@ -867,7 +867,7 @@ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemMoveRulesToGroup; private System.Windows.Forms.Button buttonApply; private System.Windows.Forms.Label labelDescription; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxDescription; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxDescription; private System.Windows.Forms.ColumnHeader columnHeader9; private System.Windows.Forms.ToolStripSeparator toolStripSeparatorGroupImportExport; private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem; diff --git a/src/ui/Forms/Networking/NetworkJoin.Designer.cs b/src/ui/Forms/Networking/NetworkJoin.Designer.cs index 69fb8a373..25081e15c 100644 --- a/src/ui/Forms/Networking/NetworkJoin.Designer.cs +++ b/src/ui/Forms/Networking/NetworkJoin.Designer.cs @@ -33,10 +33,10 @@ this.labelWebServiceUrl = new System.Windows.Forms.Label(); this.comboBoxWebServiceUrl = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.buttonCancel = new System.Windows.Forms.Button(); - this.textBoxUserName = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxUserName = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonJoin = new System.Windows.Forms.Button(); this.labelUserName = new System.Windows.Forms.Label(); - this.textBoxSessionKey = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxSessionKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelSessionKey = new System.Windows.Forms.Label(); this.SuspendLayout(); // @@ -171,10 +171,10 @@ private System.Windows.Forms.Label labelWebServiceUrl; private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxWebServiceUrl; private System.Windows.Forms.Button buttonCancel; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxUserName; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxUserName; private System.Windows.Forms.Button buttonJoin; private System.Windows.Forms.Label labelUserName; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxSessionKey; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxSessionKey; private System.Windows.Forms.Label labelSessionKey; } } \ No newline at end of file diff --git a/src/ui/Forms/Networking/NetworkStart.Designer.cs b/src/ui/Forms/Networking/NetworkStart.Designer.cs index 6ec083fd7..dbdb4fa0d 100644 --- a/src/ui/Forms/Networking/NetworkStart.Designer.cs +++ b/src/ui/Forms/Networking/NetworkStart.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.buttonCancel = new System.Windows.Forms.Button(); - this.textBoxUserName = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxUserName = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonStart = new System.Windows.Forms.Button(); this.labelUserName = new System.Windows.Forms.Label(); this.comboBoxWebServiceUrl = new Nikse.SubtitleEdit.Controls.NikseComboBox(); @@ -37,7 +37,7 @@ this.labelInfo = new System.Windows.Forms.Label(); this.labelStatus = new System.Windows.Forms.Label(); this.labelSessionKey = new System.Windows.Forms.Label(); - this.textBoxSessionKey = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxSessionKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonGenerateNewKey = new System.Windows.Forms.Button(); this.SuspendLayout(); // @@ -184,7 +184,7 @@ #endregion private System.Windows.Forms.Button buttonCancel; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxUserName; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxUserName; private System.Windows.Forms.Button buttonStart; private System.Windows.Forms.Label labelUserName; private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxWebServiceUrl; @@ -192,7 +192,7 @@ private System.Windows.Forms.Label labelInfo; private System.Windows.Forms.Label labelStatus; private System.Windows.Forms.Label labelSessionKey; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxSessionKey; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxSessionKey; private System.Windows.Forms.Button buttonGenerateNewKey; } } \ No newline at end of file diff --git a/src/ui/Forms/Options/WordLists.Designer.cs b/src/ui/Forms/Options/WordLists.Designer.cs index 187db5fa3..2b1157d68 100644 --- a/src/ui/Forms/Options/WordLists.Designer.cs +++ b/src/ui/Forms/Options/WordLists.Designer.cs @@ -31,24 +31,24 @@ this.groupBoxWordLists = new System.Windows.Forms.GroupBox(); this.linkLabelOpenDictionaryFolder = new System.Windows.Forms.LinkLabel(); this.groupBoxOcrFixList = new System.Windows.Forms.GroupBox(); - this.textBoxOcrFixValue = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxOcrFixValue = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonRemoveOcrFix = new System.Windows.Forms.Button(); this.listBoxOcrFixList = new Nikse.SubtitleEdit.Controls.NikseListBox(); - this.textBoxOcrFixKey = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxOcrFixKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonAddOcrFix = new System.Windows.Forms.Button(); this.groupBoxUserWordList = new System.Windows.Forms.GroupBox(); this.buttonRemoveUserWord = new System.Windows.Forms.Button(); this.listBoxUserWordLists = new Nikse.SubtitleEdit.Controls.NikseListBox(); - this.textBoxUserWord = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxUserWord = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonAddUserWord = new System.Windows.Forms.Button(); this.groupBoxWordListLocation = new System.Windows.Forms.GroupBox(); this.checkBoxNamesOnline = new System.Windows.Forms.CheckBox(); - this.textBoxNamesOnline = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxNamesOnline = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.groupBoxNamesIgonoreLists = new System.Windows.Forms.GroupBox(); this.listViewNames = new System.Windows.Forms.ListView(); this.columnHeaderNames = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.buttonRemoveNameEtc = new System.Windows.Forms.Button(); - this.textBoxNameEtc = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxNameEtc = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonAddNames = new System.Windows.Forms.Button(); this.labelWordListLanguage = new System.Windows.Forms.Label(); this.comboBoxWordListLanguage = new Nikse.SubtitleEdit.Controls.NikseComboBox(); @@ -418,24 +418,24 @@ private System.Windows.Forms.GroupBox groupBoxWordLists; private System.Windows.Forms.LinkLabel linkLabelOpenDictionaryFolder; private System.Windows.Forms.GroupBox groupBoxOcrFixList; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxOcrFixValue; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxOcrFixValue; private System.Windows.Forms.Button buttonRemoveOcrFix; private Nikse.SubtitleEdit.Controls.NikseListBox listBoxOcrFixList; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxOcrFixKey; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxOcrFixKey; private System.Windows.Forms.Button buttonAddOcrFix; private System.Windows.Forms.GroupBox groupBoxUserWordList; private System.Windows.Forms.Button buttonRemoveUserWord; private Nikse.SubtitleEdit.Controls.NikseListBox listBoxUserWordLists; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxUserWord; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxUserWord; private System.Windows.Forms.Button buttonAddUserWord; private System.Windows.Forms.GroupBox groupBoxWordListLocation; private System.Windows.Forms.CheckBox checkBoxNamesOnline; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxNamesOnline; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxNamesOnline; private System.Windows.Forms.GroupBox groupBoxNamesIgonoreLists; private System.Windows.Forms.ListView listViewNames; private System.Windows.Forms.ColumnHeader columnHeaderNames; private System.Windows.Forms.Button buttonRemoveNameEtc; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxNameEtc; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxNameEtc; private System.Windows.Forms.Button buttonAddNames; private System.Windows.Forms.Label labelWordListLanguage; private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxWordListLanguage; diff --git a/src/ui/Forms/SpellCheck.Designer.cs b/src/ui/Forms/SpellCheck.Designer.cs index 073f6380e..0e1475e98 100644 --- a/src/ui/Forms/SpellCheck.Designer.cs +++ b/src/ui/Forms/SpellCheck.Designer.cs @@ -32,7 +32,7 @@ this.useLargerFontForThisWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.listBoxSuggestions = new Nikse.SubtitleEdit.Controls.NikseListBox(); this.labelFullText = new System.Windows.Forms.Label(); - this.textBoxWord = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxWord = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonAbort = new System.Windows.Forms.Button(); this.buttonSkipAll = new System.Windows.Forms.Button(); this.buttonChange = new System.Windows.Forms.Button(); @@ -49,7 +49,7 @@ this.groupBoxEditWholeText = new System.Windows.Forms.GroupBox(); this.buttonSkipText = new System.Windows.Forms.Button(); this.buttonChangeWholeText = new System.Windows.Forms.Button(); - this.textBoxWholeText = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxWholeText = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelActionInfo = new System.Windows.Forms.Label(); this.buttonSpellCheckDownload = new System.Windows.Forms.Button(); this.pictureBoxBdSup = new System.Windows.Forms.PictureBox(); @@ -558,7 +558,7 @@ private System.Windows.Forms.RichTextBox richTextBoxParagraph; private Nikse.SubtitleEdit.Controls.NikseListBox listBoxSuggestions; private System.Windows.Forms.Label labelFullText; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxWord; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxWord; private System.Windows.Forms.Button buttonAbort; private System.Windows.Forms.Button buttonSkipAll; private System.Windows.Forms.Button buttonChange; @@ -572,7 +572,7 @@ private System.Windows.Forms.GroupBox groupBoxEditWholeText; private System.Windows.Forms.Button buttonSkipText; private System.Windows.Forms.Button buttonChangeWholeText; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxWholeText; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxWholeText; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem addXToNamesnoiseListToolStripMenuItem; private System.Windows.Forms.CheckBox checkBoxAutoChangeNames; diff --git a/src/ui/Forms/StartNumberingFrom.Designer.cs b/src/ui/Forms/StartNumberingFrom.Designer.cs index bc88a745f..ed75aa632 100644 --- a/src/ui/Forms/StartNumberingFrom.Designer.cs +++ b/src/ui/Forms/StartNumberingFrom.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBox1 = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.SuspendLayout(); @@ -99,7 +99,7 @@ #endregion private System.Windows.Forms.Label label1; - private Nikse.SubtitleEdit.Controls.SETextBox textBox1; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBox1; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOK; } diff --git a/src/ui/Forms/Statistics.Designer.cs b/src/ui/Forms/Statistics.Designer.cs index 6405cf964..9375d233d 100644 --- a/src/ui/Forms/Statistics.Designer.cs +++ b/src/ui/Forms/Statistics.Designer.cs @@ -32,12 +32,12 @@ namespace Nikse.SubtitleEdit.Forms { this.buttonOK = new System.Windows.Forms.Button(); this.groupBoxGeneral = new System.Windows.Forms.GroupBox(); - this.textBoxGeneral = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxGeneral = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.groupBoxMostUsed = new System.Windows.Forms.GroupBox(); this.labelMostUsedLines = new System.Windows.Forms.Label(); this.labelMostUsedWords = new System.Windows.Forms.Label(); - this.textBoxMostUsedLines = new Nikse.SubtitleEdit.Controls.SETextBox(true); - this.textBoxMostUsedWords = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxMostUsedLines = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.textBoxMostUsedWords = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonExport = new System.Windows.Forms.Button(); this.groupBoxGeneral.SuspendLayout(); this.groupBoxMostUsed.SuspendLayout(); @@ -76,7 +76,7 @@ namespace Nikse.SubtitleEdit.Forms this.textBoxGeneral.Multiline = true; this.textBoxGeneral.Name = "textBoxGeneral"; this.textBoxGeneral.ReadOnly = true; - this.textBoxGeneral.ScrollBars = RichTextBoxScrollBars.Both; + this.textBoxGeneral.ScrollBars = ScrollBars.Both; this.textBoxGeneral.Size = new System.Drawing.Size(694, 351); this.textBoxGeneral.TabIndex = 0; // @@ -123,7 +123,7 @@ namespace Nikse.SubtitleEdit.Forms this.textBoxMostUsedLines.Multiline = true; this.textBoxMostUsedLines.Name = "textBoxMostUsedLines"; this.textBoxMostUsedLines.ReadOnly = true; - this.textBoxMostUsedLines.ScrollBars = RichTextBoxScrollBars.Both; + this.textBoxMostUsedLines.ScrollBars = ScrollBars.Both; this.textBoxMostUsedLines.Size = new System.Drawing.Size(371, 183); this.textBoxMostUsedLines.TabIndex = 3; // @@ -135,7 +135,7 @@ namespace Nikse.SubtitleEdit.Forms this.textBoxMostUsedWords.Multiline = true; this.textBoxMostUsedWords.Name = "textBoxMostUsedWords"; this.textBoxMostUsedWords.ReadOnly = true; - this.textBoxMostUsedWords.ScrollBars = RichTextBoxScrollBars.Both; + this.textBoxMostUsedWords.ScrollBars = ScrollBars.Both; this.textBoxMostUsedWords.Size = new System.Drawing.Size(320, 183); this.textBoxMostUsedWords.TabIndex = 1; // @@ -181,10 +181,10 @@ namespace Nikse.SubtitleEdit.Forms private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.GroupBox groupBoxGeneral; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxGeneral; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxGeneral; private System.Windows.Forms.GroupBox groupBoxMostUsed; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxMostUsedWords; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxMostUsedLines; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxMostUsedWords; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxMostUsedLines; private System.Windows.Forms.Label labelMostUsedLines; private System.Windows.Forms.Label labelMostUsedWords; private System.Windows.Forms.Button buttonExport; diff --git a/src/ui/Forms/TextPrompt.Designer.cs b/src/ui/Forms/TextPrompt.Designer.cs index 4a9597a80..ce769d098 100644 --- a/src/ui/Forms/TextPrompt.Designer.cs +++ b/src/ui/Forms/TextPrompt.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.buttonCancel = new System.Windows.Forms.Button(); - this.textBox1 = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBox1 = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonOK = new System.Windows.Forms.Button(); this.labelDescription = new System.Windows.Forms.Label(); this.SuspendLayout(); @@ -104,7 +104,7 @@ #endregion private System.Windows.Forms.Button buttonCancel; - private Nikse.SubtitleEdit.Controls.SETextBox textBox1; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBox1; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Label labelDescription; } diff --git a/src/ui/Forms/Translate/TranslateViaCopyPaste.Designer.cs b/src/ui/Forms/Translate/TranslateViaCopyPaste.Designer.cs index 046124f33..818af0c22 100644 --- a/src/ui/Forms/Translate/TranslateViaCopyPaste.Designer.cs +++ b/src/ui/Forms/Translate/TranslateViaCopyPaste.Designer.cs @@ -31,7 +31,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate /// private void InitializeComponent() { - this.textBoxLineSeparator = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxLineSeparator = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.labelLineSeparator = new System.Windows.Forms.Label(); this.checkBoxAutoCopyToClipboard = new System.Windows.Forms.CheckBox(); this.numericUpDownMaxBytes = new Nikse.SubtitleEdit.Controls.NikseUpDown(); @@ -40,7 +40,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate this.buttonTranslate = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOk = new System.Windows.Forms.Button(); - this.textBoxLog = new Nikse.SubtitleEdit.Controls.SETextBox(true); + this.textBoxLog = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.columnHeaderTarget = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderSource = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderNumber = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -163,7 +163,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate this.textBoxLog.Location = new System.Drawing.Point(12, 43); this.textBoxLog.Multiline = true; this.textBoxLog.Name = "textBoxLog"; - this.textBoxLog.ScrollBars = RichTextBoxScrollBars.Both; + this.textBoxLog.ScrollBars = ScrollBars.Both; this.textBoxLog.Size = new System.Drawing.Size(900, 441); this.textBoxLog.TabIndex = 20; // @@ -235,7 +235,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate #endregion - private Nikse.SubtitleEdit.Controls.SETextBox textBoxLineSeparator; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxLineSeparator; private System.Windows.Forms.Label labelLineSeparator; private System.Windows.Forms.CheckBox checkBoxAutoCopyToClipboard; private Nikse.SubtitleEdit.Controls.NikseUpDown numericUpDownMaxBytes; @@ -244,7 +244,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate private System.Windows.Forms.Button buttonTranslate; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOk; - private Nikse.SubtitleEdit.Controls.SETextBox textBoxLog; + private Nikse.SubtitleEdit.Controls.NikseTextBox textBoxLog; private System.Windows.Forms.ColumnHeader columnHeaderTarget; private System.Windows.Forms.ColumnHeader columnHeaderSource; private System.Windows.Forms.ColumnHeader columnHeaderNumber; diff --git a/src/ui/Logic/AssaTagHelper.cs b/src/ui/Logic/AssaTagHelper.cs index 0960d8f5e..4cec3032b 100644 --- a/src/ui/Logic/AssaTagHelper.cs +++ b/src/ui/Logic/AssaTagHelper.cs @@ -148,6 +148,57 @@ namespace Nikse.SubtitleEdit.Logic LastAddedTags.Add(tag); } + public static void CompleteItem(NikseTextBox tb, IntellisenseItem item) + { + if (item == IntellisenseItem.IntellisenseItemEdit) + { + using (var form = new AssaTagTemplate()) + { + form.ShowDialog(); + } + + return; + } + + + tb.SuspendLayout(); + + // remove old tag if any + if (!string.IsNullOrEmpty(item.ActiveTagAtCursor) && tb.SelectionLength == 0) + { + RemoveTagAtCursor(tb); + item.TypedWord = string.Empty; + } + + // insert new tag + var oldStart = tb.SelectionStart; + if (item.TypedWord.Length > 0) + { + tb.SelectedText = item.Value.Remove(0, item.TypedWord.Length); + } + else + { + if (tb.SelectionStart > 0 && tb.Text[tb.SelectionStart - 1] == '}' && item.Value.StartsWith('\\')) + { + tb.SelectedText = "{" + item.Value; + } + else + { + tb.SelectedText = item.Value; + } + } + var newStart = oldStart + item.Value.Length; + + // merge tags before/after + var subtract = MergeTagAtCursor(tb, oldStart, true); + subtract += MergeTagAtCursor(tb, newStart, false); + tb.SelectionStart = newStart - subtract - item.TypedWord.Length; + + tb.ResumeLayout(); + + AddUsedTag(item.Value); + } + public static void CompleteItem(SETextBox tb, IntellisenseItem item) { if (item == IntellisenseItem.IntellisenseItemEdit) @@ -199,6 +250,86 @@ namespace Nikse.SubtitleEdit.Logic AddUsedTag(item.Value); } + public static void RemoveTagAtCursor(NikseTextBox tb) + { + if (tb.SelectionStart == 0 || tb.SelectedText.Length > 0) + { + return; + } + + var before = tb.Text.Substring(0, tb.SelectionStart); + var after = tb.Text.Remove(0, tb.SelectionStart); + + // no tag? + var lastIndexOfEndBracket = before.LastIndexOf('}'); + var lastIndexOfBackslash = before.LastIndexOf('\\'); + if (lastIndexOfEndBracket > lastIndexOfBackslash || + lastIndexOfBackslash == -1 && lastIndexOfEndBracket == -1 && !before.EndsWith('{') && after.StartsWith('\\')) + { + return; + } + + + var start = lastIndexOfBackslash; + var extra = 0; + if (start == -1) // cursor right after "{" + { + if (tb.Text.Length > 2) + { + var nextEndTagIndex = tb.Text.IndexOfAny(new[] { '\\', '}' }, 2); + if (nextEndTagIndex <= 0 || tb.Text[nextEndTagIndex] != '\\') + { + start = 0; + extra = 1; + } + else + { + start = 1; + } + } + else + { + start = 0; + extra = 1; + } + } + else if (start > 0 && tb.Text[start - 1] == '{') + { + var nextEndTagIndex = tb.Text.IndexOfAny(new[] { '\\', '}' }, start + 1); + if (nextEndTagIndex <= 0 || tb.Text[nextEndTagIndex] != '\\') + { + start--; + extra = 1; + } + } + + var startLetter = tb.Text[start]; + if (start + 1 > tb.Text.Length) + { + return; + } + + var endTagIndex = tb.Text.IndexOfAny(new[] { '\\', '}' }, start + 1 + extra); + if (endTagIndex > 0) + { + if (startLetter == '\\') + { + tb.Text = tb.Text.Remove(start, endTagIndex - start); + } + else + { + tb.Text = tb.Text.Remove(start, endTagIndex - start + 1); + } + + if (tb.Text.Length > start && tb.Text[start] == '}') + { + start++; + } + + tb.SelectionStart = start; // position cursor + } + } + public static void RemoveTagAtCursor(SETextBox tb) { if (tb.SelectionStart == 0 || tb.SelectedText.Length > 0) @@ -279,6 +410,34 @@ namespace Nikse.SubtitleEdit.Logic } } + public static int MergeTagAtCursor(NikseTextBox tb, int cursorPosition, bool before) + { + if (cursorPosition >= tb.Text.Length) + { + return 0; + } + + if (cursorPosition > 0 && tb.Text[cursorPosition - 1] == '}' && tb.Text[cursorPosition] == '{') + { + tb.Text = tb.Text.Remove(cursorPosition - 1, 2); + return before ? 2 : 0; + } + + if (cursorPosition > 0 && tb.Text[cursorPosition - 1] == '\\' && tb.Text[cursorPosition] == '{') + { + tb.Text = tb.Text.Remove(cursorPosition - 1, 2); + return 2; + } + + if (cursorPosition > 1 && tb.Text[cursorPosition - 2] == '}' && tb.Text[cursorPosition - 1] == '{') + { + tb.Text = tb.Text.Remove(cursorPosition - 2, 2); + return 2; + } + + return 0; + } + public static int MergeTagAtCursor(SETextBox tb, int cursorPosition, bool before) { if (cursorPosition >= tb.Text.Length) @@ -307,6 +466,90 @@ namespace Nikse.SubtitleEdit.Logic return 0; } + public static bool AutoCompleteTextBox(NikseTextBox textBox, ListBox listBox) + { + var textBeforeCursor = string.IsNullOrEmpty(textBox.Text) ? string.Empty : textBox.Text.Substring(0, textBox.SelectionStart); + var activeTagAtCursor = GetInsideTag(textBox, textBeforeCursor); + var activeTagToCursor = GetLastString(textBeforeCursor) ?? string.Empty; + + var keywords = Configuration.Settings.Tools.AssaTagTemplates.Select(p => new IntellisenseItem(p.Tag, p.Hint, false)).ToList(); + keywords.AddRange(Keywords); + keywords = (activeTagToCursor.StartsWith('\\') ? keywords.Select(p => new IntellisenseItem(p.Value.TrimStart('{'), p.Hint, p.AllowInTransformations, p.HelpLink)) : keywords.Select(p => p)).ToList(); + + if (textBeforeCursor.EndsWith("\\t(", StringComparison.Ordinal)) + { + // use smaller list inside transformation + keywords = Keywords.Where(p => p.AllowInTransformations).Select(p => new IntellisenseItem(p.Value.TrimStart('{'), p.Hint, p.AllowInTransformations, p.HelpLink)).ToList(); + activeTagToCursor = string.Empty; + } + + var filteredList = keywords + .Where(n => string.IsNullOrEmpty(activeTagToCursor) || n.Value.StartsWith(GetLastString(activeTagToCursor), StringComparison.OrdinalIgnoreCase)) + .ToList(); + + if (filteredList.Count == 0 && activeTagToCursor.EndsWith("\\")) + { + // continuing ass tag, remove "{\" + "}" + activeTagToCursor = string.Empty; + filteredList = keywords + .Select(p => new IntellisenseItem(p.Value.Replace("{\\", string.Empty).RemoveChar('}'), p.Hint, p.AllowInTransformations, p.HelpLink)) + .ToList(); + } + + listBox.Items.Clear(); + + foreach (var item in filteredList) + { + item.TypedWord = activeTagToCursor; + item.ActiveTagAtCursor = activeTagAtCursor; + item.Font = listBox.Font; + listBox.Items.Add(item); + } + + if (listBox.Items.Count == 0) + { + return false; + } + + listBox.SelectedIndex = 0; + var endTag = GetEndTagFromLastTagInText(textBeforeCursor); + if (!string.IsNullOrEmpty(endTag)) + { + var item = filteredList.Find(p => p.Value == endTag); + if (item != null) + { + listBox.SelectedIndex = filteredList.IndexOf(item); + } + } + else if (IsLastTwoTagsEqual()) + { + var item = filteredList.Find(p => p.Value == LastAddedTags.Last()); + if (item != null) + { + listBox.SelectedIndex = filteredList.IndexOf(item); + } + } + + IntellisenseItem.IntellisenseItemEdit.Font = textBox.Font; + listBox.Items.Add(IntellisenseItem.IntellisenseItemEdit); + + if (Configuration.Settings.General.UseDarkTheme) + { + DarkTheme.SetDarkTheme(listBox); + } + + listBox.Width = 500; + listBox.Height = 200; + var height = listBox.Items.Count * listBox.ItemHeight + listBox.Items.Count + listBox.ItemHeight; + if (height < listBox.Height) + { + listBox.Height = height; + } + + listBox.Visible = true; + return true; + } + public static bool AutoCompleteTextBox(SETextBox textBox, ListBox listBox) { var textBeforeCursor = string.IsNullOrEmpty(textBox.Text) ? string.Empty : textBox.Text.Substring(0, textBox.SelectionStart); @@ -371,7 +614,7 @@ namespace Nikse.SubtitleEdit.Logic } } - IntellisenseItem.IntellisenseItemEdit.Font = textBox.TextBoxFont; + IntellisenseItem.IntellisenseItemEdit.Font = textBox.Font; listBox.Items.Add(IntellisenseItem.IntellisenseItemEdit); if (Configuration.Settings.General.UseDarkTheme) @@ -391,6 +634,32 @@ namespace Nikse.SubtitleEdit.Logic return true; } + + private static string GetInsideTag(NikseTextBox textBox, string before) + { + var lastIndexOfStartBracket = before.LastIndexOf("{", StringComparison.Ordinal); + var lastStart = Math.Max(before.LastIndexOf("\\", StringComparison.Ordinal), lastIndexOfStartBracket); + if (lastStart < 0) + { + return string.Empty; + } + + var extra = lastIndexOfStartBracket == lastStart ? 1 : 0; + if (textBox.SelectionStart + extra > textBox.Text.Length) + { + return string.Empty; + } + + var endTagIndex = textBox.Text.IndexOfAny(new[] { '\\', '}' }, textBox.SelectionStart + extra); + if (endTagIndex > 0) + { + var s = textBox.Text.Substring(lastStart, endTagIndex - lastStart + extra); + return s; + } + + return string.Empty; + } + private static string GetInsideTag(SETextBox textBox, string before) { var lastIndexOfStartBracket = before.LastIndexOf("{", StringComparison.Ordinal); diff --git a/src/ui/Logic/DarkTheme.cs b/src/ui/Logic/DarkTheme.cs index 773e76572..c479f85d3 100644 --- a/src/ui/Logic/DarkTheme.cs +++ b/src/ui/Logic/DarkTheme.cs @@ -284,6 +284,11 @@ namespace Nikse.SubtitleEdit.Logic return; } + if (c is NikseTextBox ntb) + { + ntb.BorderStyle = BorderStyle.Fixed3D; + } + if (c is NikseListBox nikseListBox) { nikseListBox.UndoDarkTheme(); @@ -468,6 +473,11 @@ namespace Nikse.SubtitleEdit.Logic return; } + if (c is NikseTextBox ntb) + { + ntb.BorderStyle = BorderStyle.FixedSingle; + } + if (c is NikseListBox nikseListBox) { nikseListBox.SetDarkTheme(); diff --git a/src/ui/SubtitleEdit.csproj b/src/ui/SubtitleEdit.csproj index bd5436af4..e0a809f2b 100644 --- a/src/ui/SubtitleEdit.csproj +++ b/src/ui/SubtitleEdit.csproj @@ -125,6 +125,9 @@ Component + + Component + Component