Subversion Repositories spk

Rev

Rev 122 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
121 cycrow 1
#pragma once
2
 
3
#include <spk.h>
4
 
5
namespace PluginManager {
6
 
7
	using namespace System;
8
	using namespace System::ComponentModel;
9
	using namespace System::Collections;
10
	using namespace System::Windows::Forms;
11
	using namespace System::Data;
12
	using namespace System::Drawing;
13
 
14
	/// <summary>
15
	/// Summary for DirectoryControl
16
	/// </summary>
17
	public ref class DirectoryControl : public System::Windows::Forms::Form
18
	{
19
	public:
196 cycrow 20
		DirectoryControl(CPackages *packages, Utils::WStringList *currentDirs, Utils::WStringList *removedDirs);
121 cycrow 21
 
196 cycrow 22
		Utils::WStringList *directories();
23
		Utils::WStringList *removeDirectories();
122 cycrow 24
 
25
	protected:
196 cycrow 26
		void AddFoundDir(const Utils::WString &dir);
27
		void FindAllAddons(const Utils::WString &exe, bool checkBase);
28
		void getAllDirs(Utils::WStringList *currentDirs, Utils::WStringList *removedDirs);
121 cycrow 29
		void UpdateGameDirs();
30
		void UpdateFoundDirs();
122 cycrow 31
		void UpdateTexts();
121 cycrow 32
 
33
	protected:
34
		/// <summary>
35
		/// Clean up any resources being used.
36
		/// </summary>
37
		~DirectoryControl();
38
 
39
	protected:
40
	private: System::Windows::Forms::GroupBox^  groupBox1;
41
	private: System::Windows::Forms::Panel^  panel1;
42
	private: System::Windows::Forms::Button^  button1;
43
	private: System::Windows::Forms::Button^  removeButton;
44
	private: System::Windows::Forms::ImageList^  imageListGames;
45
	private: System::ComponentModel::IContainer^  components;
46
 
47
	private:
48
		/// <summary>
49
		/// Required designer variable.
50
		/// </summary>
196 cycrow 51
		Utils::WStringList *_lDirs;
52
		Utils::WStringList *_lRemoveDirs;
53
		Utils::WStringList *_lFoundDirs;
121 cycrow 54
		CPackages *_packages;
55
 
56
	private: System::Windows::Forms::GroupBox^  groupBox2;
57
	private: System::Windows::Forms::Panel^  panel2;
58
	private: System::Windows::Forms::ListView^  listView2;
59
	private: System::Windows::Forms::SplitContainer^  splitContainer1;
60
	private: System::Windows::Forms::Panel^  panel3;
61
	private: System::Windows::Forms::Button^  buttonAccept;
62
 
63
	private: System::Windows::Forms::Button^  ButtonAddFound;
64
 
65
	private: System::Windows::Forms::ColumnHeader^  ColumnDir2;
66
	private: System::Windows::Forms::ColumnHeader^  ColumnGame2;
67
	private: System::Windows::Forms::ColumnHeader^  ColumnLang2;
68
	private: System::Windows::Forms::ColumnHeader^  ColumnID2;
69
	private: System::Windows::Forms::ListView^  listView1;
70
	private: System::Windows::Forms::ColumnHeader^  ColumnDirectory;
71
	private: System::Windows::Forms::ColumnHeader^  ColumnGame;
72
	private: System::Windows::Forms::ColumnHeader^  ColumnStatus;
73
	private: System::Windows::Forms::ColumnHeader^  ColumnLang;
74
	private: System::Windows::Forms::ColumnHeader^  ColumnID;
75
	private: System::Windows::Forms::ColumnHeader^  columnAddon2;
76
	private: System::Windows::Forms::ColumnHeader^  columnAddon;
77
	private: System::Windows::Forms::Button^  buttonCancel;
78
 
79
#pragma region Windows Form Designer generated code
80
		/// <summary>
81
		/// Required method for Designer support - do not modify
82
		/// the contents of this method with the code editor.
83
		/// </summary>
84
		void InitializeComponent(void)
85
		{
86
			this->components = (gcnew System::ComponentModel::Container());
87
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(DirectoryControl::typeid));
88
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
89
			this->listView1 = (gcnew System::Windows::Forms::ListView());
90
			this->ColumnDirectory = (gcnew System::Windows::Forms::ColumnHeader());
91
			this->ColumnGame = (gcnew System::Windows::Forms::ColumnHeader());
92
			this->ColumnStatus = (gcnew System::Windows::Forms::ColumnHeader());
93
			this->ColumnLang = (gcnew System::Windows::Forms::ColumnHeader());
94
			this->columnAddon = (gcnew System::Windows::Forms::ColumnHeader());
95
			this->ColumnID = (gcnew System::Windows::Forms::ColumnHeader());
96
			this->panel1 = (gcnew System::Windows::Forms::Panel());
97
			this->removeButton = (gcnew System::Windows::Forms::Button());
98
			this->button1 = (gcnew System::Windows::Forms::Button());
99
			this->imageListGames = (gcnew System::Windows::Forms::ImageList(this->components));
100
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
101
			this->listView2 = (gcnew System::Windows::Forms::ListView());
102
			this->ColumnDir2 = (gcnew System::Windows::Forms::ColumnHeader());
103
			this->ColumnGame2 = (gcnew System::Windows::Forms::ColumnHeader());
104
			this->ColumnLang2 = (gcnew System::Windows::Forms::ColumnHeader());
105
			this->columnAddon2 = (gcnew System::Windows::Forms::ColumnHeader());
106
			this->ColumnID2 = (gcnew System::Windows::Forms::ColumnHeader());
107
			this->panel2 = (gcnew System::Windows::Forms::Panel());
108
			this->ButtonAddFound = (gcnew System::Windows::Forms::Button());
109
			this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
110
			this->panel3 = (gcnew System::Windows::Forms::Panel());
111
			this->buttonCancel = (gcnew System::Windows::Forms::Button());
112
			this->buttonAccept = (gcnew System::Windows::Forms::Button());
113
			this->groupBox1->SuspendLayout();
114
			this->panel1->SuspendLayout();
115
			this->groupBox2->SuspendLayout();
116
			this->panel2->SuspendLayout();
117
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->BeginInit();
118
			this->splitContainer1->Panel1->SuspendLayout();
119
			this->splitContainer1->Panel2->SuspendLayout();
120
			this->splitContainer1->SuspendLayout();
121
			this->panel3->SuspendLayout();
122
			this->SuspendLayout();
123
			// 
124
			// groupBox1
125
			// 
126
			this->groupBox1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
127
			this->groupBox1->Controls->Add(this->listView1);
128
			this->groupBox1->Controls->Add(this->panel1);
129
			this->groupBox1->Dock = System::Windows::Forms::DockStyle::Fill;
130
			this->groupBox1->Location = System::Drawing::Point(0, 0);
131
			this->groupBox1->Name = L"groupBox1";
132
			this->groupBox1->Size = System::Drawing::Size(1084, 325);
133
			this->groupBox1->TabIndex = 1;
134
			this->groupBox1->TabStop = false;
135
			this->groupBox1->Text = L"Current Directories";
136
			// 
137
			// listView1
138
			// 
139
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(6) {
140
				this->ColumnDirectory,
141
					this->ColumnGame, this->ColumnStatus, this->ColumnLang, this->columnAddon, this->ColumnID
142
			});
143
			this->listView1->Dock = System::Windows::Forms::DockStyle::Fill;
144
			this->listView1->FullRowSelect = true;
145
			this->listView1->HideSelection = false;
146
			this->listView1->Location = System::Drawing::Point(3, 18);
147
			this->listView1->Name = L"listView1";
148
			this->listView1->Size = System::Drawing::Size(1078, 253);
149
			this->listView1->TabIndex = 0;
150
			this->listView1->UseCompatibleStateImageBehavior = false;
151
			this->listView1->View = System::Windows::Forms::View::Details;
152
			this->listView1->SelectedIndexChanged += gcnew System::EventHandler(this, &DirectoryControl::listView1_SelectedIndexChanged);
153
			this->listView1->DoubleClick += gcnew System::EventHandler(this, &DirectoryControl::listView1_DoubleClick);
154
			// 
155
			// ColumnDirectory
156
			// 
157
			this->ColumnDirectory->Text = L"Directory";
158
			this->ColumnDirectory->Width = 211;
159
			// 
160
			// ColumnGame
161
			// 
162
			this->ColumnGame->Text = L"Game";
163
			// 
164
			// ColumnStatus
165
			// 
166
			this->ColumnStatus->Text = L"Status";
167
			// 
168
			// ColumnLang
169
			// 
170
			this->ColumnLang->Text = L"Language";
171
			// 
172
			// columnAddon
173
			// 
174
			this->columnAddon->Text = L"Addon";
175
			// 
176
			// ColumnID
177
			// 
178
			this->ColumnID->Text = L"";
179
			// 
180
			// panel1
181
			// 
182
			this->panel1->Controls->Add(this->removeButton);
183
			this->panel1->Controls->Add(this->button1);
184
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
185
			this->panel1->Location = System::Drawing::Point(3, 271);
186
			this->panel1->Name = L"panel1";
187
			this->panel1->Size = System::Drawing::Size(1078, 51);
188
			this->panel1->TabIndex = 2;
189
			// 
190
			// removeButton
191
			// 
192
			this->removeButton->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"removeButton.Image")));
193
			this->removeButton->Location = System::Drawing::Point(201, 0);
194
			this->removeButton->Name = L"removeButton";
195
			this->removeButton->Size = System::Drawing::Size(194, 48);
196
			this->removeButton->TabIndex = 1;
197
			this->removeButton->Text = L"Remove Selected";
198
			this->removeButton->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
199
			this->removeButton->UseVisualStyleBackColor = true;
200
			this->removeButton->Click += gcnew System::EventHandler(this, &DirectoryControl::removeButton_Click);
201
			// 
202
			// button1
203
			// 
204
			this->button1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"button1.Image")));
205
			this->button1->Location = System::Drawing::Point(0, 0);
206
			this->button1->Name = L"button1";
207
			this->button1->Size = System::Drawing::Size(195, 50);
208
			this->button1->TabIndex = 0;
209
			this->button1->Text = L"Add New Directory";
210
			this->button1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
211
			this->button1->UseVisualStyleBackColor = true;
212
			this->button1->Click += gcnew System::EventHandler(this, &DirectoryControl::button1_Click);
213
			// 
214
			// imageListGames
215
			// 
216
			this->imageListGames->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListGames.ImageStream")));
217
			this->imageListGames->TransparentColor = System::Drawing::Color::Transparent;
218
			this->imageListGames->Images->SetKeyName(0, L"X2");
219
			this->imageListGames->Images->SetKeyName(1, L"X3");
220
			this->imageListGames->Images->SetKeyName(2, L"X3TC");
221
			this->imageListGames->Images->SetKeyName(3, L"X3AP");
222
			this->imageListGames->Images->SetKeyName(4, L"X3FL");
223
			// 
224
			// groupBox2
225
			// 
226
			this->groupBox2->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
227
			this->groupBox2->Controls->Add(this->listView2);
228
			this->groupBox2->Controls->Add(this->panel2);
229
			this->groupBox2->Dock = System::Windows::Forms::DockStyle::Fill;
230
			this->groupBox2->Location = System::Drawing::Point(0, 0);
231
			this->groupBox2->Name = L"groupBox2";
232
			this->groupBox2->Size = System::Drawing::Size(1084, 321);
233
			this->groupBox2->TabIndex = 2;
234
			this->groupBox2->TabStop = false;
235
			this->groupBox2->Text = L"Available Directories";
236
			// 
237
			// listView2
238
			// 
239
			this->listView2->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(5) {
240
				this->ColumnDir2, this->ColumnGame2,
241
					this->ColumnLang2, this->columnAddon2, this->ColumnID2
242
			});
243
			this->listView2->Dock = System::Windows::Forms::DockStyle::Fill;
244
			this->listView2->FullRowSelect = true;
245
			this->listView2->HideSelection = false;
246
			this->listView2->Location = System::Drawing::Point(3, 18);
247
			this->listView2->Name = L"listView2";
248
			this->listView2->Size = System::Drawing::Size(1078, 251);
249
			this->listView2->TabIndex = 0;
250
			this->listView2->UseCompatibleStateImageBehavior = false;
251
			this->listView2->View = System::Windows::Forms::View::Details;
252
			this->listView2->SelectedIndexChanged += gcnew System::EventHandler(this, &DirectoryControl::listView2_SelectedIndexChanged);
253
			this->listView2->DoubleClick += gcnew System::EventHandler(this, &DirectoryControl::listView2_DoubleClick);
254
			// 
255
			// ColumnDir2
256
			// 
257
			this->ColumnDir2->Text = L"Directory";
258
			// 
259
			// ColumnGame2
260
			// 
261
			this->ColumnGame2->Text = L"Game";
262
			// 
263
			// ColumnLang2
264
			// 
265
			this->ColumnLang2->Text = L"Language";
266
			// 
267
			// columnAddon2
268
			// 
269
			this->columnAddon2->Text = L"Addon";
270
			// 
271
			// ColumnID2
272
			// 
273
			this->ColumnID2->Text = L"";
274
			// 
275
			// panel2
276
			// 
277
			this->panel2->Controls->Add(this->ButtonAddFound);
278
			this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
279
			this->panel2->Location = System::Drawing::Point(3, 269);
280
			this->panel2->Name = L"panel2";
281
			this->panel2->Size = System::Drawing::Size(1078, 49);
282
			this->panel2->TabIndex = 1;
283
			// 
284
			// ButtonAddFound
285
			// 
286
			this->ButtonAddFound->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"ButtonAddFound.Image")));
287
			this->ButtonAddFound->Location = System::Drawing::Point(0, 3);
288
			this->ButtonAddFound->Name = L"ButtonAddFound";
289
			this->ButtonAddFound->Size = System::Drawing::Size(260, 46);
290
			this->ButtonAddFound->TabIndex = 0;
291
			this->ButtonAddFound->Text = L"Add Selected Directory";
292
			this->ButtonAddFound->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
293
			this->ButtonAddFound->UseVisualStyleBackColor = true;
294
			this->ButtonAddFound->Click += gcnew System::EventHandler(this, &DirectoryControl::ButtonAddFound_Click);
295
			// 
296
			// splitContainer1
297
			// 
298
			this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
299
			this->splitContainer1->Location = System::Drawing::Point(0, 0);
300
			this->splitContainer1->Name = L"splitContainer1";
301
			this->splitContainer1->Orientation = System::Windows::Forms::Orientation::Horizontal;
302
			// 
303
			// splitContainer1.Panel1
304
			// 
305
			this->splitContainer1->Panel1->Controls->Add(this->groupBox1);
306
			// 
307
			// splitContainer1.Panel2
308
			// 
309
			this->splitContainer1->Panel2->Controls->Add(this->groupBox2);
310
			this->splitContainer1->Size = System::Drawing::Size(1084, 650);
311
			this->splitContainer1->SplitterDistance = 325;
312
			this->splitContainer1->TabIndex = 4;
313
			// 
314
			// panel3
315
			// 
316
			this->panel3->Controls->Add(this->buttonCancel);
317
			this->panel3->Controls->Add(this->buttonAccept);
318
			this->panel3->Dock = System::Windows::Forms::DockStyle::Bottom;
319
			this->panel3->Location = System::Drawing::Point(0, 650);
320
			this->panel3->Name = L"panel3";
321
			this->panel3->Size = System::Drawing::Size(1084, 41);
322
			this->panel3->TabIndex = 5;
323
			// 
324
			// buttonCancel
325
			// 
326
			this->buttonCancel->DialogResult = System::Windows::Forms::DialogResult::Cancel;
327
			this->buttonCancel->Dock = System::Windows::Forms::DockStyle::Right;
328
			this->buttonCancel->Location = System::Drawing::Point(934, 0);
329
			this->buttonCancel->Name = L"buttonCancel";
330
			this->buttonCancel->Size = System::Drawing::Size(75, 41);
331
			this->buttonCancel->TabIndex = 1;
332
			this->buttonCancel->Text = L"Cancel";
333
			this->buttonCancel->UseVisualStyleBackColor = true;
334
			// 
335
			// buttonAccept
336
			// 
337
			this->buttonAccept->DialogResult = System::Windows::Forms::DialogResult::OK;
338
			this->buttonAccept->Dock = System::Windows::Forms::DockStyle::Right;
339
			this->buttonAccept->Location = System::Drawing::Point(1009, 0);
340
			this->buttonAccept->Name = L"buttonAccept";
341
			this->buttonAccept->Size = System::Drawing::Size(75, 41);
342
			this->buttonAccept->TabIndex = 0;
343
			this->buttonAccept->Text = L"Accept";
344
			this->buttonAccept->UseVisualStyleBackColor = true;
345
			// 
346
			// DirectoryControl
347
			// 
348
			this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
349
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
350
			this->ClientSize = System::Drawing::Size(1084, 691);
351
			this->Controls->Add(this->splitContainer1);
352
			this->Controls->Add(this->panel3);
122 cycrow 353
			this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
121 cycrow 354
			this->Name = L"DirectoryControl";
355
			this->Text = L"Directory Control";
356
			this->groupBox1->ResumeLayout(false);
357
			this->panel1->ResumeLayout(false);
358
			this->groupBox2->ResumeLayout(false);
359
			this->panel2->ResumeLayout(false);
360
			this->splitContainer1->Panel1->ResumeLayout(false);
361
			this->splitContainer1->Panel2->ResumeLayout(false);
362
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->EndInit();
363
			this->splitContainer1->ResumeLayout(false);
364
			this->panel3->ResumeLayout(false);
365
			this->ResumeLayout(false);
366
 
367
		}
368
#pragma endregion
369
 
370
	private: System::Void listView1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
371
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e);
372
	private: System::Void removeButton_Click(System::Object^  sender, System::EventArgs^  e);
373
	private: System::Void listView2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
374
	private: System::Void ButtonAddFound_Click(System::Object^  sender, System::EventArgs^  e);
375
	private: System::Void listView1_DoubleClick(System::Object^  sender, System::EventArgs^  e);
376
	private: System::Void listView2_DoubleClick(System::Object^  sender, System::EventArgs^  e);
377
};
378
}