Subversion Repositories spk

Rev

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