Oknopruj.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #pragma once
  2. #include <string>
  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. namespace wyprujdef {
  10. /// <summary>
  11. /// Summary for Oknopruj
  12. ///
  13. /// WARNING: If you change the name of this class, you will need to change the
  14. /// 'Resource File Name' property for the managed resource compiler tool
  15. /// associated with all .resx files this class depends on. Otherwise,
  16. /// the designers will not be able to interact properly with localized
  17. /// resources associated with this form.
  18. /// </summary>
  19. public ref class Oknopruj : public System::Windows::Forms::Form
  20. {
  21. public:
  22. static std::string ToString(System::String^ src);
  23. void runSearch();
  24. void wyprujDefyZPlikow(array<String^> ^pliki);
  25. Oknopruj(void)
  26. {
  27. InitializeComponent();
  28. }
  29. protected:
  30. /// <summary>
  31. /// Clean up any resources being used.
  32. /// </summary>
  33. ~Oknopruj()
  34. {
  35. if (components)
  36. {
  37. delete components;
  38. }
  39. }
  40. private: System::Windows::Forms::MenuStrip^ menuStrip1;
  41. protected:
  42. private: System::Windows::Forms::ToolStripMenuItem^ rUNToolStripMenuItem;
  43. private: System::Windows::Forms::ToolStripMenuItem^ getProgramDirToolStripMenuItem;
  44. private: System::Windows::Forms::ToolStripMenuItem^ browseToolStripMenuItem;
  45. private: System::Windows::Forms::ToolStripMenuItem^ vCMIHomepageToolStripMenuItem;
  46. private: System::Windows::Forms::ProgressBar^ progressBar1;
  47. private: System::Windows::Forms::TextBox^ pathBox;
  48. private: System::Windows::Forms::Label^ label1;
  49. private: System::DirectoryServices::DirectorySearcher^ directorySearcher1;
  50. private: System::Windows::Forms::FolderBrowserDialog^ folderBrowserDialog1;
  51. private: System::Windows::Forms::RadioButton^ rfirst;
  52. private: System::Windows::Forms::RadioButton^ rall;
  53. private:
  54. /// <summary>
  55. /// Required designer variable.
  56. /// </summary>
  57. System::ComponentModel::Container ^components;
  58. #pragma region Windows Form Designer generated code
  59. /// <summary>
  60. /// Required method for Designer support - do not modify
  61. /// the contents of this method with the code editor.
  62. /// </summary>
  63. void InitializeComponent(void)
  64. {
  65. this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
  66. this->rUNToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  67. this->getProgramDirToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  68. this->browseToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  69. this->vCMIHomepageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  70. this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
  71. this->pathBox = (gcnew System::Windows::Forms::TextBox());
  72. this->label1 = (gcnew System::Windows::Forms::Label());
  73. this->directorySearcher1 = (gcnew System::DirectoryServices::DirectorySearcher());
  74. this->folderBrowserDialog1 = (gcnew System::Windows::Forms::FolderBrowserDialog());
  75. this->rfirst = (gcnew System::Windows::Forms::RadioButton());
  76. this->rall = (gcnew System::Windows::Forms::RadioButton());
  77. this->menuStrip1->SuspendLayout();
  78. this->SuspendLayout();
  79. //
  80. // menuStrip1
  81. //
  82. this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->rUNToolStripMenuItem,
  83. this->getProgramDirToolStripMenuItem, this->browseToolStripMenuItem, this->vCMIHomepageToolStripMenuItem});
  84. this->menuStrip1->Location = System::Drawing::Point(0, 0);
  85. this->menuStrip1->Name = L"menuStrip1";
  86. this->menuStrip1->Size = System::Drawing::Size(308, 24);
  87. this->menuStrip1->TabIndex = 0;
  88. this->menuStrip1->Text = L"menuStrip1";
  89. //
  90. // rUNToolStripMenuItem
  91. //
  92. this->rUNToolStripMenuItem->Name = L"rUNToolStripMenuItem";
  93. this->rUNToolStripMenuItem->Size = System::Drawing::Size(44, 20);
  94. this->rUNToolStripMenuItem->Text = L"RUN!";
  95. this->rUNToolStripMenuItem->Click += gcnew System::EventHandler(this, &Oknopruj::rUNToolStripMenuItem_Click);
  96. //
  97. // getProgramDirToolStripMenuItem
  98. //
  99. this->getProgramDirToolStripMenuItem->Name = L"getProgramDirToolStripMenuItem";
  100. this->getProgramDirToolStripMenuItem->Size = System::Drawing::Size(94, 20);
  101. this->getProgramDirToolStripMenuItem->Text = L"Get program dir";
  102. this->getProgramDirToolStripMenuItem->Click += gcnew System::EventHandler(this, &Oknopruj::getProgramDirToolStripMenuItem_Click);
  103. //
  104. // browseToolStripMenuItem
  105. //
  106. this->browseToolStripMenuItem->Name = L"browseToolStripMenuItem";
  107. this->browseToolStripMenuItem->Size = System::Drawing::Size(66, 20);
  108. this->browseToolStripMenuItem->Text = L"Browse...";
  109. this->browseToolStripMenuItem->Click += gcnew System::EventHandler(this, &Oknopruj::browseToolStripMenuItem_Click);
  110. //
  111. // vCMIHomepageToolStripMenuItem
  112. //
  113. this->vCMIHomepageToolStripMenuItem->Name = L"vCMIHomepageToolStripMenuItem";
  114. this->vCMIHomepageToolStripMenuItem->Size = System::Drawing::Size(97, 20);
  115. this->vCMIHomepageToolStripMenuItem->Text = L"VCMI homepage";
  116. this->vCMIHomepageToolStripMenuItem->Click += gcnew System::EventHandler(this, &Oknopruj::vCMIHomepageToolStripMenuItem_Click);
  117. //
  118. // progressBar1
  119. //
  120. this->progressBar1->Location = System::Drawing::Point(12, 96);
  121. this->progressBar1->Name = L"progressBar1";
  122. this->progressBar1->Size = System::Drawing::Size(284, 14);
  123. this->progressBar1->TabIndex = 1;
  124. //
  125. // pathBox
  126. //
  127. this->pathBox->Location = System::Drawing::Point(12, 50);
  128. this->pathBox->Name = L"pathBox";
  129. this->pathBox->Size = System::Drawing::Size(276, 20);
  130. this->pathBox->TabIndex = 2;
  131. //
  132. // label1
  133. //
  134. this->label1->AutoSize = true;
  135. this->label1->Location = System::Drawing::Point(137, 34);
  136. this->label1->Name = L"label1";
  137. this->label1->Size = System::Drawing::Size(32, 13);
  138. this->label1->TabIndex = 3;
  139. this->label1->Text = L"Path:";
  140. //
  141. // directorySearcher1
  142. //
  143. this->directorySearcher1->ClientTimeout = System::TimeSpan::Parse(L"-00:00:01");
  144. this->directorySearcher1->ServerPageTimeLimit = System::TimeSpan::Parse(L"-00:00:01");
  145. this->directorySearcher1->ServerTimeLimit = System::TimeSpan::Parse(L"-00:00:01");
  146. //
  147. // rfirst
  148. //
  149. this->rfirst->AutoSize = true;
  150. this->rfirst->Checked = true;
  151. this->rfirst->Location = System::Drawing::Point(12, 73);
  152. this->rfirst->Name = L"rfirst";
  153. this->rfirst->Size = System::Drawing::Size(128, 17);
  154. this->rfirst->TabIndex = 4;
  155. this->rfirst->TabStop = true;
  156. this->rfirst->Text = L"Extract only first frame";
  157. this->rfirst->UseVisualStyleBackColor = true;
  158. //
  159. // rall
  160. //
  161. this->rall->AutoSize = true;
  162. this->rall->Location = System::Drawing::Point(183, 73);
  163. this->rall->Name = L"rall";
  164. this->rall->Size = System::Drawing::Size(105, 17);
  165. this->rall->TabIndex = 4;
  166. this->rall->Text = L"Extract all frames";
  167. this->rall->UseVisualStyleBackColor = true;
  168. //
  169. // Oknopruj
  170. //
  171. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  172. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  173. this->ClientSize = System::Drawing::Size(308, 120);
  174. this->Controls->Add(this->rall);
  175. this->Controls->Add(this->rfirst);
  176. this->Controls->Add(this->label1);
  177. this->Controls->Add(this->pathBox);
  178. this->Controls->Add(this->progressBar1);
  179. this->Controls->Add(this->menuStrip1);
  180. this->MainMenuStrip = this->menuStrip1;
  181. this->MaximizeBox = false;
  182. this->Name = L"Oknopruj";
  183. this->ShowIcon = false;
  184. this->Text = L"Defopruj 1.0";
  185. this->Load += gcnew System::EventHandler(this, &Oknopruj::Oknopruj_Load);
  186. this->menuStrip1->ResumeLayout(false);
  187. this->menuStrip1->PerformLayout();
  188. this->ResumeLayout(false);
  189. this->PerformLayout();
  190. }
  191. #pragma endregion
  192. private: System::Void rUNToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  193. {
  194. runSearch();
  195. }
  196. private: System::Void Oknopruj_Load(System::Object^ sender, System::EventArgs^ e)
  197. {
  198. pathBox->Text = IO::Directory::GetCurrentDirectory();
  199. }
  200. private: System::Void getProgramDirToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  201. {
  202. pathBox->Text = IO::Directory::GetCurrentDirectory();
  203. }
  204. private: System::Void browseToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  205. {
  206. if (folderBrowserDialog1->ShowDialog()==System::Windows::Forms::DialogResult::OK)
  207. {
  208. pathBox->Text = folderBrowserDialog1->SelectedPath;
  209. }
  210. }
  211. private: System::Void aboutToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  212. {
  213. }
  214. private: System::Void vCMIHomepageToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  215. {
  216. Diagnostics::Process::Start(gcnew String("http://antypika.aplus.pl/vcmi"));
  217. }
  218. };
  219. }