From 95cba142cd15a08257d9cd6e230bcfd72a36a26a Mon Sep 17 00:00:00 2001 From: Handtag Date: Mon, 10 Nov 2025 10:40:43 +0100 Subject: [PATCH] Add project files. --- Flaggor.sln | 25 ++++ Flaggor/App.config | 6 + Flaggor/Flaggor.csproj | 83 +++++++++++++ Flaggor/Form1.Designer.cs | 144 +++++++++++++++++++++++ Flaggor/Form1.cs | 84 +++++++++++++ Flaggor/Form1.resx | 123 +++++++++++++++++++ Flaggor/Program.cs | 22 ++++ Flaggor/Properties/AssemblyInfo.cs | 33 ++++++ Flaggor/Properties/Resources.Designer.cs | 71 +++++++++++ Flaggor/Properties/Resources.resx | 117 ++++++++++++++++++ Flaggor/Properties/Settings.Designer.cs | 30 +++++ Flaggor/Properties/Settings.settings | 7 ++ 12 files changed, 745 insertions(+) create mode 100644 Flaggor.sln create mode 100644 Flaggor/App.config create mode 100644 Flaggor/Flaggor.csproj create mode 100644 Flaggor/Form1.Designer.cs create mode 100644 Flaggor/Form1.cs create mode 100644 Flaggor/Form1.resx create mode 100644 Flaggor/Program.cs create mode 100644 Flaggor/Properties/AssemblyInfo.cs create mode 100644 Flaggor/Properties/Resources.Designer.cs create mode 100644 Flaggor/Properties/Resources.resx create mode 100644 Flaggor/Properties/Settings.Designer.cs create mode 100644 Flaggor/Properties/Settings.settings diff --git a/Flaggor.sln b/Flaggor.sln new file mode 100644 index 0000000..768b857 --- /dev/null +++ b/Flaggor.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36408.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flaggor", "Flaggor\Flaggor.csproj", "{A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {63B94B2F-0DEB-46ED-AD0F-DDDD7133CAE6} + EndGlobalSection +EndGlobal diff --git a/Flaggor/App.config b/Flaggor/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/Flaggor/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Flaggor/Flaggor.csproj b/Flaggor/Flaggor.csproj new file mode 100644 index 0000000..28fb6b8 --- /dev/null +++ b/Flaggor/Flaggor.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {A8BC2A7E-7DF2-47C2-8B08-C3ABB6F5CD16} + WinExe + Flaggor + Flaggor + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Flaggor/Form1.Designer.cs b/Flaggor/Form1.Designer.cs new file mode 100644 index 0000000..bfd3a73 --- /dev/null +++ b/Flaggor/Form1.Designer.cs @@ -0,0 +1,144 @@ +namespace Flaggor +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.flaggorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.sverigeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.finlandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.danmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.flaggorToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(800, 24); + this.menuStrip1.TabIndex = 3; + this.menuStrip1.Text = "menuStrip1"; + // + // flaggorToolStripMenuItem + // + this.flaggorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.sverigeToolStripMenuItem, + this.finlandToolStripMenuItem, + this.danmarkToolStripMenuItem}); + this.flaggorToolStripMenuItem.Name = "flaggorToolStripMenuItem"; + this.flaggorToolStripMenuItem.Size = new System.Drawing.Size(59, 20); + this.flaggorToolStripMenuItem.Text = "Flaggor"; + // + // sverigeToolStripMenuItem + // + this.sverigeToolStripMenuItem.Name = "sverigeToolStripMenuItem"; + this.sverigeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.sverigeToolStripMenuItem.Text = "Sverige"; + this.sverigeToolStripMenuItem.Click += new System.EventHandler(this.sverigeToolStripMenuItem_Click); + // + // finlandToolStripMenuItem + // + this.finlandToolStripMenuItem.Name = "finlandToolStripMenuItem"; + this.finlandToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.finlandToolStripMenuItem.Text = "Finland"; + this.finlandToolStripMenuItem.Click += new System.EventHandler(this.finlandToolStripMenuItem_Click); + // + // danmarkToolStripMenuItem + // + this.danmarkToolStripMenuItem.Name = "danmarkToolStripMenuItem"; + this.danmarkToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.danmarkToolStripMenuItem.Text = "Danmark"; + this.danmarkToolStripMenuItem.Click += new System.EventHandler(this.danmarkToolStripMenuItem_Click); + // + // numericUpDown1 + // + this.numericUpDown1.Location = new System.Drawing.Point(151, 4); + this.numericUpDown1.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDown1.Minimum = new decimal(new int[] { + 100, + 0, + 0, + -2147483648}); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(120, 20); + this.numericUpDown1.TabIndex = 4; + this.numericUpDown1.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(105, 6); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(40, 13); + this.label1.TabIndex = 5; + this.label1.Text = "Storlek"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.label1); + this.Controls.Add(this.numericUpDown1); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "Form1"; + this.Text = "Form1"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem flaggorToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem sverigeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem finlandToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem danmarkToolStripMenuItem; + private System.Windows.Forms.NumericUpDown numericUpDown1; + private System.Windows.Forms.Label label1; + } +} + diff --git a/Flaggor/Form1.cs b/Flaggor/Form1.cs new file mode 100644 index 0000000..3095689 --- /dev/null +++ b/Flaggor/Form1.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Flaggor +{ + public partial class Form1 : Form + { + Color background = Color.Black; + Color cross = Color.Gray; + Point start = new Point(100, 100); + float size = 20; + public Form1() + { + InitializeComponent(); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics g = e.Graphics; + + SolidBrush brush = new SolidBrush(background); + + g.FillRectangle( + brush, + start.X, + start.Y, + 16*size, + 10*size + ); + + brush.Color = cross; + + g.FillRectangle(brush, + start.X + 5 * size, + start.Y, + 2*size, + 10*size + ); + + g.FillRectangle(brush, + start.X, + start.Y + 4*size, + 16*size, + 2*size + ); + + + } + + private void sverigeToolStripMenuItem_Click(object sender, EventArgs e) + { + background = Color.FromArgb(0, 106, 167); + cross = Color.FromArgb(254, 204, 2); + Invalidate(); + } + + private void finlandToolStripMenuItem_Click(object sender, EventArgs e) + { + background = Color.White; + cross = Color.FromArgb(0, 53, 128); + Invalidate(); + } + + private void danmarkToolStripMenuItem_Click(object sender, EventArgs e) + { + background = Color.FromArgb(198, 12, 48); + cross = Color.White; + Invalidate(); + } + + private void numericUpDown1_ValueChanged(object sender, EventArgs e) + { + size = (float)numericUpDown1.Value; + Invalidate(); + } + } +} diff --git a/Flaggor/Form1.resx b/Flaggor/Form1.resx new file mode 100644 index 0000000..d5494e3 --- /dev/null +++ b/Flaggor/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Flaggor/Program.cs b/Flaggor/Program.cs new file mode 100644 index 0000000..68ab2ca --- /dev/null +++ b/Flaggor/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Flaggor +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Flaggor/Properties/AssemblyInfo.cs b/Flaggor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a1b2972 --- /dev/null +++ b/Flaggor/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Flaggor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Gislaveds kommun")] +[assembly: AssemblyProduct("Flaggor")] +[assembly: AssemblyCopyright("Copyright © Gislaveds kommun 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a8bc2a7e-7df2-47c2-8b08-c3abb6f5cd16")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Flaggor/Properties/Resources.Designer.cs b/Flaggor/Properties/Resources.Designer.cs new file mode 100644 index 0000000..08cd317 --- /dev/null +++ b/Flaggor/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Flaggor.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Flaggor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Flaggor/Properties/Resources.resx b/Flaggor/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Flaggor/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Flaggor/Properties/Settings.Designer.cs b/Flaggor/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6b00922 --- /dev/null +++ b/Flaggor/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Flaggor.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Flaggor/Properties/Settings.settings b/Flaggor/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Flaggor/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +