Subversion Repositories spk

Rev

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

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
#include <spk.h>
4
using namespace System;
5
using namespace System::ComponentModel;
6
using namespace System::Collections;
7
using namespace System::Windows::Forms;
8
using namespace System::Data;
9
using namespace System::Drawing;
10
 
11
 
12
namespace PluginManager {
13
 
14
	/// <summary>
15
	/// Summary for FakePatchControl
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 FakePatchControl : public System::Windows::Forms::Form
24
	{
25
	public:
26
		FakePatchControl(CPackages *p)
27
		{
28
			InitializeComponent();
29
 
30
			m_pPackages = p;
203 cycrow 31
			m_lFakePatches = new Utils::WStringList;
1 cycrow 32
 
33
			this->panel2->Visible = false;
34
 
35
			UpdateList();
36
			ApplyOrder();
37
		}
38
 
203 cycrow 39
		Utils::WStringList *GetPatchOrder() { return m_lFakePatches; }
1 cycrow 40
		void UpdateList();
41
		void ApplyOrder();
42
		void Save();
43
 
44
		void Unorder(ListViewItem ^item)
45
		{
46
			this->listView2->Items->Remove(item);
47
			this->listView1->Items->Add(item);
48
			item->ImageIndex = 1;
49
			this->listView1->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
50
			this->listView2->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
51
		}
52
 
53
		void Order(ListViewItem ^item)
54
		{
55
			this->listView1->Items->Remove(item);
56
			this->listView2->Items->Add(item);
57
			item->Selected = true;
58
			item->ImageIndex = 0;
59
			this->listView1->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
60
			this->listView2->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
61
		}
62
 
63
	protected:
64
		/// <summary>
65
		/// Clean up any resources being used.
66
		/// </summary>
67
		~FakePatchControl()
68
		{
69
			if (components)
70
			{
71
				delete components;
72
			}
73
			delete m_lFakePatches;
74
		}
75
 
76
	private:
203 cycrow 77
		Utils::WStringList *m_lFakePatches;
1 cycrow 78
		CPackages *m_pPackages;
79
		ListViewItem ^m_pSelectedItem;
80
 
81
	private: System::Windows::Forms::ImageList^  imageList1;
82
	private: System::Windows::Forms::Panel^  panel1;
83
	private: System::Windows::Forms::Button^  button2;
84
	private: System::Windows::Forms::Button^  button1;
85
	private: System::Windows::Forms::SplitContainer^  splitContainer1;
86
	private: System::Windows::Forms::ListView^  listView2;
87
	private: System::Windows::Forms::ColumnHeader^  columnHeader4;
88
	private: System::Windows::Forms::ListView^  listView1;
89
	private: System::Windows::Forms::ColumnHeader^  columnHeader2;
90
	private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
91
	private: System::Windows::Forms::ToolStripMenuItem^  moveToTopToolStripMenuItem;
92
	private: System::Windows::Forms::ToolStripMenuItem^  moveUpToolStripMenuItem;
93
	private: System::Windows::Forms::ToolStripMenuItem^  moveDownToolStripMenuItem;
94
	private: System::Windows::Forms::ToolStripMenuItem^  moveToBottomToolStripMenuItem;
95
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
96
	private: System::Windows::Forms::ToolStripMenuItem^  removeToolStripMenuItem;
97
	private: System::Windows::Forms::Panel^  panel2;
98
	private: System::Windows::Forms::Button^  button6;
99
	private: System::Windows::Forms::Button^  button5;
100
	private: System::Windows::Forms::Button^  button4;
101
	private: System::Windows::Forms::Button^  button3;
102
	private: System::Windows::Forms::Button^  button7;
103
	private: System::ComponentModel::IContainer^  components;
104
			 /// <summary>
105
		/// Required designer variable.
106
		/// </summary>
107
 
108
 
109
#pragma region Windows Form Designer generated code
110
		/// <summary>
111
		/// Required method for Designer support - do not modify
112
		/// the contents of this method with the code editor.
113
		/// </summary>
114
		void InitializeComponent(void)
115
		{
116
			this->components = (gcnew System::ComponentModel::Container());
117
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(FakePatchControl::typeid));
118
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
119
			this->panel1 = (gcnew System::Windows::Forms::Panel());
120
			this->button2 = (gcnew System::Windows::Forms::Button());
121
			this->button1 = (gcnew System::Windows::Forms::Button());
122
			this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
123
			this->listView2 = (gcnew System::Windows::Forms::ListView());
124
			this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
125
			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
126
			this->moveToTopToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
127
			this->moveUpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
128
			this->moveDownToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
129
			this->moveToBottomToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
130
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
131
			this->removeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
132
			this->panel2 = (gcnew System::Windows::Forms::Panel());
133
			this->button7 = (gcnew System::Windows::Forms::Button());
134
			this->button6 = (gcnew System::Windows::Forms::Button());
135
			this->button5 = (gcnew System::Windows::Forms::Button());
136
			this->button4 = (gcnew System::Windows::Forms::Button());
137
			this->button3 = (gcnew System::Windows::Forms::Button());
138
			this->listView1 = (gcnew System::Windows::Forms::ListView());
139
			this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
140
			this->panel1->SuspendLayout();
141
			this->splitContainer1->Panel1->SuspendLayout();
142
			this->splitContainer1->Panel2->SuspendLayout();
143
			this->splitContainer1->SuspendLayout();
144
			this->contextMenuStrip1->SuspendLayout();
145
			this->panel2->SuspendLayout();
146
			this->SuspendLayout();
147
			// 
148
			// imageList1
149
			// 
150
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
151
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
152
			this->imageList1->Images->SetKeyName(0, L"X3TC.ico");
153
			this->imageList1->Images->SetKeyName(1, L"X3.ico");
154
			this->imageList1->Images->SetKeyName(2, L"up.png");
155
			this->imageList1->Images->SetKeyName(3, L"database_up.png");
156
			this->imageList1->Images->SetKeyName(4, L"database_down.png");
157
			this->imageList1->Images->SetKeyName(5, L"down.png");
158
			this->imageList1->Images->SetKeyName(6, L"remove.png");
159
			// 
160
			// panel1
161
			// 
162
			this->panel1->Controls->Add(this->button2);
163
			this->panel1->Controls->Add(this->button1);
164
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
165
			this->panel1->Location = System::Drawing::Point(0, 404);
166
			this->panel1->Name = L"panel1";
167
			this->panel1->Padding = System::Windows::Forms::Padding(5);
168
			this->panel1->Size = System::Drawing::Size(482, 37);
169
			this->panel1->TabIndex = 0;
170
			// 
171
			// button2
172
			// 
173
			this->button2->DialogResult = System::Windows::Forms::DialogResult::Cancel;
174
			this->button2->Dock = System::Windows::Forms::DockStyle::Right;
175
			this->button2->Location = System::Drawing::Point(327, 5);
176
			this->button2->Name = L"button2";
177
			this->button2->Size = System::Drawing::Size(75, 27);
178
			this->button2->TabIndex = 1;
179
			this->button2->Text = L"Cancel";
180
			this->button2->UseVisualStyleBackColor = true;
181
			// 
182
			// button1
183
			// 
184
			this->button1->DialogResult = System::Windows::Forms::DialogResult::OK;
185
			this->button1->Dock = System::Windows::Forms::DockStyle::Right;
186
			this->button1->Location = System::Drawing::Point(402, 5);
187
			this->button1->Name = L"button1";
188
			this->button1->Size = System::Drawing::Size(75, 27);
189
			this->button1->TabIndex = 0;
190
			this->button1->Text = L"Save";
191
			this->button1->UseVisualStyleBackColor = true;
192
			this->button1->Click += gcnew System::EventHandler(this, &FakePatchControl::button1_Click);
193
			// 
194
			// splitContainer1
195
			// 
196
			this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
197
			this->splitContainer1->Location = System::Drawing::Point(0, 0);
198
			this->splitContainer1->Name = L"splitContainer1";
199
			this->splitContainer1->Orientation = System::Windows::Forms::Orientation::Horizontal;
200
			// 
201
			// splitContainer1.Panel1
202
			// 
203
			this->splitContainer1->Panel1->Controls->Add(this->listView2);
204
			this->splitContainer1->Panel1->Controls->Add(this->panel2);
205
			// 
206
			// splitContainer1.Panel2
207
			// 
208
			this->splitContainer1->Panel2->Controls->Add(this->listView1);
209
			this->splitContainer1->Size = System::Drawing::Size(482, 404);
210
			this->splitContainer1->SplitterDistance = 219;
211
			this->splitContainer1->TabIndex = 2;
212
			// 
213
			// listView2
214
			// 
215
			this->listView2->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(1) {this->columnHeader4});
216
			this->listView2->ContextMenuStrip = this->contextMenuStrip1;
217
			this->listView2->Dock = System::Windows::Forms::DockStyle::Fill;
218
			this->listView2->FullRowSelect = true;
219
			this->listView2->HideSelection = false;
220
			this->listView2->LargeImageList = this->imageList1;
221
			this->listView2->Location = System::Drawing::Point(0, 0);
222
			this->listView2->MultiSelect = false;
223
			this->listView2->Name = L"listView2";
224
			this->listView2->Size = System::Drawing::Size(447, 219);
225
			this->listView2->SmallImageList = this->imageList1;
226
			this->listView2->TabIndex = 2;
227
			this->listView2->UseCompatibleStateImageBehavior = false;
228
			this->listView2->View = System::Windows::Forms::View::Details;
229
			this->listView2->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &FakePatchControl::listView2_MouseDoubleClick);
230
			this->listView2->ItemSelectionChanged += gcnew System::Windows::Forms::ListViewItemSelectionChangedEventHandler(this, &FakePatchControl::listView2_ItemSelectionChanged);
231
			// 
232
			// columnHeader4
233
			// 
234
			this->columnHeader4->Text = L"Ordered Packages";
235
			// 
236
			// contextMenuStrip1
237
			// 
238
			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {this->moveToTopToolStripMenuItem, 
239
				this->moveUpToolStripMenuItem, this->moveDownToolStripMenuItem, this->moveToBottomToolStripMenuItem, this->toolStripSeparator1, 
240
				this->removeToolStripMenuItem});
241
			this->contextMenuStrip1->Name = L"contextMenuStrip1";
242
			this->contextMenuStrip1->Size = System::Drawing::Size(162, 120);
243
			this->contextMenuStrip1->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &FakePatchControl::contextMenuStrip1_Opening);
244
			// 
245
			// moveToTopToolStripMenuItem
246
			// 
247
			this->moveToTopToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"moveToTopToolStripMenuItem.Image")));
248
			this->moveToTopToolStripMenuItem->Name = L"moveToTopToolStripMenuItem";
249
			this->moveToTopToolStripMenuItem->Size = System::Drawing::Size(161, 22);
250
			this->moveToTopToolStripMenuItem->Text = L"Move to Top";
251
			this->moveToTopToolStripMenuItem->Click += gcnew System::EventHandler(this, &FakePatchControl::moveToTopToolStripMenuItem_Click);
252
			// 
253
			// moveUpToolStripMenuItem
254
			// 
255
			this->moveUpToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"moveUpToolStripMenuItem.Image")));
256
			this->moveUpToolStripMenuItem->Name = L"moveUpToolStripMenuItem";
257
			this->moveUpToolStripMenuItem->Size = System::Drawing::Size(161, 22);
258
			this->moveUpToolStripMenuItem->Text = L"Move Up";
259
			this->moveUpToolStripMenuItem->Click += gcnew System::EventHandler(this, &FakePatchControl::moveUpToolStripMenuItem_Click);
260
			// 
261
			// moveDownToolStripMenuItem
262
			// 
263
			this->moveDownToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"moveDownToolStripMenuItem.Image")));
264
			this->moveDownToolStripMenuItem->Name = L"moveDownToolStripMenuItem";
265
			this->moveDownToolStripMenuItem->Size = System::Drawing::Size(161, 22);
266
			this->moveDownToolStripMenuItem->Text = L"Move Down";
267
			this->moveDownToolStripMenuItem->Click += gcnew System::EventHandler(this, &FakePatchControl::moveDownToolStripMenuItem_Click);
268
			// 
269
			// moveToBottomToolStripMenuItem
270
			// 
271
			this->moveToBottomToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"moveToBottomToolStripMenuItem.Image")));
272
			this->moveToBottomToolStripMenuItem->Name = L"moveToBottomToolStripMenuItem";
273
			this->moveToBottomToolStripMenuItem->Size = System::Drawing::Size(161, 22);
274
			this->moveToBottomToolStripMenuItem->Text = L"Move to Bottom";
275
			this->moveToBottomToolStripMenuItem->Click += gcnew System::EventHandler(this, &FakePatchControl::moveToBottomToolStripMenuItem_Click);
276
			// 
277
			// toolStripSeparator1
278
			// 
279
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
280
			this->toolStripSeparator1->Size = System::Drawing::Size(158, 6);
281
			// 
282
			// removeToolStripMenuItem
283
			// 
284
			this->removeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"removeToolStripMenuItem.Image")));
285
			this->removeToolStripMenuItem->Name = L"removeToolStripMenuItem";
286
			this->removeToolStripMenuItem->Size = System::Drawing::Size(161, 22);
287
			this->removeToolStripMenuItem->Text = L"Set Unsorted";
288
			this->removeToolStripMenuItem->Click += gcnew System::EventHandler(this, &FakePatchControl::removeToolStripMenuItem_Click);
289
			// 
290
			// panel2
291
			// 
292
			this->panel2->Controls->Add(this->button7);
293
			this->panel2->Controls->Add(this->button6);
294
			this->panel2->Controls->Add(this->button5);
295
			this->panel2->Controls->Add(this->button4);
296
			this->panel2->Controls->Add(this->button3);
297
			this->panel2->Dock = System::Windows::Forms::DockStyle::Right;
298
			this->panel2->Location = System::Drawing::Point(447, 0);
299
			this->panel2->Name = L"panel2";
300
			this->panel2->Size = System::Drawing::Size(35, 219);
301
			this->panel2->TabIndex = 3;
302
			// 
303
			// button7
304
			// 
305
			this->button7->Dock = System::Windows::Forms::DockStyle::Fill;
306
			this->button7->ImageIndex = 6;
307
			this->button7->ImageList = this->imageList1;
308
			this->button7->Location = System::Drawing::Point(0, 67);
309
			this->button7->Name = L"button7";
310
			this->button7->Size = System::Drawing::Size(35, 86);
311
			this->button7->TabIndex = 4;
312
			this->button7->UseVisualStyleBackColor = true;
313
			this->button7->Click += gcnew System::EventHandler(this, &FakePatchControl::button7_Click);
314
			// 
315
			// button6
316
			// 
317
			this->button6->Dock = System::Windows::Forms::DockStyle::Bottom;
318
			this->button6->ImageKey = L"down.png";
319
			this->button6->ImageList = this->imageList1;
320
			this->button6->Location = System::Drawing::Point(0, 153);
321
			this->button6->Name = L"button6";
322
			this->button6->Size = System::Drawing::Size(35, 33);
323
			this->button6->TabIndex = 3;
324
			this->button6->UseVisualStyleBackColor = true;
325
			this->button6->Click += gcnew System::EventHandler(this, &FakePatchControl::button6_Click);
326
			// 
327
			// button5
328
			// 
329
			this->button5->Dock = System::Windows::Forms::DockStyle::Bottom;
330
			this->button5->ImageIndex = 4;
331
			this->button5->ImageList = this->imageList1;
332
			this->button5->Location = System::Drawing::Point(0, 186);
333
			this->button5->Name = L"button5";
334
			this->button5->Size = System::Drawing::Size(35, 33);
335
			this->button5->TabIndex = 2;
336
			this->button5->UseVisualStyleBackColor = true;
337
			this->button5->Click += gcnew System::EventHandler(this, &FakePatchControl::button5_Click);
338
			// 
339
			// button4
340
			// 
341
			this->button4->Dock = System::Windows::Forms::DockStyle::Top;
342
			this->button4->ImageIndex = 2;
343
			this->button4->ImageList = this->imageList1;
344
			this->button4->Location = System::Drawing::Point(0, 33);
345
			this->button4->Name = L"button4";
346
			this->button4->Size = System::Drawing::Size(35, 34);
347
			this->button4->TabIndex = 1;
348
			this->button4->UseVisualStyleBackColor = true;
349
			this->button4->Click += gcnew System::EventHandler(this, &FakePatchControl::button4_Click);
350
			// 
351
			// button3
352
			// 
353
			this->button3->Dock = System::Windows::Forms::DockStyle::Top;
354
			this->button3->ImageIndex = 3;
355
			this->button3->ImageList = this->imageList1;
356
			this->button3->Location = System::Drawing::Point(0, 0);
357
			this->button3->Name = L"button3";
358
			this->button3->Size = System::Drawing::Size(35, 33);
359
			this->button3->TabIndex = 0;
360
			this->button3->UseVisualStyleBackColor = true;
361
			this->button3->Click += gcnew System::EventHandler(this, &FakePatchControl::button3_Click);
362
			// 
363
			// listView1
364
			// 
365
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(1) {this->columnHeader2});
366
			this->listView1->Dock = System::Windows::Forms::DockStyle::Fill;
367
			this->listView1->FullRowSelect = true;
368
			this->listView1->LargeImageList = this->imageList1;
369
			this->listView1->Location = System::Drawing::Point(0, 0);
370
			this->listView1->MultiSelect = false;
371
			this->listView1->Name = L"listView1";
372
			this->listView1->Size = System::Drawing::Size(482, 181);
373
			this->listView1->SmallImageList = this->imageList1;
374
			this->listView1->TabIndex = 1;
375
			this->listView1->UseCompatibleStateImageBehavior = false;
376
			this->listView1->View = System::Windows::Forms::View::Details;
377
			this->listView1->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &FakePatchControl::listView1_MouseDoubleClick);
378
			// 
379
			// columnHeader2
380
			// 
381
			this->columnHeader2->Text = L"Unsorted Packages";
382
			// 
383
			// FakePatchControl
384
			// 
385
			this->AcceptButton = this->button1;
386
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
387
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
388
			this->CancelButton = this->button2;
389
			this->ClientSize = System::Drawing::Size(482, 441);
390
			this->Controls->Add(this->splitContainer1);
391
			this->Controls->Add(this->panel1);
392
			this->Name = L"FakePatchControl";
393
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
394
			this->Text = L"Fake Patch Control";
395
			this->TopMost = true;
396
			this->panel1->ResumeLayout(false);
397
			this->splitContainer1->Panel1->ResumeLayout(false);
398
			this->splitContainer1->Panel2->ResumeLayout(false);
399
			this->splitContainer1->ResumeLayout(false);
400
			this->contextMenuStrip1->ResumeLayout(false);
401
			this->panel2->ResumeLayout(false);
402
			this->ResumeLayout(false);
403
 
404
		}
405
#pragma endregion
406
	private: System::Void listView1_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
407
				Point ^mousePoint = this->listView1->PointToClient(this->listView1->MousePosition);
408
				ListViewItem ^item = this->listView1->GetItemAt(mousePoint->X, mousePoint->Y);
409
				if ( item )
410
					Order(item);
411
			 }
412
private: System::Void contextMenuStrip1_Opening(System::Object^  sender, System::ComponentModel::CancelEventArgs^  e) {
413
			 Point ^mousePoint = this->listView2->PointToClient(this->contextMenuStrip1->MousePosition);
414
			 ListViewItem ^item = this->listView2->GetItemAt(mousePoint->X, mousePoint->Y);
415
 
416
			 m_pSelectedItem = item;
417
 
418
			 if ( !item )
419
				 e->Cancel = true;
420
			 else
421
			 {
422
				 // already at the top
423
				 if ( this->listView2->Items->IndexOf(item) == 0 )
424
				 {
425
					 this->moveToTopToolStripMenuItem->Enabled = false;
426
					 this->moveUpToolStripMenuItem->Enabled = false;
427
				 }
428
				 else
429
				 {
430
					 this->moveToTopToolStripMenuItem->Enabled = true;
431
					 this->moveUpToolStripMenuItem->Enabled = true;
432
				 }
433
 
434
				 // already at the bottom
435
				 if ( this->listView2->Items->IndexOf(item) == (this->listView2->Items->Count - 1) )
436
				 {
437
					 this->moveToBottomToolStripMenuItem->Enabled = false;
438
					 this->moveDownToolStripMenuItem->Enabled = false;
439
				 }
440
				 else
441
				 {
442
					 this->moveToBottomToolStripMenuItem->Enabled = true;
443
					 this->moveDownToolStripMenuItem->Enabled = true;
444
				 }
445
			 }
446
		 }
447
private: System::Void removeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
448
			 if ( !m_pSelectedItem ) return;
449
			 Unorder(m_pSelectedItem);
450
		 }
451
private: System::Void listView2_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
452
				Point ^mousePoint = this->listView2->PointToClient(this->listView2->MousePosition);
453
				ListViewItem ^item = this->listView2->GetItemAt(mousePoint->X, mousePoint->Y);
454
				if ( item )
455
					Unorder(item);
456
		 }
457
private: System::Void moveToTopToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
458
			 if ( !m_pSelectedItem ) return;
459
			 // remove item and insert it in correct places
460
			 this->listView2->Items->Remove(m_pSelectedItem);
461
			 this->listView2->Items->Insert(0, m_pSelectedItem);
462
		 }
463
private: System::Void moveToBottomToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
464
			 if ( !m_pSelectedItem ) return;
465
			 // remove item and insert it in correct places
466
			 this->listView2->Items->Remove(m_pSelectedItem);
467
			 this->listView2->Items->Add(m_pSelectedItem);
468
		 }
469
private: System::Void moveUpToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
470
			 if ( !m_pSelectedItem ) return;
471
			 int idx = m_pSelectedItem->Index;
472
			 this->listView2->Items->Remove(m_pSelectedItem);
473
			 this->listView2->Items->Insert(idx - 1, m_pSelectedItem);
474
		 }
475
private: System::Void moveDownToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
476
			 if ( !m_pSelectedItem ) return;
477
			 int idx = m_pSelectedItem->Index;
478
			 this->listView2->Items->Remove(m_pSelectedItem);
479
			 this->listView2->Items->Insert(idx + 1, m_pSelectedItem);
480
		 }
481
private: System::Void listView2_ItemSelectionChanged(System::Object^  sender, System::Windows::Forms::ListViewItemSelectionChangedEventArgs^  e) {
482
			 if ( this->listView2->SelectedItems->Count )
483
			 {
484
				 ListViewItem ^item = this->listView2->SelectedItems[0];
485
				 if ( item->Index == 0 )
486
				 {
487
					 this->button3->Enabled = false;
488
					 this->button4->Enabled = false;
489
				 }
490
				 else
491
				 {
492
					 this->button3->Enabled = true;
493
					 this->button4->Enabled = true;
494
				 }
495
				 if ( item->Index == (this->listView2->Items->Count - 1) )
496
				 {
497
					 this->button5->Enabled = false;
498
					 this->button6->Enabled = false;
499
				 }
500
				 else
501
				 {
502
					 this->button5->Enabled = true;
503
					 this->button6->Enabled = true;
504
				 }
505
				 this->panel2->Visible = true;
506
			 }
507
			 else
508
				 this->panel2->Visible = false;
509
		 }
510
private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
511
			 if ( !this->listView2->SelectedItems->Count ) return;
512
			 ListViewItem ^item = this->listView2->SelectedItems[0];
513
			 this->listView2->Items->Remove(item);
514
			 this->listView2->Items->Insert(0, item);
515
		 }
516
private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {
517
			 if ( !this->listView2->SelectedItems->Count ) return;
518
			 ListViewItem ^item = this->listView2->SelectedItems[0];
519
			 int idx = item->Index;
520
			 this->listView2->Items->Remove(item);
521
			 this->listView2->Items->Insert(idx - 1, item);
522
		 }
523
private: System::Void button7_Click(System::Object^  sender, System::EventArgs^  e) {
524
			 if ( this->listView2->SelectedItems->Count )
525
				Unorder(this->listView2->SelectedItems[0]);
526
		 }
527
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
528
			 if ( !this->listView2->SelectedItems->Count ) return;
529
			 ListViewItem ^item = this->listView2->SelectedItems[0];
530
			 int idx = item->Index;
531
			 this->listView2->Items->Remove(item);
532
			 this->listView2->Items->Insert(idx + 1, item);
533
		 }
534
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
535
			 if ( !this->listView2->SelectedItems->Count ) return;
536
			 ListViewItem ^item = this->listView2->SelectedItems[0];
537
			 this->listView2->Items->Remove(item);
538
			 this->listView2->Items->Add(item);
539
		 }
540
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
541
			 // save the fake patch order
542
			 Save();
543
		 }
544
};
545
}