From 57fe6fd6957d0aa78967e3badf94e4392e4ffaf0 Mon Sep 17 00:00:00 2001 From: victor Date: Sat, 28 Sep 2024 23:05:49 -0700 Subject: [PATCH 1/2] replace usages of TextInputWindow --- .../CustomizableTextInputWindow.xaml.cs | 8 +- .../Glue/Controls/TextInputWindow.Designer.cs | 157 ------------------ FRBDK/Glue/Glue/Controls/TextInputWindow.cs | 107 ------------ FRBDK/Glue/Glue/Controls/TextInputWindow.resx | 120 ------------- .../Glue/CreatedClass/CustomClassWindow.cs | 10 +- .../Glue/Glue/FormHelpers/RightClickHelper.cs | 23 ++- .../MainAddToShapeCollectionPlugin.cs | 9 +- .../CameraPlugin/CameraSettingsWindow.cs | 9 +- .../MenuStripPlugin/MainMenuStripPlugin.cs | 23 ++- .../CommandInterfaces/DialogCommands.cs | 23 ++- .../Views/LevelScreenView.xaml.cs | 15 +- 11 files changed, 62 insertions(+), 442 deletions(-) delete mode 100644 FRBDK/Glue/Glue/Controls/TextInputWindow.Designer.cs delete mode 100644 FRBDK/Glue/Glue/Controls/TextInputWindow.cs delete mode 100644 FRBDK/Glue/Glue/Controls/TextInputWindow.resx diff --git a/FRBDK/Glue/Glue/Controls/CustomizableTextInputWindow.xaml.cs b/FRBDK/Glue/Glue/Controls/CustomizableTextInputWindow.xaml.cs index 3709851eb..e9bdeb131 100644 --- a/FRBDK/Glue/Glue/Controls/CustomizableTextInputWindow.xaml.cs +++ b/FRBDK/Glue/Glue/Controls/CustomizableTextInputWindow.xaml.cs @@ -6,6 +6,12 @@ namespace FlatRedBall.Glue.Controls { + public enum AboveOrBelow + { + Above, + Below + } + /// /// Interaction logic for CustomizableTextInputWindow.xaml /// @@ -50,7 +56,7 @@ public void HighlightText() TextBox.SelectAll(); } - public void AddControl(UserControl control, AboveOrBelow aboveOrBelow = AboveOrBelow.Below) + public void AddControl(Control control, AboveOrBelow aboveOrBelow = AboveOrBelow.Below) { if(aboveOrBelow == AboveOrBelow.Above) { diff --git a/FRBDK/Glue/Glue/Controls/TextInputWindow.Designer.cs b/FRBDK/Glue/Glue/Controls/TextInputWindow.Designer.cs deleted file mode 100644 index b549110fb..000000000 --- a/FRBDK/Glue/Glue/Controls/TextInputWindow.Designer.cs +++ /dev/null @@ -1,157 +0,0 @@ -namespace FlatRedBall.Glue.Controls -{ - - partial class TextInputWindow - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.mDisplayText = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.mOkWindow = new System.Windows.Forms.Button(); - this.mCancelButton = new System.Windows.Forms.Button(); - this.DefaultControlPanel = new System.Windows.Forms.Panel(); - this.ExtraControlsPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.ExtraControlsPanelAbove = new System.Windows.Forms.FlowLayoutPanel(); - this.DefaultControlPanel.SuspendLayout(); - this.SuspendLayout(); - // - // mDisplayText - // - this.mDisplayText.AutoSize = true; - this.mDisplayText.Location = new System.Drawing.Point(0, 1); - this.mDisplayText.Margin = new System.Windows.Forms.Padding(0, 0, 12, 2); - this.mDisplayText.Name = "mDisplayText"; - this.mDisplayText.Size = new System.Drawing.Size(35, 13); - this.mDisplayText.TabIndex = 5; - this.mDisplayText.Text = "label1"; - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; - this.textBox1.Location = new System.Drawing.Point(3, 18); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(287, 20); - this.textBox1.TabIndex = 0; - // - // mOkWindow - // - this.mOkWindow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.mOkWindow.DialogResult = System.Windows.Forms.DialogResult.OK; - this.mOkWindow.Location = new System.Drawing.Point(144, 44); - this.mOkWindow.Name = "mOkWindow"; - this.mOkWindow.Size = new System.Drawing.Size(70, 23); - this.mOkWindow.TabIndex = 1; - this.mOkWindow.Text = "Ok"; - this.mOkWindow.UseVisualStyleBackColor = true; - // - // mCancelButton - // - this.mCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.mCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.mCancelButton.Location = new System.Drawing.Point(220, 44); - this.mCancelButton.Name = "mCancelButton"; - this.mCancelButton.Size = new System.Drawing.Size(70, 23); - this.mCancelButton.TabIndex = 2; - this.mCancelButton.Text = "Cancel"; - this.mCancelButton.UseVisualStyleBackColor = true; - // - // DefaultControlPanel - // - this.DefaultControlPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.DefaultControlPanel.BackColor = System.Drawing.SystemColors.Control; - this.DefaultControlPanel.Controls.Add(this.textBox1); - this.DefaultControlPanel.Controls.Add(this.mDisplayText); - this.DefaultControlPanel.Location = new System.Drawing.Point(0, 1); - this.DefaultControlPanel.Margin = new System.Windows.Forms.Padding(0); - this.DefaultControlPanel.Name = "DefaultControlPanel"; - this.DefaultControlPanel.Size = new System.Drawing.Size(293, 40); - this.DefaultControlPanel.TabIndex = 6; - // - // ExtraControlsPanel - // - this.ExtraControlsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ExtraControlsPanel.AutoSize = true; - this.ExtraControlsPanel.BackColor = System.Drawing.SystemColors.Control; - this.ExtraControlsPanel.Location = new System.Drawing.Point(0, 41); - this.ExtraControlsPanel.Name = "ExtraControlsPanel"; - this.ExtraControlsPanel.Size = new System.Drawing.Size(293, 1); - this.ExtraControlsPanel.TabIndex = 7; - // - // ExtraControlsPanelAbove - // - this.ExtraControlsPanelAbove.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ExtraControlsPanelAbove.AutoSize = true; - this.ExtraControlsPanelAbove.BackColor = System.Drawing.SystemColors.Control; - this.ExtraControlsPanelAbove.Location = new System.Drawing.Point(0, 0); - this.ExtraControlsPanelAbove.Margin = new System.Windows.Forms.Padding(0); - this.ExtraControlsPanelAbove.Name = "ExtraControlsPanelAbove"; - this.ExtraControlsPanelAbove.Size = new System.Drawing.Size(293, 0); - this.ExtraControlsPanelAbove.TabIndex = 8; - // - // TextInputWindow - // - this.AcceptButton = this.mOkWindow; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.CancelButton = this.mCancelButton; - this.ClientSize = new System.Drawing.Size(293, 69); - this.Controls.Add(this.ExtraControlsPanelAbove); - this.Controls.Add(this.ExtraControlsPanel); - this.Controls.Add(this.DefaultControlPanel); - this.Controls.Add(this.mCancelButton); - this.Controls.Add(this.mOkWindow); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TextInputWindow"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.DefaultControlPanel.ResumeLayout(false); - this.DefaultControlPanel.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label mDisplayText; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Button mOkWindow; - private System.Windows.Forms.Button mCancelButton; - private System.Windows.Forms.Panel DefaultControlPanel; - private System.Windows.Forms.FlowLayoutPanel ExtraControlsPanel; - private System.Windows.Forms.FlowLayoutPanel ExtraControlsPanelAbove; - - } -} \ No newline at end of file diff --git a/FRBDK/Glue/Glue/Controls/TextInputWindow.cs b/FRBDK/Glue/Glue/Controls/TextInputWindow.cs deleted file mode 100644 index dc59b08b5..000000000 --- a/FRBDK/Glue/Glue/Controls/TextInputWindow.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace FlatRedBall.Glue.Controls -{ - public enum AboveOrBelow - { - Above, - Below - } - - [Obsolete("Use CustomizableTextInputWindow which is WPF and more flexible")] - public partial class TextInputWindow : Form - { - #region Properties - - - public string Message - { - get - { - return this.mDisplayText.Text; - } - set - { - this.mDisplayText.Text = value; - } - } - - [Obsolete("Use Message")] - public string DisplayText - { - get { return Message; } - set { Message = value; } - } - - public string Result - { - get { return textBox1.Text; } - set { textBox1.Text = value; } - } - - #endregion - - public TextInputWindow() - { - InitializeComponent(); - DialogResult = DialogResult.Cancel; - - StartPosition = FormStartPosition.Manual; - Location = new Point(TextInputWindow.MousePosition.X - Width / 2, TextInputWindow.MousePosition.Y - Height / 2); - this.EnsureOnScreen(); - } - - /// - /// Adds a control to the TextInputWindow. The control will automatically - /// be positioned below the previously-added control. The spacing can be controlled - /// through the control's Margin property. - /// - /// - /// If you are adding a control after a label, you may need to adjust - /// the label's height. By default it's bigger than usually desired. - /// - /// The control to add - public void AddControl(Control control, AboveOrBelow aboveOrBelow = AboveOrBelow.Below) - { - bool isFirst = (aboveOrBelow == AboveOrBelow.Below && this.ExtraControlsPanel.Controls.Count == 0) - || - (aboveOrBelow == AboveOrBelow.Above && this.ExtraControlsPanelAbove.Controls.Count == 0) - ; - if (isFirst) - { - this.Height += 5; - } - - if (aboveOrBelow == AboveOrBelow.Above) - { - this.ExtraControlsPanelAbove.Controls.Add(control); - } - else - { - // below - this.ExtraControlsPanel.Controls.Add(control); - - } - this.Height += control.Height; - this.textBox1.Focus(); - this.DefaultControlPanel.Location = new Point(0, ExtraControlsPanelAbove.Height); - } - - public void ClickOk() - { - this.mOkWindow.PerformClick(); - } - - protected override void OnActivated(EventArgs e) { - base.OnActivated(e); - textBox1.Focus(); - } - } -} diff --git a/FRBDK/Glue/Glue/Controls/TextInputWindow.resx b/FRBDK/Glue/Glue/Controls/TextInputWindow.resx deleted file mode 100644 index d58980a38..000000000 --- a/FRBDK/Glue/Glue/Controls/TextInputWindow.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/FRBDK/Glue/Glue/CreatedClass/CustomClassWindow.cs b/FRBDK/Glue/Glue/CreatedClass/CustomClassWindow.cs index ae261ab9b..f489a9f15 100644 --- a/FRBDK/Glue/Glue/CreatedClass/CustomClassWindow.cs +++ b/FRBDK/Glue/Glue/CreatedClass/CustomClassWindow.cs @@ -73,12 +73,12 @@ public void SelectFile(ReferencedFileSave rfs) private void NewClassButton_Click(object sender, EventArgs e) { - TextInputWindow tiw = new TextInputWindow(); - tiw.Message = "Enter new class name"; - - DialogResult result = tiw.ShowDialog(this); + CustomizableTextInputWindow tiw = new() + { + Message = "Enter new class name" + }; - if (result == DialogResult.OK) + if (tiw.ShowDialog() is true) { string newClassName = tiw.Result; diff --git a/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs b/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs index 12e5170fc..f92c0d7e3 100644 --- a/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs +++ b/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs @@ -1644,13 +1644,12 @@ private static void AskToRemoveCustomVariablesWithoutState(IElement element) internal static void AddFolderClick(ITreeNode targetNode) { // addfolder, add folder, add new folder, addnewfolder - var tiw = new TextInputWindow(); - tiw.Message = L.Texts.NewFolderEnter; - tiw.Text = L.Texts.NewFolder; - - var result = tiw.ShowDialog(MainGlueWindow.Self); + CustomizableTextInputWindow tiw = new() + { + Message = L.Texts.NewFolderEnter, + }; - if (result == DialogResult.OK) + if (tiw.ShowDialog() is true) { string folderName = tiw.Result; GlueCommands.Self.ProjectCommands.AddDirectory(folderName, targetNode); @@ -1827,13 +1826,13 @@ public static async void DeleteFolderClick(ITreeNode targetNode) static void HandleRenameFolderClick(ITreeNode treeNode) { - var inputWindow = new TextInputWindow(); - inputWindow.Message = L.Texts.NewFolderEnter; - inputWindow.Result = treeNode.Text; - - var dialogResult = inputWindow.ShowDialog(); + CustomizableTextInputWindow inputWindow = new() + { + Message = L.Texts.NewFolderEnter, + Result = treeNode.Text + }; - if (dialogResult == DialogResult.OK) + if (inputWindow.ShowDialog() is true) { GlueCommands.Self.GluxCommands.RenameFolder(treeNode, inputWindow.Result); } diff --git a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/AddToShapeCollectionPlugin/MainAddToShapeCollectionPlugin.cs b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/AddToShapeCollectionPlugin/MainAddToShapeCollectionPlugin.cs index dfcc5e71e..d4378c470 100644 --- a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/AddToShapeCollectionPlugin/MainAddToShapeCollectionPlugin.cs +++ b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/AddToShapeCollectionPlugin/MainAddToShapeCollectionPlugin.cs @@ -83,11 +83,12 @@ private static async Task HandleAddShape(string message, AssetT { NamedObjectSave toReturn = null; - var tiw = new TextInputWindow(); - tiw.Message = message; - var dialogResult = tiw.ShowDialog(); + CustomizableTextInputWindow tiw = new() + { + Message = message + }; - if (dialogResult == DialogResult.OK) + if (tiw.ShowDialog() is true) { string whyItIsntValid; NameVerifier.IsNamedObjectNameValid(tiw.Result, out whyItIsntValid); diff --git a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/CameraPlugin/CameraSettingsWindow.cs b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/CameraPlugin/CameraSettingsWindow.cs index cb032b3b2..a4e37c00a 100644 --- a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/CameraPlugin/CameraSettingsWindow.cs +++ b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/CameraPlugin/CameraSettingsWindow.cs @@ -188,9 +188,12 @@ private void cbSetOrthResolution_CheckedChanged(object sender, EventArgs e) private void AddResolutionButton_Click(object sender, EventArgs e) { - TextInputWindow tiw = new TextInputWindow(); - tiw.DisplayText = "Enter name for the new resolution preset"; - if (tiw.ShowDialog() == System.Windows.Forms.DialogResult.OK) + CustomizableTextInputWindow tiw = new() + { + Message = "Enter name for the new resolution preset" + }; + + if (tiw.ShowDialog() is true) { string whyIsntValid = WhyIsntResolutionPresetNameValid(tiw.Result); diff --git a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs index 243d06ec5..1046c4f32 100644 --- a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs +++ b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs @@ -145,12 +145,12 @@ private void OpenInBrowser(string url) private void findFileReferencesToolStripMenuItem_Click(object sender, EventArgs e) { - var tiw = new TextInputWindow(); - tiw.Message = Localization.Texts.EnterFileWithExtension; - - + CustomizableTextInputWindow tiw = new() + { + Message = Localization.Texts.EnterFileWithExtension + }; - if (tiw.ShowDialog(MainGlueWindow.Self) == DialogResult.OK) + if (tiw.ShowDialog() is true) { List matchingReferencedFileSaves = new List(); List matchingRegularFiles = new List(); @@ -232,25 +232,24 @@ private void viewNewFileTemplateFolderToolStripMenuItem_Click(object sender, Eve private void newContentCSVToolStripMenuItem_Click(object sender, EventArgs e) { - TextInputWindow tiw = new TextInputWindow(); - tiw.DisplayText = Localization.Texts.EnterNewCSVName; + CustomizableTextInputWindow tiw = new() + { + Message = Localization.Texts.EnterNewCSVName + }; - var comboBox = new ComboBox(); + var comboBox = new System.Windows.Controls.ComboBox(); // project-specific CSVs are always named ProjectSpecificContent.csv comboBox.Items.Add(Localization.Texts.ProjectForAll); comboBox.Items.Add(Localization.Texts.ProjectThisOnly); // May 11 2023 - probably want to default to this project comboBox.Text = Localization.Texts.ProjectThisOnly; - comboBox.DropDownStyle = ComboBoxStyle.DropDownList; comboBox.Width = 136; tiw.AddControl(comboBox); - DialogResult result = tiw.ShowDialog(); - // CSVs can be added to be project-specific or shared across all projects (installed to a centralized location) - if (result == DialogResult.OK) + if (tiw.ShowDialog() is true) { string textResult = tiw.Result; if (textResult.ToLower().EndsWith(".csv", StringComparison.OrdinalIgnoreCase)) diff --git a/FRBDK/Glue/Glue/Plugins/ExportedImplementations/CommandInterfaces/DialogCommands.cs b/FRBDK/Glue/Glue/Plugins/ExportedImplementations/CommandInterfaces/DialogCommands.cs index 730362139..e074468b8 100644 --- a/FRBDK/Glue/Glue/Plugins/ExportedImplementations/CommandInterfaces/DialogCommands.cs +++ b/FRBDK/Glue/Glue/Plugins/ExportedImplementations/CommandInterfaces/DialogCommands.cs @@ -1116,13 +1116,12 @@ public void HideToast() public async void ShowAddNewCategoryDialog() { // add category, addcategory, add state category - var tiw = new TextInputWindow(); - tiw.Message = L.Texts.CategoryEnterName; - tiw.Text = L.Texts.CategoryNew; - - DialogResult result = tiw.ShowDialog(MainGlueWindow.Self); + CustomizableTextInputWindow tiw = new() + { + Message = L.Texts.CategoryEnterName + }; - if (result == DialogResult.OK) + if (tiw.ShowDialog() is true) { string whyItIsntValid; @@ -1144,14 +1143,12 @@ public async void ShowAddNewCategoryDialog() public void ShowAddNewStateDialog() { // search: addstate, add new state, addnewstate, add state - var tiw = new TextInputWindow(); - tiw.Message = L.Texts.StateEnterName; - tiw.Text = L.Texts.StateNew; - - - DialogResult result = tiw.ShowDialog(MainGlueWindow.Self); + CustomizableTextInputWindow tiw = new() + { + Message = L.Texts.StateEnterName + }; - if (result == DialogResult.OK) + if (tiw.ShowDialog() is true) { var currentElement = GlueState.Self.CurrentElement; diff --git a/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/Views/LevelScreenView.xaml.cs b/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/Views/LevelScreenView.xaml.cs index f9a479e6f..296aff605 100644 --- a/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/Views/LevelScreenView.xaml.cs +++ b/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/Views/LevelScreenView.xaml.cs @@ -36,15 +36,14 @@ private void DeleteLevelClicked(object sender, RoutedEventArgs e) private void DuplicateLevelClicked(object sender, RoutedEventArgs e) { - var tiw = new TextInputWindow(); - tiw.Message = Localization.Texts.EnterNewTmx; - - tiw.Result = StringFunctions.IncrementNumberAtEnd(FileManager.RemoveExtension(ViewModel.SelectedTmxFile)) - + ".tmx"; - - var result = tiw.ShowDialog(); + CustomizableTextInputWindow tiw = new() + { + Message = Localization.Texts.EnterNewTmx, + Result = StringFunctions.IncrementNumberAtEnd(FileManager.RemoveExtension(ViewModel.SelectedTmxFile)) + + ".tmx" + }; - if (result == System.Windows.Forms.DialogResult.OK) + if (tiw.ShowDialog() is true) { FilePath resultFilePath = GlueState.Self.ContentDirectory + tiw.Result; From c01d058b3e86012357c6d87fec2bbf2a27ab23b1 Mon Sep 17 00:00:00 2001 From: victor Date: Sat, 28 Sep 2024 23:13:30 -0700 Subject: [PATCH 2/2] remove hard width in combobox --- .../EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs index 1046c4f32..3ac8d6aa4 100644 --- a/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs +++ b/FRBDK/Glue/Glue/Plugins/EmbeddedPlugins/MenuStripPlugin/MainMenuStripPlugin.cs @@ -23,6 +23,7 @@ using System.Text; using System.Windows.Forms; using FlatRedBall.Glue.Themes; +using HorizontalAlignment = System.Windows.HorizontalAlignment; namespace GlueFormsCore.Plugins.EmbeddedPlugins.MenuStripPlugin { @@ -244,7 +245,7 @@ private void newContentCSVToolStripMenuItem_Click(object sender, EventArgs e) comboBox.Items.Add(Localization.Texts.ProjectThisOnly); // May 11 2023 - probably want to default to this project comboBox.Text = Localization.Texts.ProjectThisOnly; - comboBox.Width = 136; + comboBox.HorizontalAlignment = HorizontalAlignment.Center; tiw.AddControl(comboBox); // CSVs can be added to be project-specific or shared across all projects (installed to a centralized location)