From ab7ac7e608a813b2f5a352b7ca306bc68954892f Mon Sep 17 00:00:00 2001 From: Stupar Date: Mon, 23 Jan 2023 19:30:42 +0100 Subject: [PATCH] v1.7.0 --- source/2022/2022.csproj | 9 +- .../package/source.extension.vsixmanifest | 2 +- source/other/2015/2015.csproj | 3 +- .../package/source.extension.vsixmanifest | 2 +- source/other/2017/2017.csproj | 3 +- .../package/source.extension.vsixmanifest | 2 +- source/other/2019/2019.csproj | 5 +- .../package/source.extension.vsixmanifest | 2 +- ...sAutoShared.projitems => shared.projitems} | 36 +- source/shared/project/shared.shproj | 7 +- .../project/source/gui/advanced.Designer.cs | 540 +++-- source/shared/project/source/gui/advanced.cs | 16 +- .../shared/project/source/gui/advanced.resx | 62 +- .../project/source/gui/error.Designer.cs | 2 +- source/shared/project/source/gui/error.cs | 5 +- .../project/source/gui/question.Designer.cs | 366 +-- source/shared/project/source/gui/question.cs | 5 +- .../shared/project/source/gui/question.resx | 62 +- .../source/gui/questionFtd.Designer.cs | 393 ++-- .../shared/project/source/gui/questionFtd.cs | 5 +- .../project/source/gui/questionFtd.resx | 62 +- .../shared/project/source/other/test/other.cs | 1 + source/shared/project/source/other/using.cs | 2051 +++++++++++++++++ .../shared/project/source/source/main/main.cs | 9 +- .../project/source/source/main/main2.cs | 48 +- .../source/source/utility/extension.cs | 1 + .../project/source/source/utility/path.cs | 261 --- .../project/source/source/utility/project.cs | 17 +- .../source/source/work/dirToFilter/data.cs | 1 + .../work/dirToFilter/utility/filters.cs | 3 +- .../source/source/work/dirToFilter/work.cs | 68 +- .../source/source/work/filterToDir/data.cs | 1 + .../source/work/filterToDir/utility/dir.cs | 1 + .../work/filterToDir/utility/dir.dir2.cs | 1 + .../work/filterToDir/utility/dir.file2.cs | 1 + .../source/source/work/filterToDir/work.cs | 59 +- .../project/source/source/work/shared/file.cs | 1 + .../source/source/work/shared/filter.cs | 1 + source/vsExtensionCppFiltersGenerate.sln | 13 +- 39 files changed, 2878 insertions(+), 1249 deletions(-) rename source/shared/project/{cppFiltersAutoShared.projitems => shared.projitems} (96%) create mode 100644 source/shared/project/source/other/using.cs delete mode 100644 source/shared/project/source/source/utility/path.cs diff --git a/source/2022/2022.csproj b/source/2022/2022.csproj index 08571b9..7b8abea 100644 --- a/source/2022/2022.csproj +++ b/source/2022/2022.csproj @@ -21,6 +21,7 @@ ..\shared\other\package\resource\icon.ico + 9.0 true @@ -94,13 +95,13 @@ - 17.2.32505.173 + 17.4.33103.184 - 17.2.32505.173 + 17.4.33103.184 - 17.2.2186 + 17.4.2119 runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -108,7 +109,7 @@ - + + diff --git a/source/shared/project/source/gui/error.Designer.cs b/source/shared/project/source/gui/error.Designer.cs index 1feb4a5..4321d98 100644 --- a/source/shared/project/source/gui/error.Designer.cs +++ b/source/shared/project/source/gui/error.Designer.cs @@ -29,7 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formError)); - this.textBox = new System.Windows.Forms.TextBox(); + this.textBox = new u.forms.textBox.textBox2(); this.SuspendLayout(); // // textBox diff --git a/source/shared/project/source/gui/error.cs b/source/shared/project/source/gui/error.cs index 4cf55de..55067f7 100644 --- a/source/shared/project/source/gui/error.cs +++ b/source/shared/project/source/gui/error.cs @@ -7,14 +7,17 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using u; +using u.forms.form; namespace VisualStudioCppExtensions { - public partial class formError : Form + public partial class formError : form2 { public formError() { InitializeComponent(); + this.xScale(); } diff --git a/source/shared/project/source/gui/question.Designer.cs b/source/shared/project/source/gui/question.Designer.cs index 6d2c1a1..b6e9426 100644 --- a/source/shared/project/source/gui/question.Designer.cs +++ b/source/shared/project/source/gui/question.Designer.cs @@ -1,4 +1,6 @@ -namespace VisualStudioCppExtensions +using u.forms.label; + +namespace VisualStudioCppExtensions { partial class formQuestion { @@ -29,246 +31,244 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formQuestion)); - this.buttonYes = new System.Windows.Forms.Button(); - this.buttonAdvanced = new System.Windows.Forms.Button(); - this.labelQuestion = new System.Windows.Forms.Label(); - this.labelInfoProject2 = new System.Windows.Forms.Label(); - this.labelQuestionMark = new System.Windows.Forms.Label(); - this.labelInfoFroject = new System.Windows.Forms.Label(); - this.labelInfoCalculate2 = new System.Windows.Forms.Label(); - this.labelInfoOut2 = new System.Windows.Forms.Label(); - this.labelInfoOut3 = new System.Windows.Forms.Label(); - this.labelInfoCalculate3 = new System.Windows.Forms.Label(); - this.labelWarning = new System.Windows.Forms.Label(); - this.groupBoxQuestion = new System.Windows.Forms.GroupBox(); - this.labelWarning2 = new System.Windows.Forms.Label(); - this.labelWarning3 = new System.Windows.Forms.Label(); - this.labelInfoIn = new System.Windows.Forms.Label(); - this.labelInfoCalculate = new System.Windows.Forms.Label(); - this.labelInfoOut = new System.Windows.Forms.Label(); - this.labelInfoIn2 = new System.Windows.Forms.Label(); - this.labelWarning4 = new System.Windows.Forms.Label(); - this.groupBoxQuestion.SuspendLayout(); - this.SuspendLayout(); + buttonYes = new System.Windows.Forms.Button(); + buttonAdvanced = new System.Windows.Forms.Button(); + labelQuestion = new System.Windows.Forms.Label(); + labelInfoProject2 = new System.Windows.Forms.Label(); + labelQuestionMark = new System.Windows.Forms.Label(); + labelInfoProject = new labelAlign(); + labelInfoCalculate2 = new labelAlign(); + labelInfoOut2 = new labelAlign(); + labelInfoOut3 = new System.Windows.Forms.Label(); + labelInfoCalculate3 = new System.Windows.Forms.Label(); + labelWarning = new System.Windows.Forms.Label(); + groupBoxQuestion = new System.Windows.Forms.GroupBox(); + labelWarning2 = new System.Windows.Forms.Label(); + labelWarning3 = new System.Windows.Forms.Label(); + labelInfoIn = new labelAlign(); + labelInfoCalculate = new labelAlign(); + labelInfoOut = new labelAlign(); + labelInfoIn2 = new System.Windows.Forms.Label(); + labelWarning4 = new System.Windows.Forms.Label(); + groupBoxQuestion.SuspendLayout(); + SuspendLayout(); // // buttonYes // - this.buttonYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonYes.Location = new System.Drawing.Point(51, 57); - this.buttonYes.Name = "buttonYes"; - this.buttonYes.Size = new System.Drawing.Size(88, 35); - this.buttonYes.TabIndex = 0; - this.buttonYes.Text = "yes"; - this.buttonYes.UseVisualStyleBackColor = true; - this.buttonYes.Click += new System.EventHandler(this.buttonYesClick); + buttonYes.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + buttonYes.Location = new System.Drawing.Point(51, 57); + buttonYes.Name = "buttonYes"; + buttonYes.Size = new System.Drawing.Size(88, 35); + buttonYes.TabIndex = 0; + buttonYes.Text = "yes"; + buttonYes.UseVisualStyleBackColor = true; + buttonYes.Click += buttonYesClick; // // buttonAdvanced // - this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAdvanced.Location = new System.Drawing.Point(51, 16); - this.buttonAdvanced.Name = "buttonAdvanced"; - this.buttonAdvanced.Size = new System.Drawing.Size(88, 35); - this.buttonAdvanced.TabIndex = 1; - this.buttonAdvanced.Text = "advanced"; - this.buttonAdvanced.UseVisualStyleBackColor = true; - this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvancedClick); + buttonAdvanced.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + buttonAdvanced.Location = new System.Drawing.Point(51, 16); + buttonAdvanced.Name = "buttonAdvanced"; + buttonAdvanced.Size = new System.Drawing.Size(88, 35); + buttonAdvanced.TabIndex = 1; + buttonAdvanced.Text = "advanced"; + buttonAdvanced.UseVisualStyleBackColor = true; + buttonAdvanced.Click += buttonAdvancedClick; // // labelQuestion // - this.labelQuestion.AutoSize = true; - this.labelQuestion.Location = new System.Drawing.Point(12, 9); - this.labelQuestion.Name = "labelQuestion"; - this.labelQuestion.Size = new System.Drawing.Size(486, 13); - this.labelQuestion.TabIndex = 2; - this.labelQuestion.Text = "Do you want to automatically generate (directoryTree 🡢 filterTree) filters for:"; + labelQuestion.Location = new System.Drawing.Point(12, 9); + labelQuestion.Name = "labelQuestion"; + labelQuestion.Size = new System.Drawing.Size(486, 13); + labelQuestion.TabIndex = 2; + labelQuestion.Text = "Do you want to automatically generate (directoryTree 🡢 filterTree) filters for:"; // // labelInfoProject2 // - this.labelInfoProject2.AutoSize = true; - this.labelInfoProject2.Location = new System.Drawing.Point(103, 31); - this.labelInfoProject2.Name = "labelInfoProject2"; - this.labelInfoProject2.Size = new System.Drawing.Size(31, 13); - this.labelInfoProject2.TabIndex = 2; - this.labelInfoProject2.Text = "name"; + labelInfoProject2.AutoSize = true; + labelInfoProject2.Location = new System.Drawing.Point(103, 31); + labelInfoProject2.Name = "labelInfoProject2"; + labelInfoProject2.Size = new System.Drawing.Size(31, 13); + labelInfoProject2.TabIndex = 2; + labelInfoProject2.Text = "name"; // // labelQuestionMark // - this.labelQuestionMark.AutoSize = true; - this.labelQuestionMark.Font = new System.Drawing.Font("Consolas", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelQuestionMark.Location = new System.Drawing.Point(6, 16); - this.labelQuestionMark.Name = "labelQuestionMark"; - this.labelQuestionMark.Size = new System.Drawing.Size(39, 43); - this.labelQuestionMark.TabIndex = 2; - this.labelQuestionMark.Text = "?"; + labelQuestionMark.Font = new System.Drawing.Font("Consolas", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + labelQuestionMark.Location = new System.Drawing.Point(6, 16); + labelQuestionMark.Name = "labelQuestionMark"; + labelQuestionMark.Size = new System.Drawing.Size(39, 43); + labelQuestionMark.TabIndex = 2; + labelQuestionMark.Text = "?"; // - // labelInfoFroject + // labelInfoProject // - this.labelInfoFroject.AutoSize = true; - this.labelInfoFroject.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoFroject.Location = new System.Drawing.Point(24, 31); - this.labelInfoFroject.Name = "labelInfoFroject"; - this.labelInfoFroject.Size = new System.Drawing.Size(55, 13); - this.labelInfoFroject.TabIndex = 2; - this.labelInfoFroject.Text = "project:"; + labelInfoProject.AutoSize = true; + labelInfoProject.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoProject.Location = new System.Drawing.Point(24, 31); + labelInfoProject.Name = "labelInfoFroject"; + labelInfoProject.Size = new System.Drawing.Size(55, 13); + labelInfoProject.TabIndex = 2; + labelInfoProject.Text = "project:"; + labelInfoProject.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoCalculate2 // - this.labelInfoCalculate2.AutoSize = true; - this.labelInfoCalculate2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoCalculate2.Location = new System.Drawing.Point(121, 86); - this.labelInfoCalculate2.Name = "labelInfoCalculate2"; - this.labelInfoCalculate2.Size = new System.Drawing.Size(55, 13); - this.labelInfoCalculate2.TabIndex = 2; - this.labelInfoCalculate2.Text = "rootDir:"; + labelInfoCalculate2.AutoSize = true; + labelInfoCalculate2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoCalculate2.Location = new System.Drawing.Point(121, 86); + labelInfoCalculate2.Name = "labelInfoCalculate2"; + labelInfoCalculate2.Size = new System.Drawing.Size(55, 13); + labelInfoCalculate2.TabIndex = 2; + labelInfoCalculate2.Text = "rootDir:"; + labelInfoCalculate2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut2 // - this.labelInfoOut2.AutoSize = true; - this.labelInfoOut2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoOut2.Location = new System.Drawing.Point(103, 108); - this.labelInfoOut2.Name = "labelInfoOut2"; - this.labelInfoOut2.Size = new System.Drawing.Size(73, 13); - this.labelInfoOut2.TabIndex = 2; - this.labelInfoOut2.Text = "rootFilter:"; + labelInfoOut2.AutoSize = true; + labelInfoOut2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoOut2.Location = new System.Drawing.Point(103, 108); + labelInfoOut2.Name = "labelInfoOut2"; + labelInfoOut2.Size = new System.Drawing.Size(73, 13); + labelInfoOut2.TabIndex = 2; + labelInfoOut2.Text = "rootFilter:"; + labelInfoOut2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut3 // - this.labelInfoOut3.AutoSize = true; - this.labelInfoOut3.Location = new System.Drawing.Point(200, 108); - this.labelInfoOut3.Name = "labelInfoOut3"; - this.labelInfoOut3.Size = new System.Drawing.Size(31, 13); - this.labelInfoOut3.TabIndex = 2; - this.labelInfoOut3.Text = "name"; + labelInfoOut3.AutoSize = true; + labelInfoOut3.Location = new System.Drawing.Point(200, 108); + labelInfoOut3.Name = "labelInfoOut3"; + labelInfoOut3.Size = new System.Drawing.Size(31, 13); + labelInfoOut3.TabIndex = 2; + labelInfoOut3.Text = "name"; // // labelInfoCalculate3 // - this.labelInfoCalculate3.AutoSize = true; - this.labelInfoCalculate3.Location = new System.Drawing.Point(200, 86); - this.labelInfoCalculate3.Name = "labelInfoCalculate3"; - this.labelInfoCalculate3.Size = new System.Drawing.Size(31, 13); - this.labelInfoCalculate3.TabIndex = 2; - this.labelInfoCalculate3.Text = "name"; + labelInfoCalculate3.AutoSize = true; + labelInfoCalculate3.Location = new System.Drawing.Point(200, 86); + labelInfoCalculate3.Name = "labelInfoCalculate3"; + labelInfoCalculate3.Size = new System.Drawing.Size(31, 13); + labelInfoCalculate3.TabIndex = 2; + labelInfoCalculate3.Text = "name"; // // labelWarning // - this.labelWarning.AutoSize = true; - this.labelWarning.Location = new System.Drawing.Point(12, 165); - this.labelWarning.Name = "labelWarning"; - this.labelWarning.Size = new System.Drawing.Size(73, 13); - this.labelWarning.TabIndex = 2; - this.labelWarning.Text = "Warning: "; + labelWarning.Location = new System.Drawing.Point(12, 165); + labelWarning.Name = "labelWarning"; + labelWarning.Size = new System.Drawing.Size(73, 13); + labelWarning.TabIndex = 2; + labelWarning.Text = "Warning: "; // // groupBoxQuestion // - this.groupBoxQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxQuestion.Controls.Add(this.buttonAdvanced); - this.groupBoxQuestion.Controls.Add(this.buttonYes); - this.groupBoxQuestion.Controls.Add(this.labelQuestionMark); - this.groupBoxQuestion.Location = new System.Drawing.Point(437, 114); - this.groupBoxQuestion.Name = "groupBoxQuestion"; - this.groupBoxQuestion.Size = new System.Drawing.Size(154, 100); - this.groupBoxQuestion.TabIndex = 3; - this.groupBoxQuestion.TabStop = false; + groupBoxQuestion.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + groupBoxQuestion.Controls.Add(buttonAdvanced); + groupBoxQuestion.Controls.Add(buttonYes); + groupBoxQuestion.Controls.Add(labelQuestionMark); + groupBoxQuestion.Location = new System.Drawing.Point(437, 114); + groupBoxQuestion.Name = "groupBoxQuestion"; + groupBoxQuestion.Size = new System.Drawing.Size(154, 100); + groupBoxQuestion.TabIndex = 3; + groupBoxQuestion.TabStop = false; // // labelWarning2 // - this.labelWarning2.AutoSize = true; - this.labelWarning2.Location = new System.Drawing.Point(82, 165); - this.labelWarning2.Name = "labelWarning2"; - this.labelWarning2.Size = new System.Drawing.Size(319, 13); - this.labelWarning2.TabIndex = 4; - this.labelWarning2.Text = "Please save the project before using this extension."; + labelWarning2.Location = new System.Drawing.Point(82, 165); + labelWarning2.Name = "labelWarning2"; + labelWarning2.Size = new System.Drawing.Size(319, 13); + labelWarning2.TabIndex = 4; + labelWarning2.Text = "Please save the project before using this extension."; // // labelWarning3 // - this.labelWarning3.AutoSize = true; - this.labelWarning3.Location = new System.Drawing.Point(82, 182); - this.labelWarning3.Name = "labelWarning3"; - this.labelWarning3.Size = new System.Drawing.Size(349, 13); - this.labelWarning3.TabIndex = 5; - this.labelWarning3.Text = "If results are not adequate, close project without saving"; + labelWarning3.Location = new System.Drawing.Point(82, 182); + labelWarning3.Name = "labelWarning3"; + labelWarning3.Size = new System.Drawing.Size(349, 13); + labelWarning3.TabIndex = 5; + labelWarning3.Text = "If results are not adequate, close project without saving"; // // labelInfoIn // - this.labelInfoIn.AutoSize = true; - this.labelInfoIn.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoIn.Location = new System.Drawing.Point(54, 64); - this.labelInfoIn.Name = "labelInfoIn"; - this.labelInfoIn.Size = new System.Drawing.Size(25, 13); - this.labelInfoIn.TabIndex = 6; - this.labelInfoIn.Text = "in:"; + labelInfoIn.AutoSize = true; + labelInfoIn.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoIn.Location = new System.Drawing.Point(54, 64); + labelInfoIn.Name = "labelInfoIn"; + labelInfoIn.Size = new System.Drawing.Size(25, 13); + labelInfoIn.TabIndex = 6; + labelInfoIn.Text = "in:"; + labelInfoIn.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoCalculate // - this.labelInfoCalculate.AutoSize = true; - this.labelInfoCalculate.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoCalculate.Location = new System.Drawing.Point(12, 86); - this.labelInfoCalculate.Name = "labelInfoCalculate"; - this.labelInfoCalculate.Size = new System.Drawing.Size(67, 13); - this.labelInfoCalculate.TabIndex = 7; - this.labelInfoCalculate.Text = "calculate:"; + labelInfoCalculate.AutoSize = true; + labelInfoCalculate.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoCalculate.Location = new System.Drawing.Point(12, 86); + labelInfoCalculate.Name = "labelInfoCalculate"; + labelInfoCalculate.Size = new System.Drawing.Size(67, 13); + labelInfoCalculate.TabIndex = 7; + labelInfoCalculate.Text = "calculate:"; + labelInfoCalculate.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut // - this.labelInfoOut.AutoSize = true; - this.labelInfoOut.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoOut.Location = new System.Drawing.Point(48, 108); - this.labelInfoOut.Name = "labelInfoOut"; - this.labelInfoOut.Size = new System.Drawing.Size(31, 13); - this.labelInfoOut.TabIndex = 8; - this.labelInfoOut.Text = "out:"; + labelInfoOut.AutoSize = true; + labelInfoOut.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoOut.Location = new System.Drawing.Point(48, 108); + labelInfoOut.Name = "labelInfoOut"; + labelInfoOut.Size = new System.Drawing.Size(31, 13); + labelInfoOut.TabIndex = 8; + labelInfoOut.Text = "out:"; + labelInfoOut.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoIn2 // - this.labelInfoIn2.AutoSize = true; - this.labelInfoIn2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoIn2.Location = new System.Drawing.Point(200, 64); - this.labelInfoIn2.Name = "labelInfoIn2"; - this.labelInfoIn2.Size = new System.Drawing.Size(97, 13); - this.labelInfoIn2.TabIndex = 9; - this.labelInfoIn2.Text = "project whole"; + labelInfoIn2.AutoSize = true; + labelInfoIn2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + labelInfoIn2.Location = new System.Drawing.Point(200, 64); + labelInfoIn2.Name = "labelInfoIn2"; + labelInfoIn2.Size = new System.Drawing.Size(97, 13); + labelInfoIn2.TabIndex = 9; + labelInfoIn2.Text = "project whole"; // // labelWarning4 // - this.labelWarning4.AutoSize = true; - this.labelWarning4.Location = new System.Drawing.Point(82, 199); - this.labelWarning4.Name = "labelWarning4"; - this.labelWarning4.Size = new System.Drawing.Size(151, 13); - this.labelWarning4.TabIndex = 10; - this.labelWarning4.Text = "and open last save point"; + labelWarning4.Location = new System.Drawing.Point(82, 199); + labelWarning4.Name = "labelWarning4"; + labelWarning4.Size = new System.Drawing.Size(151, 13); + labelWarning4.TabIndex = 10; + labelWarning4.Text = "and open last save point"; // // formQuestion // - this.AcceptButton = this.buttonYes; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(599, 221); - this.Controls.Add(this.labelWarning4); - this.Controls.Add(this.labelInfoIn2); - this.Controls.Add(this.labelInfoOut); - this.Controls.Add(this.labelInfoCalculate); - this.Controls.Add(this.labelInfoIn); - this.Controls.Add(this.labelWarning3); - this.Controls.Add(this.labelWarning2); - this.Controls.Add(this.groupBoxQuestion); - this.Controls.Add(this.labelWarning); - this.Controls.Add(this.labelInfoCalculate3); - this.Controls.Add(this.labelInfoOut3); - this.Controls.Add(this.labelInfoOut2); - this.Controls.Add(this.labelInfoCalculate2); - this.Controls.Add(this.labelInfoFroject); - this.Controls.Add(this.labelInfoProject2); - this.Controls.Add(this.labelQuestion); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "formQuestion"; - this.groupBoxQuestion.ResumeLayout(false); - this.groupBoxQuestion.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AcceptButton = buttonYes; + AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(599, 221); + Controls.Add(labelWarning4); + Controls.Add(labelInfoIn2); + Controls.Add(labelInfoOut); + Controls.Add(labelInfoCalculate); + Controls.Add(labelInfoIn); + Controls.Add(labelWarning3); + Controls.Add(labelWarning2); + Controls.Add(groupBoxQuestion); + Controls.Add(labelWarning); + Controls.Add(labelInfoCalculate3); + Controls.Add(labelInfoOut3); + Controls.Add(labelInfoOut2); + Controls.Add(labelInfoCalculate2); + Controls.Add(labelInfoProject); + Controls.Add(labelInfoProject2); + Controls.Add(labelQuestion); + DoubleBuffered = true; + Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); + MaximizeBox = false; + Name = "formQuestion"; + groupBoxQuestion.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -277,7 +277,7 @@ private void InitializeComponent() private System.Windows.Forms.Label labelQuestionMark; public System.Windows.Forms.Label labelQuestion; public System.Windows.Forms.Label labelInfoProject2; - public System.Windows.Forms.Label labelInfoFroject; + public System.Windows.Forms.Label labelInfoProject; public System.Windows.Forms.Label labelInfoCalculate2; public System.Windows.Forms.Label labelInfoOut2; public System.Windows.Forms.Label labelInfoOut3; diff --git a/source/shared/project/source/gui/question.cs b/source/shared/project/source/gui/question.cs index 78234e1..f5836ce 100644 --- a/source/shared/project/source/gui/question.cs +++ b/source/shared/project/source/gui/question.cs @@ -7,10 +7,12 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using u; +using u.forms.form; namespace VisualStudioCppExtensions { - public partial class formQuestion : Form + public partial class formQuestion : form2 { public enum Result { @@ -28,6 +30,7 @@ public formQuestion() int x = this.Height; MinimumSize = new Size(Width, Height); MaximumSize = new Size(Width * 10, Height); + this.xScale(); } diff --git a/source/shared/project/source/gui/question.resx b/source/shared/project/source/gui/question.resx index 0fb6fcd..4ea154e 100644 --- a/source/shared/project/source/gui/question.resx +++ b/source/shared/project/source/gui/question.resx @@ -1,64 +1,4 @@ - - - + diff --git a/source/shared/project/source/gui/questionFtd.Designer.cs b/source/shared/project/source/gui/questionFtd.Designer.cs index 716c2eb..5f54995 100644 --- a/source/shared/project/source/gui/questionFtd.Designer.cs +++ b/source/shared/project/source/gui/questionFtd.Designer.cs @@ -1,4 +1,7 @@ -namespace VisualStudioCppExtensions +using System.Reflection.Emit; +using u.forms.label; + +namespace VisualStudioCppExtensions { partial class formQuestionFtd { @@ -29,267 +32,261 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formQuestionFtd)); - this.buttonYes = new System.Windows.Forms.Button(); - this.labelQuestion = new System.Windows.Forms.Label(); - this.labelInfoProject2 = new System.Windows.Forms.Label(); - this.labelQuestionMark = new System.Windows.Forms.Label(); - this.labelInfoFroject = new System.Windows.Forms.Label(); - this.labelInfoCalculate2 = new System.Windows.Forms.Label(); - this.labelInfoOut2 = new System.Windows.Forms.Label(); - this.labelInfoOut3 = new System.Windows.Forms.Label(); - this.labelInfoCalculate3 = new System.Windows.Forms.Label(); - this.labelWarning = new System.Windows.Forms.Label(); - this.groupBoxQuestion = new System.Windows.Forms.GroupBox(); - this.labelWarning2 = new System.Windows.Forms.Label(); - this.labelWarning3 = new System.Windows.Forms.Label(); - this.labelInfoIn = new System.Windows.Forms.Label(); - this.labelInfoCalculate = new System.Windows.Forms.Label(); - this.labelInfoOut = new System.Windows.Forms.Label(); - this.labelInfoIn2 = new System.Windows.Forms.Label(); - this.labelWarning4 = new System.Windows.Forms.Label(); - this.labelWarning5 = new System.Windows.Forms.Label(); - this.labelWarning6 = new System.Windows.Forms.Label(); - this.labelWarning7 = new System.Windows.Forms.Label(); - this.groupBoxQuestion.SuspendLayout(); - this.SuspendLayout(); + buttonYes = new System.Windows.Forms.Button(); + labelQuestion = new System.Windows.Forms.Label(); + labelInfoProject2 = new System.Windows.Forms.Label(); + labelQuestionMark = new System.Windows.Forms.Label(); + labelInfoProject = new labelAlign(); + labelInfoCalculate2 = new labelAlign(); + labelInfoOut2 = new labelAlign(); + labelInfoOut3 = new System.Windows.Forms.Label(); + labelInfoCalculate3 = new System.Windows.Forms.Label(); + labelWarning = new System.Windows.Forms.Label(); + groupBoxQuestion = new System.Windows.Forms.GroupBox(); + labelWarning2 = new System.Windows.Forms.Label(); + labelWarning3 = new System.Windows.Forms.Label(); + labelInfoIn = new labelAlign(); + labelInfoCalculate = new labelAlign(); + labelInfoOut = new labelAlign(); + labelInfoIn2 = new System.Windows.Forms.Label(); + labelWarning4 = new System.Windows.Forms.Label(); + labelWarning5 = new System.Windows.Forms.Label(); + labelWarning6 = new System.Windows.Forms.Label(); + labelWarning7 = new System.Windows.Forms.Label(); + groupBoxQuestion.SuspendLayout(); + SuspendLayout(); // // buttonYes // - this.buttonYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonYes.Location = new System.Drawing.Point(51, 13); - this.buttonYes.Name = "buttonYes"; - this.buttonYes.Size = new System.Drawing.Size(88, 35); - this.buttonYes.TabIndex = 0; - this.buttonYes.Text = "yes"; - this.buttonYes.UseVisualStyleBackColor = true; - this.buttonYes.Click += new System.EventHandler(this.buttonYesClick); + buttonYes.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + buttonYes.Location = new System.Drawing.Point(51, 13); + buttonYes.Name = "buttonYes"; + buttonYes.Size = new System.Drawing.Size(88, 35); + buttonYes.TabIndex = 0; + buttonYes.Text = "yes"; + buttonYes.UseVisualStyleBackColor = true; + buttonYes.Click += buttonYesClick; // // labelQuestion // - this.labelQuestion.AutoSize = true; - this.labelQuestion.Location = new System.Drawing.Point(12, 9); - this.labelQuestion.Name = "labelQuestion"; - this.labelQuestion.Size = new System.Drawing.Size(510, 13); - this.labelQuestion.TabIndex = 2; - this.labelQuestion.Text = "Do you want to automatically generate (filterTree 🡢 directoryTree) directories f" + - "or:"; + labelQuestion.Location = new System.Drawing.Point(12, 9); + labelQuestion.Name = "labelQuestion"; + labelQuestion.Size = new System.Drawing.Size(510, 13); + labelQuestion.TabIndex = 2; + labelQuestion.Text = "Do you want to automatically generate (filterTree 🡢 directoryTree) directories for:"; // // labelInfoProject2 // - this.labelInfoProject2.AutoSize = true; - this.labelInfoProject2.Location = new System.Drawing.Point(103, 31); - this.labelInfoProject2.Name = "labelInfoProject2"; - this.labelInfoProject2.Size = new System.Drawing.Size(31, 13); - this.labelInfoProject2.TabIndex = 2; - this.labelInfoProject2.Text = "name"; + labelInfoProject2.AutoSize = true; + labelInfoProject2.Location = new System.Drawing.Point(103, 31); + labelInfoProject2.Name = "labelInfoProject2"; + labelInfoProject2.Size = new System.Drawing.Size(31, 13); + labelInfoProject2.TabIndex = 2; + labelInfoProject2.Text = "name"; // // labelQuestionMark // - this.labelQuestionMark.AutoSize = true; - this.labelQuestionMark.Font = new System.Drawing.Font("Consolas", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelQuestionMark.Location = new System.Drawing.Point(6, 8); - this.labelQuestionMark.Name = "labelQuestionMark"; - this.labelQuestionMark.Size = new System.Drawing.Size(39, 43); - this.labelQuestionMark.TabIndex = 2; - this.labelQuestionMark.Text = "?"; + labelQuestionMark.Font = new System.Drawing.Font("Consolas", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + labelQuestionMark.Location = new System.Drawing.Point(6, 8); + labelQuestionMark.Name = "labelQuestionMark"; + labelQuestionMark.Size = new System.Drawing.Size(39, 43); + labelQuestionMark.TabIndex = 2; + labelQuestionMark.Text = "?"; // - // labelInfoFroject + // labelInfoProject // - this.labelInfoFroject.AutoSize = true; - this.labelInfoFroject.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoFroject.Location = new System.Drawing.Point(24, 31); - this.labelInfoFroject.Name = "labelInfoFroject"; - this.labelInfoFroject.Size = new System.Drawing.Size(55, 13); - this.labelInfoFroject.TabIndex = 2; - this.labelInfoFroject.Text = "project:"; + labelInfoProject.AutoSize = true; + labelInfoProject.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoProject.Location = new System.Drawing.Point(24, 31); + labelInfoProject.Name = "labelInfoFroject"; + labelInfoProject.Size = new System.Drawing.Size(55, 13); + labelInfoProject.TabIndex = 2; + labelInfoProject.Text = "project:"; + labelInfoProject.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoCalculate2 // - this.labelInfoCalculate2.AutoSize = true; - this.labelInfoCalculate2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoCalculate2.Location = new System.Drawing.Point(103, 86); - this.labelInfoCalculate2.Name = "labelInfoCalculate2"; - this.labelInfoCalculate2.Size = new System.Drawing.Size(73, 13); - this.labelInfoCalculate2.TabIndex = 2; - this.labelInfoCalculate2.Text = "rootFilter:"; + labelInfoCalculate2.AutoSize = true; + labelInfoCalculate2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoCalculate2.Location = new System.Drawing.Point(103, 86); + labelInfoCalculate2.Name = "labelInfoCalculate2"; + labelInfoCalculate2.Size = new System.Drawing.Size(73, 13); + labelInfoCalculate2.TabIndex = 2; + labelInfoCalculate2.Text = "rootFilter:"; + labelInfoCalculate2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut2 // - this.labelInfoOut2.AutoSize = true; - this.labelInfoOut2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoOut2.Location = new System.Drawing.Point(121, 108); - this.labelInfoOut2.Name = "labelInfoOut2"; - this.labelInfoOut2.Size = new System.Drawing.Size(55, 13); - this.labelInfoOut2.TabIndex = 2; - this.labelInfoOut2.Text = "rootDir:"; + labelInfoOut2.AutoSize = true; + labelInfoOut2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoOut2.Location = new System.Drawing.Point(121, 108); + labelInfoOut2.Name = "labelInfoOut2"; + labelInfoOut2.Size = new System.Drawing.Size(55, 13); + labelInfoOut2.TabIndex = 2; + labelInfoOut2.Text = "rootDir:"; + labelInfoOut2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut3 // - this.labelInfoOut3.AutoSize = true; - this.labelInfoOut3.Location = new System.Drawing.Point(200, 108); - this.labelInfoOut3.Name = "labelInfoOut3"; - this.labelInfoOut3.Size = new System.Drawing.Size(31, 13); - this.labelInfoOut3.TabIndex = 2; - this.labelInfoOut3.Text = "name"; + labelInfoOut3.AutoSize = true; + labelInfoOut3.Location = new System.Drawing.Point(200, 108); + labelInfoOut3.Name = "labelInfoOut3"; + labelInfoOut3.Size = new System.Drawing.Size(31, 13); + labelInfoOut3.TabIndex = 2; + labelInfoOut3.Text = "name"; // // labelInfoCalculate3 // - this.labelInfoCalculate3.AutoSize = true; - this.labelInfoCalculate3.Location = new System.Drawing.Point(200, 86); - this.labelInfoCalculate3.Name = "labelInfoCalculate3"; - this.labelInfoCalculate3.Size = new System.Drawing.Size(31, 13); - this.labelInfoCalculate3.TabIndex = 2; - this.labelInfoCalculate3.Text = "name"; + labelInfoCalculate3.AutoSize = true; + labelInfoCalculate3.Location = new System.Drawing.Point(200, 86); + labelInfoCalculate3.Name = "labelInfoCalculate3"; + labelInfoCalculate3.Size = new System.Drawing.Size(31, 13); + labelInfoCalculate3.TabIndex = 2; + labelInfoCalculate3.Text = "name"; // // labelWarning // - this.labelWarning.AutoSize = true; - this.labelWarning.Location = new System.Drawing.Point(12, 165); - this.labelWarning.Name = "labelWarning"; - this.labelWarning.Size = new System.Drawing.Size(73, 13); - this.labelWarning.TabIndex = 2; - this.labelWarning.Text = "Warning: "; + labelWarning.Location = new System.Drawing.Point(12, 165); + labelWarning.Name = "labelWarning"; + labelWarning.Size = new System.Drawing.Size(73, 13); + labelWarning.TabIndex = 2; + labelWarning.Text = "Warning: "; // // groupBoxQuestion // - this.groupBoxQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxQuestion.Controls.Add(this.buttonYes); - this.groupBoxQuestion.Controls.Add(this.labelQuestionMark); - this.groupBoxQuestion.Location = new System.Drawing.Point(437, 230); - this.groupBoxQuestion.Name = "groupBoxQuestion"; - this.groupBoxQuestion.Size = new System.Drawing.Size(154, 56); - this.groupBoxQuestion.TabIndex = 30; - this.groupBoxQuestion.TabStop = false; + groupBoxQuestion.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + groupBoxQuestion.Controls.Add(buttonYes); + groupBoxQuestion.Controls.Add(labelQuestionMark); + groupBoxQuestion.Location = new System.Drawing.Point(437, 230); + groupBoxQuestion.Name = "groupBoxQuestion"; + groupBoxQuestion.Size = new System.Drawing.Size(154, 56); + groupBoxQuestion.TabIndex = 30; + groupBoxQuestion.TabStop = false; // // labelWarning2 // - this.labelWarning2.AutoSize = true; - this.labelWarning2.Location = new System.Drawing.Point(82, 165); - this.labelWarning2.Name = "labelWarning2"; - this.labelWarning2.Size = new System.Drawing.Size(349, 13); - this.labelWarning2.TabIndex = 4; - this.labelWarning2.Text = "1. Please save the project before using this extension."; + labelWarning2.Location = new System.Drawing.Point(82, 165); + labelWarning2.Name = "labelWarning2"; + labelWarning2.Size = new System.Drawing.Size(349, 13); + labelWarning2.TabIndex = 4; + labelWarning2.Text = "1. Please save the project before using this extension."; // // labelWarning3 // - this.labelWarning3.AutoSize = true; - this.labelWarning3.Location = new System.Drawing.Point(82, 182); - this.labelWarning3.Name = "labelWarning3"; - this.labelWarning3.Size = new System.Drawing.Size(349, 13); - this.labelWarning3.TabIndex = 5; - this.labelWarning3.Text = "If results are not adequate, close project without saving"; + labelWarning3.Location = new System.Drawing.Point(82, 182); + labelWarning3.Name = "labelWarning3"; + labelWarning3.Size = new System.Drawing.Size(349, 13); + labelWarning3.TabIndex = 5; + labelWarning3.Text = "If results are not adequate, close project without saving"; // // labelInfoIn // - this.labelInfoIn.AutoSize = true; - this.labelInfoIn.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoIn.Location = new System.Drawing.Point(54, 64); - this.labelInfoIn.Name = "labelInfoIn"; - this.labelInfoIn.Size = new System.Drawing.Size(25, 13); - this.labelInfoIn.TabIndex = 6; - this.labelInfoIn.Text = "in:"; + labelInfoIn.AutoSize = true; + labelInfoIn.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoIn.Location = new System.Drawing.Point(54, 64); + labelInfoIn.Name = "labelInfoIn"; + labelInfoIn.Size = new System.Drawing.Size(25, 13); + labelInfoIn.TabIndex = 6; + labelInfoIn.Text = "in:"; + labelInfoIn.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoCalculate // - this.labelInfoCalculate.AutoSize = true; - this.labelInfoCalculate.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoCalculate.Location = new System.Drawing.Point(12, 86); - this.labelInfoCalculate.Name = "labelInfoCalculate"; - this.labelInfoCalculate.Size = new System.Drawing.Size(67, 13); - this.labelInfoCalculate.TabIndex = 7; - this.labelInfoCalculate.Text = "calculate:"; + labelInfoCalculate.AutoSize = true; + labelInfoCalculate.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoCalculate.Location = new System.Drawing.Point(12, 86); + labelInfoCalculate.Name = "labelInfoCalculate"; + labelInfoCalculate.Size = new System.Drawing.Size(67, 13); + labelInfoCalculate.TabIndex = 7; + labelInfoCalculate.Text = "calculate:"; + labelInfoCalculate.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoOut // - this.labelInfoOut.AutoSize = true; - this.labelInfoOut.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoOut.Location = new System.Drawing.Point(48, 108); - this.labelInfoOut.Name = "labelInfoOut"; - this.labelInfoOut.Size = new System.Drawing.Size(31, 13); - this.labelInfoOut.TabIndex = 8; - this.labelInfoOut.Text = "out:"; + labelInfoOut.AutoSize = true; + labelInfoOut.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + labelInfoOut.Location = new System.Drawing.Point(48, 108); + labelInfoOut.Name = "labelInfoOut"; + labelInfoOut.Size = new System.Drawing.Size(31, 13); + labelInfoOut.TabIndex = 8; + labelInfoOut.Text = "out:"; + labelInfoOut.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelInfoIn2 // - this.labelInfoIn2.AutoSize = true; - this.labelInfoIn2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelInfoIn2.Location = new System.Drawing.Point(200, 64); - this.labelInfoIn2.Name = "labelInfoIn2"; - this.labelInfoIn2.Size = new System.Drawing.Size(97, 13); - this.labelInfoIn2.TabIndex = 9; - this.labelInfoIn2.Text = "project whole"; + labelInfoIn2.AutoSize = true; + labelInfoIn2.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + labelInfoIn2.Location = new System.Drawing.Point(200, 64); + labelInfoIn2.Name = "labelInfoIn2"; + labelInfoIn2.Size = new System.Drawing.Size(97, 13); + labelInfoIn2.TabIndex = 9; + labelInfoIn2.Text = "project whole"; // // labelWarning4 // - this.labelWarning4.AutoSize = true; - this.labelWarning4.Location = new System.Drawing.Point(82, 199); - this.labelWarning4.Name = "labelWarning4"; - this.labelWarning4.Size = new System.Drawing.Size(151, 13); - this.labelWarning4.TabIndex = 10; - this.labelWarning4.Text = "and open last save point"; + labelWarning4.Location = new System.Drawing.Point(82, 199); + labelWarning4.Name = "labelWarning4"; + labelWarning4.Size = new System.Drawing.Size(151, 13); + labelWarning4.TabIndex = 10; + labelWarning4.Text = "and open last save point"; // // labelWarning5 // - this.labelWarning5.AutoSize = true; - this.labelWarning5.Location = new System.Drawing.Point(82, 224); - this.labelWarning5.Name = "labelWarning5"; - this.labelWarning5.Size = new System.Drawing.Size(349, 13); - this.labelWarning5.TabIndex = 11; - this.labelWarning5.Text = "2. #include directives may need to be changed afterward"; + labelWarning5.Location = new System.Drawing.Point(82, 224); + labelWarning5.Name = "labelWarning5"; + labelWarning5.Size = new System.Drawing.Size(349, 13); + labelWarning5.TabIndex = 11; + labelWarning5.Text = "2. #include directives may need to be changed afterward"; // // labelWarning6 // - this.labelWarning6.AutoSize = true; - this.labelWarning6.Location = new System.Drawing.Point(82, 249); - this.labelWarning6.Name = "labelWarning6"; - this.labelWarning6.Size = new System.Drawing.Size(295, 13); - this.labelWarning6.TabIndex = 12; - this.labelWarning6.Text = "3. this extension will access your fileSystem:"; + labelWarning6.Location = new System.Drawing.Point(82, 249); + labelWarning6.Name = "labelWarning6"; + labelWarning6.Size = new System.Drawing.Size(295, 13); + labelWarning6.TabIndex = 12; + labelWarning6.Text = "3. this extension will access your fileSystem:"; // // labelWarning7 // - this.labelWarning7.AutoSize = true; - this.labelWarning7.Location = new System.Drawing.Point(82, 266); - this.labelWarning7.Name = "labelWarning7"; - this.labelWarning7.Size = new System.Drawing.Size(337, 13); - this.labelWarning7.TabIndex = 13; - this.labelWarning7.Text = "move project files, create and delete empty directories"; + labelWarning7.Location = new System.Drawing.Point(82, 266); + labelWarning7.Name = "labelWarning7"; + labelWarning7.Size = new System.Drawing.Size(337, 13); + labelWarning7.TabIndex = 13; + labelWarning7.Text = "move project files, create and delete empty directories"; // // formQuestionFtd // - this.AcceptButton = this.buttonYes; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(599, 293); - this.Controls.Add(this.labelWarning7); - this.Controls.Add(this.labelWarning6); - this.Controls.Add(this.labelWarning5); - this.Controls.Add(this.labelWarning4); - this.Controls.Add(this.labelInfoIn2); - this.Controls.Add(this.labelInfoOut); - this.Controls.Add(this.labelInfoCalculate); - this.Controls.Add(this.labelInfoIn); - this.Controls.Add(this.labelWarning3); - this.Controls.Add(this.labelWarning2); - this.Controls.Add(this.groupBoxQuestion); - this.Controls.Add(this.labelWarning); - this.Controls.Add(this.labelInfoCalculate3); - this.Controls.Add(this.labelInfoOut3); - this.Controls.Add(this.labelInfoOut2); - this.Controls.Add(this.labelInfoCalculate2); - this.Controls.Add(this.labelInfoFroject); - this.Controls.Add(this.labelInfoProject2); - this.Controls.Add(this.labelQuestion); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "formQuestionFtd"; - this.groupBoxQuestion.ResumeLayout(false); - this.groupBoxQuestion.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AcceptButton = buttonYes; + AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(599, 293); + Controls.Add(labelWarning7); + Controls.Add(labelWarning6); + Controls.Add(labelWarning5); + Controls.Add(labelWarning4); + Controls.Add(labelInfoIn2); + Controls.Add(labelInfoOut); + Controls.Add(labelInfoCalculate); + Controls.Add(labelInfoIn); + Controls.Add(labelWarning3); + Controls.Add(labelWarning2); + Controls.Add(groupBoxQuestion); + Controls.Add(labelWarning); + Controls.Add(labelInfoCalculate3); + Controls.Add(labelInfoOut3); + Controls.Add(labelInfoOut2); + Controls.Add(labelInfoCalculate2); + Controls.Add(labelInfoProject); + Controls.Add(labelInfoProject2); + Controls.Add(labelQuestion); + DoubleBuffered = true; + Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); + MaximizeBox = false; + Name = "formQuestionFtd"; + groupBoxQuestion.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -298,7 +295,7 @@ private void InitializeComponent() private System.Windows.Forms.Label labelQuestionMark; public System.Windows.Forms.Label labelQuestion; public System.Windows.Forms.Label labelInfoProject2; - public System.Windows.Forms.Label labelInfoFroject; + public System.Windows.Forms.Label labelInfoProject; public System.Windows.Forms.Label labelInfoCalculate2; public System.Windows.Forms.Label labelInfoOut2; public System.Windows.Forms.Label labelInfoOut3; diff --git a/source/shared/project/source/gui/questionFtd.cs b/source/shared/project/source/gui/questionFtd.cs index 0b107b1..f1e05f3 100644 --- a/source/shared/project/source/gui/questionFtd.cs +++ b/source/shared/project/source/gui/questionFtd.cs @@ -7,10 +7,12 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using u; +using u.forms.form; namespace VisualStudioCppExtensions { - public partial class formQuestionFtd : Form + public partial class formQuestionFtd : form2 { public enum Result { @@ -28,6 +30,7 @@ public formQuestionFtd() int x = this.Height; MinimumSize = new Size(Width, Height); MaximumSize = new Size(Width * 10, Height); + this.xScale(); } diff --git a/source/shared/project/source/gui/questionFtd.resx b/source/shared/project/source/gui/questionFtd.resx index 0fb6fcd..4ea154e 100644 --- a/source/shared/project/source/gui/questionFtd.resx +++ b/source/shared/project/source/gui/questionFtd.resx @@ -1,64 +1,4 @@ - - - + diff --git a/source/shared/project/source/other/test/other.cs b/source/shared/project/source/other/test/other.cs index bc117ab..216a0ba 100644 --- a/source/shared/project/source/other/test/other.cs +++ b/source/shared/project/source/other/test/other.cs @@ -11,6 +11,7 @@ using System.Reflection; using System.Text; using System.Linq; +using u.other; diff --git a/source/shared/project/source/other/using.cs b/source/shared/project/source/other/using.cs new file mode 100644 index 0000000..ccae6a1 --- /dev/null +++ b/source/shared/project/source/other/using.cs @@ -0,0 +1,2051 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using u.other; + + + + + + +namespace u.forms.form +{ + public class form2 : Form + { + [DllImport("user32.dll", EntryPoint = "MoveWindow")] private static extern bool MoveWindow(nint id, int x, int y, int x2, int y2, bool repaint); + protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) //clientSize, formBorderStyle, scaleControl, size, showDialog + { + base.SetBoundsCore(x, y, width, height, specified); + if (this.Width != width || this.Height != height) + MoveWindow(this.Handle, x, y, width, height, true); + + /*Size s1 = this.Size; + Size s2 = this.ClientSize; + + SizeF s3 = this.AutoScaleDimensions; + SizeF s4 = this.CurrentAutoScaleDimensions; + var s5 = this.AutoScaleBaseSize; + SizeF s6 = this.AutoScaleFactor; + var s7 = this.AutoScaleMode; + + int s8 = this.DeviceDpi;*/ + + //SystemInformation.dpi + //var s9 = Application.HighDpiMode; + } + + + + + + + + + + + + + + + + + + + + + + + protected override void ScaleControl(SizeF factor, BoundsSpecified specified) //scale, //resumeLayout + { + base.ScaleControl(factor, specified); + } + + protected override void ScaleCore(float x, float y) + { + base.ScaleCore(x, y); + } + + /*protected override void ScaleMinMaxSize(float xScaleFactor, float yScaleFactor, bool updateContainerSize = true) + { + base.ScaleMinMaxSize(xScaleFactor, yScaleFactor, updateContainerSize); + }*/ + + protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified) //getScaledBounds //scaleControl + { + return base.GetScaledBounds(bounds, factor, specified); + } + + + + + + + + + + + + + + + + + + + + + + + + + + protected override void OnDpiChanged(DpiChangedEventArgs e) //dpi + { + base.OnDpiChanged(e); + } + + protected override void OnDpiChangedAfterParent(EventArgs e) + { + base.OnDpiChangedAfterParent(e); + } + + protected override void OnDpiChangedBeforeParent(EventArgs e) + { + base.OnDpiChangedBeforeParent(e); + } + + protected override bool OnGetDpiScaledSize(int deviceDpiOld, int deviceDpiNew, ref Size desiredSize) + { + return base.OnGetDpiScaledSize(deviceDpiOld, deviceDpiNew, ref desiredSize); + } + + protected override void RescaleConstantsForDpi(int deviceDpiOld, int deviceDpiNew) + { + base.RescaleConstantsForDpi(deviceDpiOld, deviceDpiNew); + } + + + + + + + + + + + + + + + + + public form2() + { + Size x = new(7000, 7000); + this.MaximumSize = x; + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.forms.label +{ + public class labelAlign : Label //label + { + public labelAlign() + { + base.AutoSize = false; + this.SetStyle(/*ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque |*/ ControlStyles.OptimizedDoubleBuffer /*| ControlStyles.UserPaint*/, true); + } + + + + public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = false; } + + + + + + + + + + + private class Data + { + public string text; + public bool text2; + } + private Data d = new(); + + + + + + + public override ContentAlignment TextAlign + { + get => base.TextAlign; + + set + { + base.TextAlign = value; + + if (d == null) return; + if (d.text2) { var d2 = d.text; d = null; base.Text = d2; } + d = null; + } + } + + + + + + + bool textIn; + public override string Text + { + get => (d?.text2).x() ? d.text : base.Text; + + set + { + if (d != null) + { + d.text = value; + d.text2 = true; + return; + } + + + base.Text = value; + + if (textIn) return; + textIn = true; + this.xText(); + textIn = false; + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.forms +{ + public static partial class xCommon + { + public static void xText(this Label x, string x2 = null) //label + { + if (x == null) return; + + x.Text = x2 ??= x.Text; + + + + + + //using StringFormat s = u.forms.other.stringFormat.x2; + using var g = x.CreateGraphics(); + //g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + + //SizeF x3 = (x2 != null) ? g.MeasureString(x2 + 'x', x.Font, 0, s) : new(); + + + SizeF x3 = (x2 != null) ? TextRenderer.MeasureText(g, x2 /*+ 'x'*/, x.Font, new(), TextFormatFlags.SingleLine | TextFormatFlags.NoClipping /*| TextFormatFlags.NoPadding*/ | TextFormatFlags.NoPrefix | TextFormatFlags.PreserveGraphicsTranslateTransform) : new(); + + + + + //if (x3.Height != 0) x3.Height += 5; + //x3 = x3.xDiv(new(96.0f / g.DpiX, 96.0f / g.DpiY)); + Size x4 = x3.xSize() - x.Size; + Size x5 = x4.xMul(0.5); + + + + if ((x.TextAlign & (ContentAlignment.BottomCenter | ContentAlignment.MiddleCenter | ContentAlignment.TopCenter)) != 0) //x + x.Left -= x5.Width; + + if ((x.TextAlign & (ContentAlignment.BottomRight | ContentAlignment.MiddleRight | ContentAlignment.TopRight)) != 0) + x.Left -= x4.Width; + + if ((x.TextAlign & (ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight)) != 0) //y + x.Top -= x5.Height; + + if ((x.TextAlign & (ContentAlignment.BottomLeft | ContentAlignment.BottomCenter | ContentAlignment.BottomRight)) != 0) + x.Top -= x4.Height; + + x.Size = x3.xSize(); + + //x.BackColor = System.Drawing.Color.BlueViolet; + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.forms.table +{ + public class dataGridView2 : DataGridView //dataGridView + { + public dataGridView2() => this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); + } +} + + + + + + + + + + + + + +namespace u.forms.textBox +{ + public class textBox2 : TextBox //textBox + { + public textBox2() + { + this.SetStyle(/*ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque |*/ ControlStyles.OptimizedDoubleBuffer /*| ControlStyles.UserPaint*/, true); + this.AutoSize = false; + } + + public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = false; } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.forms.other +{ + public class stringFormat + { + public static StringFormat x + { + get + { + StringFormat s = StringFormat.GenericTypographic; + s.Trimming = StringTrimming.Character; + s.FormatFlags &= ~(StringFormatFlags.FitBlackBox | StringFormatFlags.LineLimit | StringFormatFlags.NoClip); + s.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; + return s; + } + } + + public static StringFormat x2 + { + get + { + StringFormat s = StringFormat.GenericDefault; + s.Trimming = StringTrimming.Character; + s.FormatFlags &= ~(StringFormatFlags.FitBlackBox | StringFormatFlags.LineLimit | StringFormatFlags.NoClip); + s.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; + return s; + } + } + } + + + + + + + + + + + + + + + + + + + + public class p //common + { + public static Font font9b = new Font("Consolas", 9.0f, FontStyle.Bold, GraphicsUnit.Point); + public static Font font9 = new Font("Consolas", 9.0f, FontStyle.Regular, GraphicsUnit.Point); + + public static Font font8b = new Font("Consolas", 8.0f, FontStyle.Bold, GraphicsUnit.Point); + public static Font font8 = new Font("Consolas", 8.0f, FontStyle.Regular, GraphicsUnit.Point); + + public static Font font7b = new Font("Consolas", 7.0f, FontStyle.Bold, GraphicsUnit.Point); + public static Font font7 = new Font("Consolas", 7.0f, FontStyle.Regular, GraphicsUnit.Point); + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.forms +{ + public class S + { + private static S s; //static + public static S s2 => s ??= new(); + + + + + + + + + + + + + + + + + public class data //data + { + public double x0; + public double x = 1; //Screen.PrimaryScreen.Bounds.Height //System.Windows.SystemParameters.PrimaryScreenWidth - scaled, by onece per run + public double xDpiD0; + //public double xDpiD; + public void xInit(double x, double xDpiD = 96.0) { x0 = x; this.xDpiD0 = xDpiD; } + public bool xCheck => xCheck2 && xDpiD0 == (/*xDpiD =*/ dpiD()); + public bool xCheck2 => (x = ((double)Screen.PrimaryScreen.Bounds.Height) / x0) == 1.0; + + + + + //public Dictionary> x2 = new(); + public HashSet x2 = new(); + + + + + + //int cu\control panel\desktop\logPixels + //int cu\control panel\desktop\win8DpiScaling [0, 1] p2 + //int cu\control panel\desktop\windowMetrics\appliedDpi - win10, (sign) + //string cu\software\microsoft\windows\currentVersion\themeManager\lastLoadedDpi (sign) + public double dpiC + { + get + { + var r = Registry.CurrentUser; + + object f(string x, string x2, Type x3) + { + var r2 = r.OpenSubKey(x); + object v = r2?.GetValue(x2); + if (v == null) return v; + if (v.GetType() != x3) return null; + return v; + } + + object v = f("control panel\\desktop\\windowMetrics", "appliedDpi", typeof(int)); + if (v != null) return (int)v; + + if (int.TryParse((string)f("software\\microsoft\\windows\\currentVersion\\themeManager", "lastLoadedDpi", typeof(string)), out int v2)) + return v2; + + v = f("control panel\\desktop", "logPixels", typeof(int)); + if (v != null) return (int)v; + + return 96.0; + } + } + + public double dpiG(Control x = null) + { + x ??= new(); + using var g = x.CreateGraphics(); + return g.DpiY; + } + + public double dpiD(Control x = null) => (x ?? new()).DeviceDpi; + } + public data d = new(); + + + + + + + + + + + + + + + + + + + + + + + + + + + public class value + { + public S s; + + + + //public T i(T x) where T : struct => check ? x : (T)((double)x * this.x); + + public int i(int x) => s.d.xCheck ? x : (int)Math.Round(x * s.d.x); + public float f(float x) => s.d.xCheck ? x : (float)(x * s.d.x); + public double d(double x) => s.d.xCheck ? x : (double)(x * s.d.x); + + + + + public Font f(Font x, double dpiG = 96.0) + { + if (s.d.xCheck) return x; + + double x0 = s.d.x; + //if (!s.d.x2.TryGetValue(x0, out HashSet x3)) + //s.d.x2.Add(x0, x3 = new()); + var x3 = s.d.x2; + + + Font f2() + { + Font x2 = new Font(x.FontFamily, (float)Math.Floor((double)x.Size * x0 * 96.0 / dpiG), x.Style, x.Unit, x.GdiCharSet, x.GdiVerticalFont); + x3.Add(x2); + return x2; + } + + return x3.Contains(x) ? x : f2(); + } + + + + + public Point f(Point x) => s.d.xCheck ? x : new(x.X.xScale(), x.Y.xScale()); + public Size f(Size x) => s.d.xCheck ? x : new(x.Width.xScale(), x.Height.xScale()); + public Padding f(Padding x) => s.d.xCheck ? x : new(x.Left.xScale(), x.Top.xScale(), x.Right.xScale(), x.Bottom.xScale()); + } + public value v = new(); + + public S() => v.s = this; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + public void scale(Control x) + { + if (d.xCheck) return; //padding, margin, autoSize, autoScale, anchor, (dock) + + + d.x2 = new(); //init + { + //using var g = x.CreateGraphics(); + //var g1 = g.DpiX; + //var g2 = g.DpiY; + //var g3 = g.GetDpiContext(); + } + + + + + IContainer f3(object x) => (IContainer)x.GetType().GetField("components", System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.NonPublic).GetValue(x); + + Dictionary x2 = new(); + void f(Control c) + { + x2.TryAdd(c, (c.Location, (c is Form c3) ? c3.Size : c.Size, (c is Form c4) ? c4.ClientSize : c.ClientSize, c.MinimumSize, c.MaximumSize, c.Padding, c.Margin)); + + foreach (Control c2 in c.Controls) + f(c2); + + { + if (c is Form c2) + { + var x3 = f3(c2)?.Components; + if (x3 != null) + foreach (var x4 in x3) + if (x4 is Control x5) + f(x5); + } + } + + //c.AutoSize = false; + } + f(x); + //f(x); + + + + + + + + void f2(Control c) + { + { + if (!x2.TryGetValue(c, out var x3)) return; + + /*{ + var dpiC = d.dpiC; + var dpiG = c.xDpiG(); + var dpiD = c.xDpiD(); + }*/ + + c.SuspendLayout(); + + + + + + var a = c.Anchor; + c.Anchor = AnchorStyles.Top | AnchorStyles.Left; + + + var a2 = c.AutoSize; + c.AutoSize = false; //form, label, textBox + //ContentAlignment a3 = 0; + //if (c is Label cl) { a3 = cl.TextAlign; cl.TextAlign = ContentAlignment.TopLeft; } + if (c is Form c3) c3.AutoScaleMode = AutoScaleMode.None; + //if (d.xCheck2) goto exit2; + + + + + + { + Size s2 = x3.s - x3.s2; + //Size s2x = s2.xMul(d.dpiC / 96.0); //size + Size f3(Size s) + { + Size s3 = (s - s2).xScale() + s2; + if (s.Width == 0 || s3.Width < 0) s3.Width = 0; + if (s.Height == 0 || s3.Height < 0) s3.Height = 0; + return s3; + } + + + c.MaximumSize = f3(x3.sMax); + c.MinimumSize = f3(x3.sMin); + + c.Padding = x3.sPadding.xScale(); + c.Margin = x3.sMargin.xScale(); + + + c.Location = x3.x.xScale(); + + if (c is Form c2) + { + //c2.ClientSize = x3.s2.xScale(); + c2.Size = f3(x3.s); + } + else + c.Size = x3.s.xScale(); + } + + + //exit2: + c.Font = c.Font.xScale(c.xDpiG()); + if (c is Label cl2) { /*cl2.TextAlign = a3;*/ cl2.xText(); } + + c.Anchor = a; + c.AutoSize = a2; + } + + + + + + + + + if (c is SplitContainer) //splitContainer.distance + { + SplitContainer x2 = (SplitContainer)c; + bool f2() + { + foreach (Control x3 in x2.Panel1.Controls) + if (x3.Dock == DockStyle.Fill) return false; + return true; + } + if (f2()) + x2.SplitterDistance = x2.SplitterDistance.xScale(); + } + + + + + + + + + //if (c is RadioButton) goto exit; + //if (c is CheckBox) goto exit; + + + foreach (Control c2 in c.Controls) //controls + f2(c2); + + { + if (c is Form c2) //components + { + var x3 = f3(c2)?.Components; + if (x3 != null) + foreach (var x4 in x3) + if (x4 is Control x5) + f2(x5); + } + } + + + //exit: + c.ResumeLayout(false); + } + + f2(x); + x.Invalidate(true); + } + + + + + + + + + /*public interface iScale + { + public IContainer container => (IContainer)this.GetType().GetField("components", System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.NonPublic).GetValue(this); + }*/ + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u //extensions +{ + public static partial class xCommon + { + public static int xScale(this int x) => u.forms.S.s2.v.i(x); //int + public static float xScale(this float x) => u.forms.S.s2.v.f(x); //float + public static double xScale(this double x) => u.forms.S.s2.v.d(x); //double + + + public static Font xScale(this Font x, double x2 = 96.0) => u.forms.S.s2.v.f(x, x2); //font + + + public static Point xScale(this Point x) => u.forms.S.s2.v.f(x); //point + public static Size xScale(this Size x) => u.forms.S.s2.v.f(x); //size + public static Padding xScale(this Padding x) => u.forms.S.s2.v.f(x); //padding + + + public static void xScale(this Control x) => u.forms.S.s2.scale(x); //control + public static double xDpiG(this Control x) => u.forms.S.s2.d.dpiG(x); + public static double xDpiD(this Control x) => u.forms.S.s2.d.dpiD(x); + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u +{ + public static partial class xCommon + { + public static bool xE(this string s) => string.IsNullOrEmpty(s); //string + public static bool xE2(this string x) => string.IsNullOrWhiteSpace(x); + + public static string xE(this string s, string s2) => string.IsNullOrEmpty(s) ? "" : s + s2; + + + public static bool xC(this string x, string x2) => string.Equals(x, x2, StringComparison.Ordinal); + public static bool xC2(this string x, string x2) => string.Equals(x, x2, StringComparison.OrdinalIgnoreCase); + + + + + + + + + + + + + + + + + public static string xS(this bool x) => x ? "true" : "false"; //bool + public static string xS2(this bool x) => x ? "true" : ""; + + + + + public static bool x(this bool? x2) => x2 != null && x2 == true; //bool? + + + + + + + + + + + + public static bool xEmpty(this Array x) => x == null || x.Length == 0; //array + + + + + + + + + + + public static void xFor(this IEnumerable x, Action x2) { foreach (T x3 in x) x2(x3); } //collection + + + + + + + + + + + + + + + public static string xS(this Enum x) => x.ToString(); //enum + + + + + /*public static void set(this ref T x, T x2, bool b) where T : struct //p ne menja valueType + { + try + { + Type t = x.GetType(); + TypeCode t2 = Type.GetTypeCode(Enum.GetUnderlyingType(t)); + dynamic y = Convert.ChangeType(x, t2); + dynamic y2 = Convert.ChangeType(x2, t2); + if (b) + y |= y2; + else + y &= ~y2; + x = (T)y; + } + catch(Exception e) + { + + } + }*/ + + /*public static bool get(this Enum x, Enum x2) + { + try + { + TypeCode t = Type.GetTypeCode(Enum.GetUnderlyingType(x.GetType())); //popraviti da li dynamic usporava + dynamic y = Convert.ChangeType(x, t); + dynamic y2 = Convert.ChangeType(x2, t); + if (y2 == 0) return y == y2; + return (y & y2) == y2; + } + catch (Exception e) + { + return true; + } + }*/ + + + + + + + + + + + + + + + + + + + + + + + + public static Size xMul(this Size x, double x2) //size + { + x.Width = (int)(x.Width * x2); + x.Height = (int)(x.Height * x2); + return x; + } + + + + + + + + public static Size xSize(this SizeF x) //sizeF + { + Size x2 = new(); + x2.Width = (int)Math.Ceiling(x.Width); + x2.Height = (int)Math.Ceiling(x.Height); + return x2; + } + + public static SizeF xDiv(this SizeF x, SizeF x2) + { + x.Width /= x2.Width; + x.Height /= x2.Height; + return x; + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u +{ + public static partial class xCommon + { + + + public static bool TryAdd(this IDictionary dictionary, TKey key, TValue value) + { + if (dictionary == null) + { + throw new ArgumentNullException(nameof(dictionary)); + } + + if (!dictionary.ContainsKey(key)) + { + dictionary.Add(key, value); + return true; + } + + return false; + } + + + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace u.other +{ + + + public class path + { + public string x; + public string[] x2; + + + + public class separator + { + public char[] s = ss; + public char s2 = ss2; + + public static char[] ss = new char[] { System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar }; + public static char ss2 = System.IO.Path.DirectorySeparatorChar; + public static separator sDefault = new() { s = new char[] { '\\', '/' }, s2 = '\\' }; + } + public separator s = new(); + + + + + + + + + + + + + public path(string x = null, separator s = null) + { + this.s = s ?? new(); + if (x != null) init(x); + } + + public path(string[] x2, separator s = null) + { + this.s = s ?? new(); + this.x2 = x2; + if (x2 != null) xJoin(); + } + + + private path init(string x) + { + x2 = new string[0]; + if (x != null) + x2 = x.Split(s.s, StringSplitOptions.RemoveEmptyEntries).Select(x3 => x3.Trim()).Where(x3 => !x3.xE2()).ToArray(); + xJoin(); + + return this; + } + + + + + + + + + + + + + + + + + public string xJoin() => x = string.Join(s.s2.ToString(), x2); + + + + + + + + + + + + + + + + public string sLast { get => x2.xEmpty() ? null : x2[x2.Length - 1]; } + public int count { get => x2.xEmpty() ? 0 : x2.Length; } + + + + + + + + + + + + + + + public static path operator +(path x1, path x2) => path.oPlus(x1, x2); + public static path operator +(path x1, string x2) => path.oPlus(x1, x2); + public static path operator -(path x1, path x2) => path.oMinus(x1, x2); + public static path operator *(path x1, path x2) => path.oCommon(x1, x2); + /*public static bool operator ==(path x1, path x2) => path.oEqual(x1, x2); + public static bool operator !=(path x1, path x2) => !path.oEqual(x1, x2);*/ + + + public static path oPlus(path x1, path x2, separator s = null) + { + if (x1.xNull()) return null; + if (x2.xNull()) return null; + if (s == null) s = new separator(); + + return new path(x1.x2.Concat(x2.x2).ToArray(), s); + } + + public static path oPlus(path x1, string x2, separator s = null) + { + if (x1.xNull()) return null; + if (x2.xE2()) return new path(x1.x2, x1.s); //clone + if (s == null) s = new separator(); + + return new path(x1.x2.Append(x2).ToArray(), s); + } + + + + public static path oMinus(path x1, path x2, separator s = null) + { + if (x1.xNull()) return null; + if (x2.xNull()) return null; + if (s == null) s = new separator(); + + if (!(x1.x2.Length >= x2.x2.Length)) return null; + + for (int i = 0; i < x2.x2.Length; i++) + if (string.Compare(x1.x2[i], x2.x2[i], StringComparison.OrdinalIgnoreCase) != 0) return null; + + return new path(x1.x2.Skip(x2.x2.Length).ToArray(), s); + } + + + + + + + public static path oCommon(path x1, path x2, separator s = null) //common + { + if (x1.xNull()) return null; //check + if (x2.xNull()) return null; + //s ??= new(); + if (s == null) s = new(); + + + + int i = 0; + { + int i1 = Math.Min(x1.x2.Length, x2.x2.Length); + for (; i < i1; i++) + if (String.Compare(x1.x2[i], x2.x2[i], StringComparison.OrdinalIgnoreCase) != 0) break; + } + + return new path(x1.x2.Take(i).ToArray(), s); + } + + + + + public static path oCommon(string[] p, separator s = null) + { + if (p.xEmpty()) return null; //check + if (s == null) s = new(); + + + + path x = null; + foreach (string p2 in p) + { + if (x == null) + { + x = (new path(p2, s)).mUp(); + continue; + } + x = oCommon(x, new path(p2, s).mUp(), s); + if (x == null) break; + if (x.x2.Length == 0) break; + } + + return x; + } + + + + + + public static bool oEqual(path x1, path x2) + { + bool b1 = !x1.xNull(); + bool b2 = !x2.xNull(); + if (!(b1 || b2)) return true; + if (b1 ^ b2) return false; + return x1.x.xC2(x2.x); + } + + + + + + + public path mUp() + { + if (x2.xEmpty()) return null; + int i = x2.Length - 1; + if (i < 0) return null; + return new path(x2.Take(i).ToArray(), s); + } + + + + + + + + + + + + + + + + + + public override int GetHashCode() => x?.ToLower().GetHashCode() ?? 0; //interface + + public override bool Equals(object x) => x != null && x is path x2 && path.oEqual(this, x2); + + public override string ToString() => x; + } +} + + + + + + + + + + + + + + + + + + + + +namespace u +{ + public static class xPath + { + public static bool xNull(this path x) => x == null || x.x2 == null || x.x == null; //extension + + public static bool xFull(this path x) => !x?.x2.xEmpty() ?? false; + } +} \ No newline at end of file diff --git a/source/shared/project/source/source/main/main.cs b/source/shared/project/source/source/main/main.cs index 70d6e5b..a278dce 100644 --- a/source/shared/project/source/source/main/main.cs +++ b/source/shared/project/source/source/main/main.cs @@ -12,9 +12,6 @@ namespace VisualStudioCppExtensions - - - [Guid(gui.packageGuid)] //tag entry with attributes [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] @@ -27,8 +24,8 @@ public sealed class main : AsyncPackage - //gui - public class gui + + public class gui //gui { public const string packageGuid = "99d03761-6200-41ad-b2a1-638ae9e780e5"; public static readonly Guid groupGuid = new Guid("acd8036f-19ae-43b2-a2d6-11788cb282fe"); @@ -47,6 +44,4 @@ protected override async System.Threading.Tasks.Task InitializeAsync(Cancellatio } - - } diff --git a/source/shared/project/source/source/main/main2.cs b/source/shared/project/source/source/main/main2.cs index 058af2a..c37604d 100644 --- a/source/shared/project/source/source/main/main2.cs +++ b/source/shared/project/source/source/main/main2.cs @@ -16,15 +16,15 @@ internal sealed partial class main2 { - //init main - private readonly Package main; + + private readonly Package main; //init main //private IServiceProvider packageIServiceProvider => this.package; - //init main2 - public static main2 instance { get; private set; } - public static void Initialize(Package main) => instance = new main2(main); + + public static main2 x { get; private set; } //init main2 + public static void Initialize(Package main) => x = new(main); @@ -36,12 +36,11 @@ internal sealed partial class main2 - //int - //adds command handlers (callbacks) for menu.button, commands must exist in the command table file - private main2(Package main) + + + private main2(Package main) //init //add command handlers (callbacks) for menu.button, commands must exist in the command table file { - //init main - if (main == null) throw new ArgumentNullException("package"); + if (main == null) throw new ArgumentNullException("package"); //init main this.main = main; @@ -53,6 +52,9 @@ private main2(Package main) x.AddCommand(new OleMenuCommand(this.buttonClick, null, this.buttonBeforeQueryStatus, new CommandID(VisualStudioCppExtensions.main.gui.groupGuid, VisualStudioCppExtensions.main.gui.buttonId))); x.AddCommand(new OleMenuCommand(this.button2Click, null, this.buttonBeforeQueryStatus, new CommandID(VisualStudioCppExtensions.main.gui.groupGuid, VisualStudioCppExtensions.main.gui.button2Id))); + + + u.forms.S.s2.d.xInit(768.0); } @@ -68,8 +70,16 @@ private main2(Package main) - //callback - void buttonBeforeQueryStatus(object sender, EventArgs e) + + + + + + + + + + void buttonBeforeQueryStatus(object sender, EventArgs e) //callback { ThreadHelper.ThrowIfNotOnUIThread(); OleMenuCommand x = (OleMenuCommand)sender; @@ -78,7 +88,7 @@ void buttonBeforeQueryStatus(object sender, EventArgs e) bool b; try { - b = projectUtility.GetActive().xIsCpp(); + b = projectUtility.pActive().xIsCpp(); } catch (Exception) { @@ -95,9 +105,15 @@ void buttonBeforeQueryStatus(object sender, EventArgs e) - //other - //error box - private void ErrorMessageBox(string m) + + + + + + + + + private void ErrorMessageBox(string m) //other //error box { VsShellUtilities.ShowMessageBox(main, m, diff --git a/source/shared/project/source/source/utility/extension.cs b/source/shared/project/source/source/utility/extension.cs index 1aed5d0..aa4c27a 100644 --- a/source/shared/project/source/source/utility/extension.cs +++ b/source/shared/project/source/source/utility/extension.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/utility/path.cs b/source/shared/project/source/source/utility/path.cs deleted file mode 100644 index d722e94..0000000 --- a/source/shared/project/source/source/utility/path.cs +++ /dev/null @@ -1,261 +0,0 @@ -using Microsoft.VisualStudio.VCProjectEngine; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace VisualStudioCppExtensions -{ - - - public class path - { - public string x; - public string[] x2; - - - - public class Separator - { - public char[] s = ss; - public char s2 = ss2; - - public static char[] ss = new char[] { System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar }; - public static char ss2 = System.IO.Path.DirectorySeparatorChar; - public static Separator sDefault = new path.Separator() { s = new char[] { '\\', '/' }, s2 = '\\' }; - } - public Separator s = new Separator(); - - - - - - - - - - - - - public path(string x = null, Separator s = null) - { - this.s = s ?? new Separator(); - if (x != null) init(x); - } - - public path(string[] x2, Separator s = null) - { - this.s = s ?? new Separator(); - this.x2 = x2; - if (x2 != null) xJoin(); - } - - - public path init(string x) - { - x2 = new string[0]; - if (x != null) - x2 = x.Split(s.s, StringSplitOptions.RemoveEmptyEntries).Select(x3 => x3.Trim()).Where(x3 => !x3.xEmpty()).ToArray(); - xJoin(); - - return this; - } - - - - - - - - - - - - - - - - - public string xJoin() => x = string.Join(s.s2.ToString(), x2); - - - - - - - - - - - - - - - - public string sLast { get => x2.xEmpty() ? null : x2[x2.Length - 1]; } - public int count { get => x2.xEmpty() ? 0 : x2.Length; } - - - - - - - - - - - - - - - public static path operator +(path x1, path x2) => path.oPlus(x1, x2); - public static path operator +(path x1, string x2) => path.oPlus(x1, x2); - public static path operator -(path x1, path x2) => path.oMinus(x1, x2); - public static path operator *(path x1, path x2) => path.oCommon(x1, x2); - /*public static bool operator ==(path x1, path x2) => path.oEqual(x1, x2); - public static bool operator !=(path x1, path x2) => !path.oEqual(x1, x2);*/ - - - public static path oPlus(path x1, path x2, Separator s = null) - { - if (x1.xNull()) return null; - if (x2.xNull()) return null; - if (s == null) s = new Separator(); - - return new path(x1.x2.Concat(x2.x2).ToArray(), s); - } - - public static path oPlus(path x1, string x2, Separator s = null) - { - if (x1.xNull()) return null; - if (x2.xEmpty()) return new path(x1.x2, x1.s); //clone - if (s == null) s = new Separator(); - - return new path(x1.x2.Append(x2).ToArray(), s); - } - - - - public static path oMinus(path x1, path x2, Separator s = null) - { - if (x1.xNull()) return null; - if (x2.xNull()) return null; - if (s == null) s = new Separator(); - - if (!(x1.x2.Length >= x2.x2.Length)) return null; - - for (int i = 0; i < x2.x2.Length; i++) - if (string.Compare(x1.x2[i], x2.x2[i], StringComparison.OrdinalIgnoreCase) != 0) return null; - - return new path(x1.x2.Skip(x2.x2.Length).ToArray(), s); - } - - - - - - - public static path oCommon(path x1, path x2, Separator s = null) - { - //check - if (x1.xNull()) return null; - if (x2.xNull()) return null; - //s ??= new Separator(); - if (s == null) s = new Separator(); - - - - int i = 0; - { - int i1 = Math.Min(x1.x2.Length, x2.x2.Length); - for (; i < i1; i++) - if (String.Compare(x1.x2[i], x2.x2[i], StringComparison.OrdinalIgnoreCase) != 0) break; - } - - return new path(x1.x2.Take(i).ToArray(), s); - } - - - - - //common - public static path oCommon(string[] p, Separator s = null) - { - //check - if (p.xEmpty()) return null; - if (s == null) s = new Separator(); - - - - path x = null; - foreach (string p2 in p) - { - if (x == null) - { - x = (new path(p2, s)).mUp(); - continue; - } - x = oCommon(x, (new path(p2, s)).mUp(), s); - if (x == null) break; - if (x.x2.Length == 0) break; - } - - return x; - } - - - - - - public static bool oEqual(path x1, path x2) - { - bool b1 = !x1.xNull(); - bool b2 = !x2.xNull(); - if (!(b1 || b2)) return true; - if (b1 ^ b2) return false; - return x1.x.xC2(x2.x); - } - - - - - - - - - - - public path mUp() - { - if (x2.xEmpty()) return null; - int i = x2.Length - 1; - if (i < 0) return null; - return new path(x2.Take(i).ToArray(), s); - } - - - - - - - - - - - - - //interface - public override int GetHashCode() => x?.ToLower().GetHashCode() ?? 0; - - public override bool Equals(object x) - { - if (x == null) return false; - if (!(x is path)) return false; - return path.oEqual(this, (path)x); - } - - public override string ToString() => x; - } -} - - diff --git a/source/shared/project/source/source/utility/project.cs b/source/shared/project/source/source/utility/project.cs index 76d414b..07e9171 100644 --- a/source/shared/project/source/source/utility/project.cs +++ b/source/shared/project/source/source/utility/project.cs @@ -12,14 +12,13 @@ namespace VisualStudioCppExtensions { public static class projectUtility { - //dte - public static DTE dte => (DTE)Package.GetGlobalService(typeof(SDTE)); + public static DTE dte => (DTE)Package.GetGlobalService(typeof(SDTE)); //dte - //project active - public static Project GetActive() => GetActive(dte); + + public static Project pActive() => GetActive(dte); //project active public static Project GetActive(DTE dte) @@ -35,8 +34,8 @@ public static Project GetActive(DTE dte) - //project cpp - public static bool xIsCpp(this Project x) + + public static bool xIsCpp(this Project x) //project cpp { return x != null && (x.CodeModel.Language == CodeModelLanguageConstants.vsCMLanguageMC @@ -55,8 +54,8 @@ public static bool xIsCpp(this Project x) - //documents - public static void documentsRefresh() //push document tab lazy open + + public static void documentsRefresh() //documents //push document tab lazy open { foreach (Document x4 in dte.Documents) { } } @@ -76,7 +75,5 @@ public static void documentActivate(string x) //push document tab laz break; } } - - } } diff --git a/source/shared/project/source/source/work/dirToFilter/data.cs b/source/shared/project/source/source/work/dirToFilter/data.cs index 5c1e0df..e1a31ee 100644 --- a/source/shared/project/source/source/work/dirToFilter/data.cs +++ b/source/shared/project/source/source/work/dirToFilter/data.cs @@ -7,6 +7,7 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.VCProjectEngine; using VisualStudioCppExtensions.shared; +using u.other; namespace VisualStudioCppExtensions diff --git a/source/shared/project/source/source/work/dirToFilter/utility/filters.cs b/source/shared/project/source/source/work/dirToFilter/utility/filters.cs index 2c49ed3..40ad576 100644 --- a/source/shared/project/source/source/work/dirToFilter/utility/filters.cs +++ b/source/shared/project/source/source/work/dirToFilter/utility/filters.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using VisualStudioCppExtensions.shared; +using u.other; @@ -76,7 +77,7 @@ public void fDeleteEmpty(Dictionary filesIn, bool fEmptyDelete) public filter fAdd(filter f, string x) { if (x == null) return f; - path x2 = new path(x, path.Separator.sDefault); + path x2 = new path(x, path.separator.sDefault); filter x3 = f; diff --git a/source/shared/project/source/source/work/dirToFilter/work.cs b/source/shared/project/source/source/work/dirToFilter/work.cs index 6cde460..3bcce10 100644 --- a/source/shared/project/source/source/work/dirToFilter/work.cs +++ b/source/shared/project/source/source/work/dirToFilter/work.cs @@ -13,6 +13,8 @@ using System.Linq; using System.Windows.Forms; using System.Drawing; +using u.other; +using u.forms; namespace VisualStudioCppExtensions { @@ -22,41 +24,41 @@ internal sealed partial class main2 - //callback - private void buttonClick(object sender, EventArgs e) + + private void buttonClick(object sender, EventArgs e) //callback { ThreadHelper.ThrowIfNotOnUIThread(); - //prepare - //project - dirToFilter.ProjectData p = new dirToFilter.ProjectData(); + + + dirToFilter.ProjectData p = new(); //prepare //project { - Project x = projectUtility.GetActive(); + Project x = projectUtility.pActive(); - //check 1 project - if (!x.xIsCpp()) { ErrorMessageBox("A C++ project must be selected"); return; } + if (!x.xIsCpp()) { ErrorMessageBox("A C++ project must be selected"); return; } //check 1 project p.p = new shared.Project(x.xProjectVc()); } - //files, filters - p.f.filesGet(p); + + p.f.filesGet(p); //files, filters - //data - { - //in - p.d.i.dir = p.p.dir; - //calculate + + { //data + + p.d.i.dir = p.p.dir; //in + + { - path x2 = path.oCommon(p.f.f.f.a.file.Select(x => x.Key).ToArray()); + path x2 = path.oCommon(p.f.f.f.a.file.Select(x => x.Key).ToArray()); //calculate p.d.c.dir = p.d.c.dirOptionHighest = x2 == null ? "" : x2.x; /*if (p.d.c.dir.xEmpty()) @@ -81,8 +83,7 @@ private void buttonClick(object sender, EventArgs e) - //gui - //check 2 confirm + //gui //check 2 confirm /*if (VsShellUtilities.ShowMessageBox(this.packageIServiceProvider, string.Format("Generate filter per folder for '{0}'?\nExisting filters will be erased", project.UniqueName), string.Empty, @@ -94,27 +95,27 @@ private void buttonClick(object sender, EventArgs e) - //check 2 - formQuestion fq = new formQuestion(); + + formQuestion fq = new(); //check 2 { - fq.labelInfoProject2.Text = p.p.name; - fq.labelInfoCalculate3.Text = p.d.c.dir; - fq.labelInfoOut3.Text = p.d.o.filter; + fq.labelInfoProject2.Text = /*xText(*/p.p.name/*)*/; + fq.labelInfoCalculate3.Text = /*xText(*/p.d.c.dir/*)*/; + fq.labelInfoOut3.Text = /*xText(*/p.d.o.filter/*)*/; } { - fq.Width = Math.Max(fq.Width, 200 + TextRenderer.MeasureText(p.d.c.dir, fq.labelInfoCalculate3.Font).Width + 79); + //fq.Width = Math.Max(fq.Width, 200 + TextRenderer.MeasureText(p.d.c.dir, fq.labelInfoCalculate3.Font).Width + 79); } fq.StartPosition = FormStartPosition.CenterScreen; - fq.ShowDialog((IWin32Window)p.p.p2.DTE.MainWindow.LinkedWindowFrame); + fq.ShowDialog((IWin32Window)projectUtility.dte.MainWindow.LinkedWindowFrame); if (fq.r == formQuestion.Result.none) return; - //check 2 advanced - if (fq.r == formQuestion.Result.advanced) + + if (fq.r == formQuestion.Result.advanced) //check 2 advanced { - formAdvanced fa = new formAdvanced(); + formAdvanced fa = new(); { fa.textBoxIn.Text = p.d.i.dir; fa.textBoxRootDir.Text = p.d.c.dir; @@ -162,8 +163,8 @@ private void buttonClick(object sender, EventArgs e) - //work - p.f.filesIn(p); + + p.f.filesIn(p); //work p.filtersSet(); @@ -173,15 +174,14 @@ private void buttonClick(object sender, EventArgs e) - //error - if (p.e.full) + + if (p.e.full) //error { - formError fe = new formError(); + formError fe = new (); fe.textBox.Text = p.e.ToString(); fe.StartPosition = FormStartPosition.CenterScreen; fe.ShowDialog((IWin32Window)projectUtility.dte.MainWindow.LinkedWindowFrame); } - } } } diff --git a/source/shared/project/source/source/work/filterToDir/data.cs b/source/shared/project/source/source/work/filterToDir/data.cs index b83ba96..f204840 100644 --- a/source/shared/project/source/source/work/filterToDir/data.cs +++ b/source/shared/project/source/source/work/filterToDir/data.cs @@ -9,6 +9,7 @@ using System.Threading; using VisualStudioCppExtensions.shared; using Project = VisualStudioCppExtensions.shared.Project; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/work/filterToDir/utility/dir.cs b/source/shared/project/source/source/work/filterToDir/utility/dir.cs index 4195cc5..f1682d7 100644 --- a/source/shared/project/source/source/work/filterToDir/utility/dir.cs +++ b/source/shared/project/source/source/work/filterToDir/utility/dir.cs @@ -9,6 +9,7 @@ using System.Threading; using VisualStudioCppExtensions.shared; using Project = VisualStudioCppExtensions.shared.Project; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/work/filterToDir/utility/dir.dir2.cs b/source/shared/project/source/source/work/filterToDir/utility/dir.dir2.cs index 796fdc6..5b8c06a 100644 --- a/source/shared/project/source/source/work/filterToDir/utility/dir.dir2.cs +++ b/source/shared/project/source/source/work/filterToDir/utility/dir.dir2.cs @@ -9,6 +9,7 @@ using System.Threading; using VisualStudioCppExtensions.shared; using Project = VisualStudioCppExtensions.shared.Project; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/work/filterToDir/utility/dir.file2.cs b/source/shared/project/source/source/work/filterToDir/utility/dir.file2.cs index 8d849f7..a948ecd 100644 --- a/source/shared/project/source/source/work/filterToDir/utility/dir.file2.cs +++ b/source/shared/project/source/source/work/filterToDir/utility/dir.file2.cs @@ -9,6 +9,7 @@ using System.Threading; using VisualStudioCppExtensions.shared; using Project = VisualStudioCppExtensions.shared.Project; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/work/filterToDir/work.cs b/source/shared/project/source/source/work/filterToDir/work.cs index 068be07..463e241 100644 --- a/source/shared/project/source/source/work/filterToDir/work.cs +++ b/source/shared/project/source/source/work/filterToDir/work.cs @@ -12,14 +12,16 @@ using System.Text; using System.Linq; using System.Windows.Forms; +using u.other; +using u.forms; namespace VisualStudioCppExtensions { internal sealed partial class main2 { - //callback - private void button2Click(object sender, EventArgs e) + + private void button2Click(object sender, EventArgs e) //callback { ThreadHelper.ThrowIfNotOnUIThread(); @@ -27,26 +29,26 @@ private void button2Click(object sender, EventArgs e) - //prepare - //project - filterToDir.ProjectData p = new filterToDir.ProjectData(); + + + filterToDir.ProjectData p = new(); //prepare //project { - Project x = projectUtility.GetActive(); + Project x = projectUtility.pActive(); - //check 1 project - if (!x.xIsCpp()) { ErrorMessageBox("A C++ project must be selected"); return; } + if (!x.xIsCpp()) { ErrorMessageBox("A C++ project must be selected"); return; } //check 1 project p.p = new shared.Project((VCProject)x.Properties.Item("project").Object); } - //files, filters - p.f.filesGet(p); - //data + + p.f.filesGet(p); //files, filters + + { - p.d.o.dir = new path(p.p.dir); + p.d.o.dir = new path(p.p.dir); //data if (!p.d.o.dir.xFull()) { ErrorMessageBox("project root dir is not valid"); return; } } @@ -57,25 +59,27 @@ private void button2Click(object sender, EventArgs e) - //gui - //check 2 - formQuestionFtd fq = new formQuestionFtd(); + + + formQuestionFtd fq = new(); //gui //check 2 { - fq.labelInfoProject2.Text = p.p.name; - fq.labelInfoCalculate3.Text = p.d.c.filter.x; - fq.labelInfoOut3.Text = p.d.o.dir.x; + fq.labelInfoProject2.Text = /*xText(*/p.p.name/*)*/; + fq.labelInfoCalculate3.Text = /*xText(*/p.d.c.filter.x/*)*/; + fq.labelInfoOut3.Text = /*xText(*/p.d.o.dir.x/*)*/; } { - fq.Width = Math.Max(fq.Width, 200 + TextRenderer.MeasureText(p.d.o.dir.x, fq.labelInfoOut3.Font).Width + 79); + //fq.Width = Math.Max(fq.Width, 200 + TextRenderer.MeasureText(p.d.o.dir.x, fq.labelInfoOut3.Font).Width + 79); } fq.StartPosition = FormStartPosition.CenterScreen; - fq.ShowDialog((IWin32Window)((Project)(p.p.p.Object)).DTE.MainWindow.LinkedWindowFrame); + fq.ShowDialog((IWin32Window)projectUtility.dte.MainWindow.LinkedWindowFrame); if (fq.r == formQuestionFtd.Result.none) return; - //check 3 - p.f.check(p.e); + + p.f.check(p.e); //check 3 + + @@ -86,9 +90,7 @@ private void button2Click(object sender, EventArgs e) - //work - //dir - if (!p.e.full) + if (!p.e.full) //work //dir { projectUtility.documentsRefresh(); string dn = projectUtility.dte.ActiveDocument?.Name; @@ -100,15 +102,14 @@ private void button2Click(object sender, EventArgs e) - //error - if (p.e.full) + + if (p.e.full) //error { - formError fe = new formError(); + formError fe = new(); fe.textBox.Text = p.e.ToString(); fe.StartPosition = FormStartPosition.CenterScreen; fe.ShowDialog((IWin32Window)projectUtility.dte.MainWindow.LinkedWindowFrame); } - } } } diff --git a/source/shared/project/source/source/work/shared/file.cs b/source/shared/project/source/source/work/shared/file.cs index 486596f..cde761b 100644 --- a/source/shared/project/source/source/work/shared/file.cs +++ b/source/shared/project/source/source/work/shared/file.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/shared/project/source/source/work/shared/filter.cs b/source/shared/project/source/source/work/shared/filter.cs index 38108d6..c246c98 100644 --- a/source/shared/project/source/source/work/shared/filter.cs +++ b/source/shared/project/source/source/work/shared/filter.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using u.other; namespace VisualStudioCppExtensions { diff --git a/source/vsExtensionCppFiltersGenerate.sln b/source/vsExtensionCppFiltersGenerate.sln index 02bdb87..c7d4daa 100644 --- a/source/vsExtensionCppFiltersGenerate.sln +++ b/source/vsExtensionCppFiltersGenerate.sln @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2017", "other\2017\2017.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2019", "other\2019\2019.csproj", "{1FEF684B-F519-4AED-A771-0DC642CD8F38}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{89483489-E772-48CF-A597-565479FFE517}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,6 +62,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {E85DE64F-D3DC-4D22-89B7-CDA7311E1335} = {89483489-E772-48CF-A597-565479FFE517} {18555A86-3A5F-4D33-8C12-01E288BDC310} = {636B0FC0-3831-4E37-8366-FF32ADE53404} {18555A86-3A5F-4D33-8C12-01E288BDC30F} = {636B0FC0-3831-4E37-8366-FF32ADE53404} {1FEF684B-F519-4AED-A771-0DC642CD8F38} = {636B0FC0-3831-4E37-8366-FF32ADE53404} @@ -68,10 +71,10 @@ Global SolutionGuid = {B0D51C1E-B8EB-49FB-9285-7A3D86E32E93} EndGlobalSection GlobalSection(SharedMSBuildProjectFiles) = preSolution - shared\project\cppFiltersAutoShared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc30e}*SharedItemsImports = 4 - shared\project\cppFiltersAutoShared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc30f}*SharedItemsImports = 4 - shared\project\cppFiltersAutoShared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc310}*SharedItemsImports = 4 - shared\project\cppFiltersAutoShared.projitems*{1fef684b-f519-4aed-a771-0dc642cd8f38}*SharedItemsImports = 4 - shared\project\cppFiltersAutoShared.projitems*{e85de64f-d3dc-4d22-89b7-cda7311e1335}*SharedItemsImports = 13 + shared\project\shared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc30e}*SharedItemsImports = 4 + shared\project\shared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc30f}*SharedItemsImports = 4 + shared\project\shared.projitems*{18555a86-3a5f-4d33-8c12-01e288bdc310}*SharedItemsImports = 4 + shared\project\shared.projitems*{1fef684b-f519-4aed-a771-0dc642cd8f38}*SharedItemsImports = 4 + shared\project\shared.projitems*{e85de64f-d3dc-4d22-89b7-cda7311e1335}*SharedItemsImports = 13 EndGlobalSection EndGlobal