Monitor 선택 기능 추가

This commit is contained in:
2023-10-26 22:33:35 +09:00
parent 958477db56
commit c93c4043e3
8 changed files with 302 additions and 7 deletions

View File

@@ -0,0 +1,65 @@
namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
{
partial class FindMonitor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label_No = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label_No
//
this.label_No.AutoSize = true;
this.label_No.Dock = System.Windows.Forms.DockStyle.Fill;
this.label_No.Font = new System.Drawing.Font("맑은 고딕", 50.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.label_No.Location = new System.Drawing.Point(0, 0);
this.label_No.Name = "label_No";
this.label_No.Size = new System.Drawing.Size(228, 89);
this.label_No.TabIndex = 0;
this.label_No.Text = "label1";
this.label_No.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FindMonitor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.LightCoral;
this.ClientSize = new System.Drawing.Size(224, 91);
this.Controls.Add(this.label_No);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FindMonitor";
this.Text = "FindMonitor";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label_No;
}
}

View File

@@ -0,0 +1,21 @@
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 HSUCO_Cargo_Garage_Operation_Program.CustomForm
{
public partial class FindMonitor : Form
{
public FindMonitor(string monitorNumber)
{
InitializeComponent();
label_No.Text = monitorNumber;
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -18,7 +18,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
InitializeComponent(); InitializeComponent();
this.StartPosition = FormStartPosition.Manual; this.StartPosition = FormStartPosition.Manual;
var bounds = Screen.AllScreens[Screen.AllScreens.Length - 1].Bounds; var bounds = Screen.AllScreens[Global.GlobalSettings.Monitor].Bounds;
this.ClientSize = new Size(bounds.Width, bounds.Height); this.ClientSize = new Size(bounds.Width, bounds.Height);
this.Location = new Point(bounds.Left, bounds.Top); this.Location = new Point(bounds.Left, bounds.Top);

View File

@@ -48,8 +48,12 @@
this.metroLabel21 = new MetroFramework.Controls.MetroLabel(); this.metroLabel21 = new MetroFramework.Controls.MetroLabel();
this.metroButton_init = new MetroFramework.Controls.MetroButton(); this.metroButton_init = new MetroFramework.Controls.MetroButton();
this.metroButton_Test = new MetroFramework.Controls.MetroButton(); this.metroButton_Test = new MetroFramework.Controls.MetroButton();
this.button_FindMonitor = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.comboBox_Monitor = new System.Windows.Forms.ComboBox();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// metroButton_Save // metroButton_Save
@@ -358,11 +362,43 @@
this.metroButton_Test.UseSelectable = true; this.metroButton_Test.UseSelectable = true;
this.metroButton_Test.Click += new System.EventHandler(this.metroButton_Test_Click); this.metroButton_Test.Click += new System.EventHandler(this.metroButton_Test_Click);
// //
// button_FindMonitor
//
this.button_FindMonitor.Location = new System.Drawing.Point(207, 27);
this.button_FindMonitor.Name = "button_FindMonitor";
this.button_FindMonitor.Size = new System.Drawing.Size(89, 32);
this.button_FindMonitor.TabIndex = 24;
this.button_FindMonitor.Text = "번호 출력";
this.button_FindMonitor.UseVisualStyleBackColor = true;
this.button_FindMonitor.Click += new System.EventHandler(this.button_FindMonitor_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.comboBox_Monitor);
this.groupBox1.Controls.Add(this.button_FindMonitor);
this.groupBox1.Location = new System.Drawing.Point(20, 326);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(302, 74);
this.groupBox1.TabIndex = 25;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "당첨창 출력 모니터 선택";
//
// comboBox_Monitor
//
this.comboBox_Monitor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_Monitor.Font = new System.Drawing.Font("맑은 고딕", 12F);
this.comboBox_Monitor.FormattingEnabled = true;
this.comboBox_Monitor.Location = new System.Drawing.Point(30, 30);
this.comboBox_Monitor.Name = "comboBox_Monitor";
this.comboBox_Monitor.Size = new System.Drawing.Size(158, 29);
this.comboBox_Monitor.TabIndex = 25;
//
// SettingControl // SettingControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.metroButton_Test); this.Controls.Add(this.metroButton_Test);
this.Controls.Add(this.metroButton_init); this.Controls.Add(this.metroButton_init);
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
@@ -377,6 +413,7 @@
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout(); this.groupBox3.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@@ -403,5 +440,8 @@
private MetroFramework.Controls.MetroLabel metroLabel21; private MetroFramework.Controls.MetroLabel metroLabel21;
private MetroFramework.Controls.MetroButton metroButton_init; private MetroFramework.Controls.MetroButton metroButton_init;
private MetroFramework.Controls.MetroButton metroButton_Test; private MetroFramework.Controls.MetroButton metroButton_Test;
private System.Windows.Forms.Button button_FindMonitor;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comboBox_Monitor;
} }
} }

View File

@@ -8,7 +8,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
{ {
public partial class SettingControl : UserControl public partial class SettingControl : UserControl
{ {
public SettingControl() public SettingControl()
{ {
InitializeComponent(); InitializeComponent();
@@ -23,7 +22,19 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
metroTextBox_CargoLargeCertificateFee.Text = Global.GlobalSettings.CargoLargeCertificateFee.ToString(); metroTextBox_CargoLargeCertificateFee.Text = Global.GlobalSettings.CargoLargeCertificateFee.ToString();
metroTextBox_CargoOversizedCertificateFee.Text = Global.GlobalSettings.CargoOversizedCertificateFee.ToString(); metroTextBox_CargoOversizedCertificateFee.Text = Global.GlobalSettings.CargoOversizedCertificateFee.ToString();
int monitor = Screen.AllScreens.Length;
for (int i = 0; i < monitor; i++)
{
comboBox_Monitor.Items.Add(i + 1);
}
if (monitor < Global.GlobalSettings.Monitor)
{
comboBox_Monitor.SelectedIndex = 0;
}
else
{
comboBox_Monitor.SelectedIndex = Global.GlobalSettings.Monitor;
}
} }
private void metroButton_Save_Click(object sender, EventArgs e) private void metroButton_Save_Click(object sender, EventArgs e)
@@ -46,8 +57,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
settings.CargoLargeCertificateFee = value; settings.CargoLargeCertificateFee = value;
int.TryParse(metroTextBox_CargoOversizedCertificateFee.Text, out value); int.TryParse(metroTextBox_CargoOversizedCertificateFee.Text, out value);
settings.CargoOversizedCertificateFee = value; settings.CargoOversizedCertificateFee = value;
settings.Monitor = comboBox_Monitor.SelectedIndex;
Database.SaveSettings(settings); Database.SaveSettings(settings);
if (reStart) if (reStart)
{ {
MetroMessageBox.Show(this, "중요 설정이 변경되었습니다. 프로그램을 재시작합니다.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error); MetroMessageBox.Show(this, "중요 설정이 변경되었습니다. 프로그램을 재시작합니다.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -58,7 +70,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
MetroMessageBox.Show(this, "설정이 완료되었습니다.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); MetroMessageBox.Show(this, "설정이 완료되었습니다.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
Global.GlobalSettings = settings; Global.GlobalSettings = settings;
} }
private void metroButton_init_Click(object sender, EventArgs e) private void metroButton_init_Click(object sender, EventArgs e)
@@ -77,11 +88,39 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
test.Add(r); test.Add(r);
} }
LotsScreen lotsScreen = new LotsScreen(test); LotsScreen lotsScreen = new LotsScreen(test);
lotsScreen.Show(); lotsScreen.Show();
} }
private FindMonitor[] findMonitors;
private Timer timer = new Timer();
private void button_FindMonitor_Click(object sender, EventArgs e)
{
Screen[] scr = Screen.AllScreens;
findMonitors = new FindMonitor[scr.Length];
timer.Interval = 5000;
timer.Tick += Timer_Tick;
timer.Start();
for (int i = 0; i < findMonitors.Length; i++)
{
findMonitors[i] = new FindMonitor((i + 1).ToString());
findMonitors[i].Location = new System.Drawing.Point(scr[i].WorkingArea.Top, scr[i].WorkingArea.X);
findMonitors[i].Show();
}
}
private void Timer_Tick(object sender, EventArgs e)
{
for (int i = 0; i < findMonitors.Length; i++)
{
findMonitors[i].Close();
findMonitors[i].Dispose();
}
timer.Stop();
}
} }
} }

View File

@@ -195,6 +195,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
public int CargoOversizedFee { get; set; } public int CargoOversizedFee { get; set; }
public int CargoLargeCertificateFee { get; set; } public int CargoLargeCertificateFee { get; set; }
public int CargoOversizedCertificateFee { get; set; } public int CargoOversizedCertificateFee { get; set; }
public int Monitor { get; set; }
} }
public struct AreaSetting public struct AreaSetting
{ {

View File

@@ -86,6 +86,12 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CustomForm\FindMonitor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomForm\FindMonitor.Designer.cs">
<DependentUpon>FindMonitor.cs</DependentUpon>
</Compile>
<Compile Include="CustomForm\InsertResult.cs"> <Compile Include="CustomForm\InsertResult.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -191,6 +197,9 @@
<Compile Include="PrintCertificate.cs" /> <Compile Include="PrintCertificate.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="CustomForm\FindMonitor.resx">
<DependentUpon>FindMonitor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomForm\InsertResult.resx"> <EmbeddedResource Include="CustomForm\InsertResult.resx">
<DependentUpon>InsertResult.cs</DependentUpon> <DependentUpon>InsertResult.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>