Guest User

Untitled

a guest
Apr 22nd, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. #pragma once
  2. #include "properties.h"
  3.  
  4. properties user;
  5. namespace DeepLinkTeser {
  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. /// Podsumowanie informacji o Main
  16. /// </summary>
  17. public ref class Main : public System::Windows::Forms::Form
  18. {
  19. public:
  20. Main(void)
  21. {
  22. InitializeComponent();
  23.  
  24. //
  25. //TODO: W tym miejscu dodaj kod konstruktora
  26. //
  27. }
  28.  
  29. protected:
  30. /// <summary>
  31. /// Wyczyœæ wszystkie u¿ywane zasoby.
  32. /// </summary>
  33. ~Main()
  34. {
  35. if (components)
  36. {
  37. delete components;
  38. }
  39. }
  40. private: System::Windows::Forms::Label^ label1;
  41.  
  42. private: System::Windows::Forms::TextBox^ textBox1;
  43. private: System::Windows::Forms::Button^ button1;
  44. private: System::Windows::Forms::OpenFileDialog^ openFileDialog1;
  45.  
  46. protected:
  47.  
  48. private:
  49. /// <summary>
  50. /// Wymagana zmienna projektanta.
  51. /// </summary>
  52. System::ComponentModel::Container^ components;
  53.  
  54. #pragma region Windows Form Designer generated code
  55.  
  56.  
  57. /// <summary>
  58. /// Metoda wymagana do obs³ugi projektanta — nie nale¿y modyfikowaæ
  59. /// jej zawartoœci w edytorze kodu.
  60. /// </summary>
  61. void InitializeComponent(void)
  62. {
  63. this->label1 = (gcnew System::Windows::Forms::Label());
  64. this->textBox1 = (gcnew System::Windows::Forms::TextBox());
  65. this->button1 = (gcnew System::Windows::Forms::Button());
  66. this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
  67. this->SuspendLayout();
  68. //
  69. // label1
  70. //
  71. this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14));
  72. this->label1->Location = System::Drawing::Point(722, 20);
  73. this->label1->Name = L"label1";
  74. this->label1->Size = System::Drawing::Size(145, 23);
  75. this->label1->TabIndex = 0;
  76. this->label1->Text = L"ADB Location";
  77. this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
  78. this->label1->Click += gcnew System::EventHandler(this, &Main::label1_Click);
  79. //
  80. // textBox1
  81. //
  82. this->textBox1->Location = System::Drawing::Point(726, 46);
  83. this->textBox1->Multiline = true;
  84. this->textBox1->Name = L"textBox1";
  85. this->textBox1->Size = System::Drawing::Size(141, 20);
  86. this->textBox1->TabIndex = 1;
  87. this->textBox1->Text = L"";
  88. this->textBox1->TextChanged += gcnew System::EventHandler(this, &Main::textBox1_TextChanged);
  89. //
  90. // button1
  91. //
  92. this->button1->DialogResult = System::Windows::Forms::DialogResult::OK;
  93. this->button1->Location = System::Drawing::Point(726, 73);
  94. this->button1->Name = L"button1";
  95. this->button1->Size = System::Drawing::Size(141, 23);
  96. this->button1->TabIndex = 2;
  97. this->button1->Text = L"select location";
  98. this->button1->UseVisualStyleBackColor = true;
  99. this->button1->Click += gcnew System::EventHandler(this, &Main::button1_Click);
  100. //
  101. // openFileDialog1
  102. //
  103. this->openFileDialog1->FileName = L"openFileDialog1";
  104. this->openFileDialog1->FileOk += gcnew System::ComponentModel::CancelEventHandler(this, &Main::openFileDialog1_FileOk_1);
  105. //
  106. // Main
  107. //
  108. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  109. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  110. this->ClientSize = System::Drawing::Size(893, 527);
  111. this->Controls->Add(this->button1);
  112. this->Controls->Add(this->textBox1);
  113. this->Controls->Add(this->label1);
  114. this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
  115. this->MaximizeBox = false;
  116. this->Name = L"Main";
  117. this->Text = L"Main";
  118. this->Load += gcnew System::EventHandler(this, &Main::Main_Load);
  119. this->ResumeLayout(false);
  120. this->PerformLayout();
  121. }
  122. #pragma endregion
  123. private: System::Void Main_Load(System::Object^ sender, System::EventArgs^ e) {
  124. }
  125. private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
  126. }
  127. private: System::Void openFileDialog1_FileOk(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
  128. }
  129. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
  130. OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
  131. openFileDialog1->InitialDirectory = user.getdatapath(user);
  132. openFileDialog1->Filter = "exe files (*.exe)|*.exe|All files (*.*)|*.*";
  133. openFileDialog1->FilterIndex = 2;
  134. openFileDialog1->RestoreDirectory = true;
  135. if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)
  136. {
  137. MessageBox::Show(openFileDialog1->FileName, "ADB Location:");
  138. }
  139. System::String^ managed = openFileDialog1->FileName;
  140. std::string unmanaged = msclr::interop::marshal_as<std::string>(managed);
  141. adb_location = unmanaged;
  142. textBox1->Text = openFileDialog1->FileName;
  143. }
  144. private: System::Void openFileDialog1_FileOk_1(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
  145. }
  146. private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
  147.  
  148. }
  149. };
  150. }
Advertisement
Add Comment
Please, Sign In to add comment