Subversion Repositories spk

Rev

Rev 191 | Rev 226 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
using namespace System;
4
using namespace System::ComponentModel;
5
using namespace System::Collections;
6
using namespace System::Windows::Forms;
7
using namespace System::Data;
8
using namespace System::Drawing;
9
 
10
 
11
namespace Creator {
12
 
13
	/// <summary>
14
	/// Summary for SelectGame
15
	///
16
	/// WARNING: If you change the name of this class, you will need to change the
17
	///          'Resource File Name' property for the managed resource compiler tool
18
	///          associated with all .resx files this class depends on.  Otherwise,
19
	///          the designers will not be able to interact properly with localized
20
	///          resources associated with this form.
21
	/// </summary>
22
	public ref class SelectGame : public System::Windows::Forms::Form
23
	{
24
	public:
25
		SelectGame(String ^text, CPackages *p)
26
		{
27
			InitializeComponent();
28
 
29
			this->label1->Text = text;
30
 
31
			m_pPackages = NULL;
32
			if ( !p ) {
33
				p = new CPackages;
127 cycrow 34
				p->startup(".", ".", ".", ".");
1 cycrow 35
				m_pPackages = p;
36
			}
37
 
197 cycrow 38
			for ( int i = 0; i < p->GetGameExe()->numGames(); i++ )
1 cycrow 39
			{
197 cycrow 40
				SGameExe *gameExe = p->GetGameExe()->game(i);
191 cycrow 41
				this->comboBox1->Items->Add(_US(gameExe->sName));
1 cycrow 42
			}
43
 
44
			this->comboBox1->SelectedIndex = this->comboBox1->Items->Count - 1;
45
 
46
		}
47
 
48
		int GetGame() 
49
		{
50
			return this->comboBox1->SelectedIndex;
51
		}
52
 
53
	protected:
54
		/// <summary>
55
		/// Clean up any resources being used.
56
		/// </summary>
57
		~SelectGame()
58
		{
59
			if (components)
60
			{
61
				delete components;
62
			}
63
			if ( m_pPackages )
64
				delete m_pPackages;
65
		}
66
	private: System::Windows::Forms::Label^  label1;
67
	private: System::Windows::Forms::ComboBox^  comboBox1;
68
	private: System::Windows::Forms::Panel^  panel1;
69
	private: System::Windows::Forms::Button^  button2;
70
	private: System::Windows::Forms::Button^  button1;
71
	protected:
72
		CPackages  *m_pPackages;
73
 
74
	private:
75
		/// <summary>
76
		/// Required designer variable.
77
		/// </summary>
78
		System::ComponentModel::Container ^components;
79
 
80
#pragma region Windows Form Designer generated code
81
		/// <summary>
82
		/// Required method for Designer support - do not modify
83
		/// the contents of this method with the code editor.
84
		/// </summary>
85
		void InitializeComponent(void)
86
		{
87
			this->label1 = (gcnew System::Windows::Forms::Label());
88
			this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
89
			this->panel1 = (gcnew System::Windows::Forms::Panel());
90
			this->button2 = (gcnew System::Windows::Forms::Button());
91
			this->button1 = (gcnew System::Windows::Forms::Button());
92
			this->panel1->SuspendLayout();
93
			this->SuspendLayout();
94
			// 
95
			// label1
96
			// 
97
			this->label1->Dock = System::Windows::Forms::DockStyle::Fill;
98
			this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
99
				static_cast<System::Byte>(0)));
100
			this->label1->Location = System::Drawing::Point(15, 15);
101
			this->label1->Name = L"label1";
102
			this->label1->Size = System::Drawing::Size(349, 77);
103
			this->label1->TabIndex = 0;
104
			this->label1->Text = L"Select the game";
105
			this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
106
			// 
107
			// comboBox1
108
			// 
109
			this->comboBox1->Dock = System::Windows::Forms::DockStyle::Bottom;
110
			this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
111
			this->comboBox1->FormattingEnabled = true;
112
			this->comboBox1->Location = System::Drawing::Point(15, 92);
113
			this->comboBox1->Name = L"comboBox1";
114
			this->comboBox1->Size = System::Drawing::Size(349, 21);
115
			this->comboBox1->TabIndex = 1;
116
			// 
117
			// panel1
118
			// 
119
			this->panel1->Controls->Add(this->button2);
120
			this->panel1->Controls->Add(this->button1);
121
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
122
			this->panel1->Location = System::Drawing::Point(15, 113);
123
			this->panel1->Name = L"panel1";
124
			this->panel1->Padding = System::Windows::Forms::Padding(0, 10, 0, 0);
125
			this->panel1->Size = System::Drawing::Size(349, 35);
126
			this->panel1->TabIndex = 2;
127
			// 
128
			// button2
129
			// 
130
			this->button2->DialogResult = System::Windows::Forms::DialogResult::Cancel;
131
			this->button2->Dock = System::Windows::Forms::DockStyle::Left;
132
			this->button2->Location = System::Drawing::Point(0, 10);
133
			this->button2->Name = L"button2";
134
			this->button2->Size = System::Drawing::Size(75, 25);
135
			this->button2->TabIndex = 1;
136
			this->button2->Text = L"Cancel";
137
			this->button2->UseVisualStyleBackColor = true;
138
			// 
139
			// button1
140
			// 
141
			this->button1->DialogResult = System::Windows::Forms::DialogResult::OK;
142
			this->button1->Dock = System::Windows::Forms::DockStyle::Right;
143
			this->button1->Location = System::Drawing::Point(274, 10);
144
			this->button1->Name = L"button1";
145
			this->button1->Size = System::Drawing::Size(75, 25);
146
			this->button1->TabIndex = 0;
147
			this->button1->Text = L"Select";
148
			this->button1->UseVisualStyleBackColor = true;
149
			// 
150
			// SelectGame
151
			// 
152
			this->AcceptButton = this->button1;
153
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
154
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
155
			this->CancelButton = this->button2;
156
			this->ClientSize = System::Drawing::Size(379, 163);
157
			this->ControlBox = false;
158
			this->Controls->Add(this->label1);
159
			this->Controls->Add(this->comboBox1);
160
			this->Controls->Add(this->panel1);
161
			this->MaximizeBox = false;
162
			this->MinimizeBox = false;
163
			this->Name = L"SelectGame";
164
			this->Padding = System::Windows::Forms::Padding(15);
165
			this->ShowInTaskbar = false;
166
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
167
			this->Text = L"Select Game";
168
			this->TopMost = true;
169
			this->panel1->ResumeLayout(false);
170
			this->ResumeLayout(false);
171
 
172
		}
173
#pragma endregion
174
	};
175
}