-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form_Find.cs
167 lines (148 loc) · 5.1 KB
/
Form_Find.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*******************************************************************************
*
* Space Trader for Windows 1.00
*
* Copyright (C) 2016 Keith Banner, All Rights Reserved
*
* Port to Windows by David Pierron & Jay French
* Original coding by Pieter Spronck, Sam Anderson, Samuel Goldstein, Matt Lee
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* If you'd like a copy of the GNU General Public License, go to
* http://www.gnu.org/copyleft/gpl.html.
*
* You can contact the author at [email protected]
*
******************************************************************************/
namespace SpaceTrader
{
public class FormFind : System.Windows.Forms.Form
{
#region Control Declarations
private System.Windows.Forms.Label lblText;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox txtSystem;
private System.Windows.Forms.CheckBox chkTrack;
private System.ComponentModel.Container components = null;
#endregion
#region Member Declarations
private static string text = "";
private static bool boxChecked = false;
#endregion
#region Methods
public FormFind()
{
InitializeComponent();
txtSystem.Text = text;
chkTrack.Checked = boxChecked;
}
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.lblText = new System.Windows.Forms.Label();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.txtSystem = new System.Windows.Forms.TextBox();
this.chkTrack = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// lblText
//
this.lblText.AutoSize = true;
this.lblText.Location = new System.Drawing.Point(8, 8);
this.lblText.Name = "lblText";
this.lblText.Size = new System.Drawing.Size(177, 13);
this.lblText.TabIndex = 3;
this.lblText.Text = "Which system are you looking for?";
//
// btnOk
//
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Location = new System.Drawing.Point(43, 68);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(40, 22);
this.btnOk.TabIndex = 3;
this.btnOk.Text = "Ok";
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Location = new System.Drawing.Point(91, 68);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(50, 22);
this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "Cancel";
//
// txtSystem
//
this.txtSystem.Location = new System.Drawing.Point(8, 24);
this.txtSystem.Name = "txtSystem";
this.txtSystem.Size = new System.Drawing.Size(168, 20);
this.txtSystem.TabIndex = 1;
this.txtSystem.Text = "";
//
// chkTrack
//
this.chkTrack.Location = new System.Drawing.Point(8, 48);
this.chkTrack.Name = "chkTrack";
this.chkTrack.Size = new System.Drawing.Size(112, 16);
this.chkTrack.TabIndex = 2;
this.chkTrack.Text = "Track this system";
//
// FormFind
//
this.AcceptButton = this.btnOk;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(184, 97);
this.ControlBox = false;
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.chkTrack,
this.txtSystem,
this.btnCancel,
this.btnOk,
this.lblText});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "FormFind";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Find System";
this.Closed += new System.EventHandler(this.FormFind_Closed);
this.ResumeLayout(false);
}
#endregion
#endregion
#region Event Handlers
private void FormFind_Closed(object sender, System.EventArgs e)
{
text = txtSystem.Text;
boxChecked = chkTrack.Checked;
}
#endregion
#region Properties
public string SystemName => txtSystem.Text;
public bool TrackSystem => chkTrack.Checked;
#endregion
}
}