thenuke321

Untitled

Apr 19th, 2015
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.60 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <cstddef>
  4. #include <string>
  5. #include "padCode/link.h"
  6.  
  7. namespace GUI {
  8.     using namespace std;
  9.     using namespace System;
  10.     using namespace System::ComponentModel;
  11.     using namespace System::Collections;
  12.     using namespace System::Windows::Forms;
  13.     using namespace System::Data;
  14.     using namespace System::Drawing;
  15.  
  16.     /// <summary>
  17.     /// Summary for mainGUI
  18.     /// </summary>
  19.     public ref class mainGUI : public System::Windows::Forms::Form
  20.     {
  21.     public:
  22.         mainGUI(void)
  23.         {
  24.             InitializeComponent();
  25.             //
  26.             //TODO: Add the constructor code here
  27.             //
  28.         }
  29.  
  30.     protected:
  31.         /// <summary>
  32.         /// Clean up any resources being used.
  33.         /// </summary>
  34.         ~mainGUI()
  35.         {
  36.             if (components)
  37.             {
  38.                 delete components;
  39.             }
  40.         }
  41.  
  42.  
  43.     private: System::Windows::Forms::TextBox^  keyBox;
  44.     private: System::Windows::Forms::Label^  lbox1;
  45.     private: System::Windows::Forms::Button^  encode;
  46.     private: System::Windows::Forms::Button^  decrypt;
  47.     private: System::Windows::Forms::Button^  CloseB;
  48.     private: System::Windows::Forms::RadioButton^  aesR;
  49.     private: System::Windows::Forms::RadioButton^  teaR;
  50.     private: System::Windows::Forms::RadioButton^  rc4R;
  51.     private: System::Windows::Forms::RadioButton^  xorR;
  52.     private: System::Windows::Forms::TextBox^  inputBox;
  53.     private: System::Windows::Forms::TextBox^  outputBox;
  54.     private: System::Windows::Forms::Label^  label1;
  55.     private: System::Windows::Forms::Label^  label2;
  56.  
  57.  
  58.  
  59.  
  60.     protected:
  61.  
  62.     protected:
  63.  
  64.  
  65.  
  66.     private: System::ComponentModel::IContainer^  components;
  67.     protected:
  68.  
  69.     private:
  70.         /// <summary>
  71.         /// Required designer variable.
  72.         /// </summary>
  73.  
  74.  
  75. #pragma region Windows Form Designer generated code
  76.         /// <summary>
  77.         /// Required method for Designer support - do not modify
  78.         /// the contents of this method with the code editor.
  79.         /// </summary>
  80.         void InitializeComponent(void)
  81.         {
  82.             this->keyBox = (gcnew System::Windows::Forms::TextBox());
  83.             this->lbox1 = (gcnew System::Windows::Forms::Label());
  84.             this->encode = (gcnew System::Windows::Forms::Button());
  85.             this->decrypt = (gcnew System::Windows::Forms::Button());
  86.             this->CloseB = (gcnew System::Windows::Forms::Button());
  87.             this->aesR = (gcnew System::Windows::Forms::RadioButton());
  88.             this->teaR = (gcnew System::Windows::Forms::RadioButton());
  89.             this->rc4R = (gcnew System::Windows::Forms::RadioButton());
  90.             this->xorR = (gcnew System::Windows::Forms::RadioButton());
  91.             this->inputBox = (gcnew System::Windows::Forms::TextBox());
  92.             this->outputBox = (gcnew System::Windows::Forms::TextBox());
  93.             this->label1 = (gcnew System::Windows::Forms::Label());
  94.             this->label2 = (gcnew System::Windows::Forms::Label());
  95.             this->SuspendLayout();
  96.             //
  97.             // keyBox
  98.             //
  99.             this->keyBox->BackColor = System::Drawing::Color::DarkRed;
  100.             this->keyBox->ForeColor = System::Drawing::Color::DarkRed;
  101.             this->keyBox->Location = System::Drawing::Point(468, 33);
  102.             this->keyBox->MaxLength = 30;
  103.             this->keyBox->Name = L"keyBox";
  104.             this->keyBox->Size = System::Drawing::Size(137, 20);
  105.             this->keyBox->TabIndex = 7;
  106.             //
  107.             // lbox1
  108.             //
  109.             this->lbox1->AutoSize = true;
  110.             this->lbox1->BackColor = System::Drawing::Color::Transparent;
  111.             this->lbox1->ForeColor = System::Drawing::SystemColors::Control;
  112.             this->lbox1->Location = System::Drawing::Point(465, 9);
  113.             this->lbox1->Name = L"lbox1";
  114.             this->lbox1->Size = System::Drawing::Size(46, 13);
  115.             this->lbox1->TabIndex = 8;
  116.             this->lbox1->Text = L"Key Box";
  117.             //
  118.             // encode
  119.             //
  120.             this->encode->BackColor = System::Drawing::Color::DarkRed;
  121.             this->encode->Location = System::Drawing::Point(471, 74);
  122.             this->encode->Name = L"encode";
  123.             this->encode->Size = System::Drawing::Size(90, 45);
  124.             this->encode->TabIndex = 9;
  125.             this->encode->Text = L"Encrypt";
  126.             this->encode->UseVisualStyleBackColor = false;
  127.             this->encode->Click += gcnew System::EventHandler(this, &mainGUI::encode_Click);
  128.             //
  129.             // decrypt
  130.             //
  131.             this->decrypt->BackColor = System::Drawing::Color::DarkRed;
  132.             this->decrypt->Location = System::Drawing::Point(471, 125);
  133.             this->decrypt->Name = L"decrypt";
  134.             this->decrypt->Size = System::Drawing::Size(90, 45);
  135.             this->decrypt->TabIndex = 10;
  136.             this->decrypt->Text = L"Decrypt";
  137.             this->decrypt->UseVisualStyleBackColor = false;
  138.             this->decrypt->Click += gcnew System::EventHandler(this, &mainGUI::decrypt_Click);
  139.             //
  140.             // CloseB
  141.             //
  142.             this->CloseB->BackColor = System::Drawing::Color::DarkRed;
  143.             this->CloseB->Location = System::Drawing::Point(471, 176);
  144.             this->CloseB->Name = L"CloseB";
  145.             this->CloseB->Size = System::Drawing::Size(90, 45);
  146.             this->CloseB->TabIndex = 11;
  147.             this->CloseB->Text = L"Close";
  148.             this->CloseB->UseVisualStyleBackColor = false;
  149.             this->CloseB->Click += gcnew System::EventHandler(this, &mainGUI::CloseB_Click);
  150.             //
  151.             // aesR
  152.             //
  153.             this->aesR->AutoSize = true;
  154.             this->aesR->BackColor = System::Drawing::Color::DarkRed;
  155.             this->aesR->Location = System::Drawing::Point(468, 253);
  156.             this->aesR->Name = L"aesR";
  157.             this->aesR->Size = System::Drawing::Size(46, 17);
  158.             this->aesR->TabIndex = 12;
  159.             this->aesR->TabStop = true;
  160.             this->aesR->Text = L"AES";
  161.             this->aesR->UseVisualStyleBackColor = false;
  162.             this->aesR->CheckedChanged += gcnew System::EventHandler(this, &mainGUI::aesR_CheckedChanged);
  163.             //
  164.             // teaR
  165.             //
  166.             this->teaR->AutoSize = true;
  167.             this->teaR->BackColor = System::Drawing::Color::DarkRed;
  168.             this->teaR->Location = System::Drawing::Point(468, 276);
  169.             this->teaR->Name = L"teaR";
  170.             this->teaR->Size = System::Drawing::Size(46, 17);
  171.             this->teaR->TabIndex = 13;
  172.             this->teaR->TabStop = true;
  173.             this->teaR->Text = L"TEA";
  174.             this->teaR->UseVisualStyleBackColor = false;
  175.             this->teaR->CheckedChanged += gcnew System::EventHandler(this, &mainGUI::teaR_CheckedChanged);
  176.             //
  177.             // rc4R
  178.             //
  179.             this->rc4R->AutoSize = true;
  180.             this->rc4R->BackColor = System::Drawing::Color::DarkRed;
  181.             this->rc4R->Location = System::Drawing::Point(468, 299);
  182.             this->rc4R->Name = L"rc4R";
  183.             this->rc4R->Size = System::Drawing::Size(46, 17);
  184.             this->rc4R->TabIndex = 14;
  185.             this->rc4R->TabStop = true;
  186.             this->rc4R->Text = L"RC4";
  187.             this->rc4R->UseVisualStyleBackColor = false;
  188.             this->rc4R->CheckedChanged += gcnew System::EventHandler(this, &mainGUI::rc4R_CheckedChanged);
  189.             //
  190.             // xorR
  191.             //
  192.             this->xorR->AutoSize = true;
  193.             this->xorR->BackColor = System::Drawing::Color::DarkRed;
  194.             this->xorR->Location = System::Drawing::Point(468, 322);
  195.             this->xorR->Name = L"xorR";
  196.             this->xorR->Size = System::Drawing::Size(48, 17);
  197.             this->xorR->TabIndex = 15;
  198.             this->xorR->TabStop = true;
  199.             this->xorR->Text = L"XOR";
  200.             this->xorR->UseVisualStyleBackColor = false;
  201.             this->xorR->CheckedChanged += gcnew System::EventHandler(this, &mainGUI::xorR_CheckedChanged);
  202.             //
  203.             // inputBox
  204.             //
  205.             this->inputBox->BackColor = System::Drawing::Color::DarkRed;
  206.             this->inputBox->Location = System::Drawing::Point(12, 20);
  207.             this->inputBox->MaxLength = 99999999;
  208.             this->inputBox->Multiline = true;
  209.             this->inputBox->Name = L"inputBox";
  210.             this->inputBox->Size = System::Drawing::Size(405, 150);
  211.             this->inputBox->TabIndex = 16;
  212.             //
  213.             // outputBox
  214.             //
  215.             this->outputBox->BackColor = System::Drawing::Color::DarkRed;
  216.             this->outputBox->Location = System::Drawing::Point(12, 189);
  217.             this->outputBox->MaxLength = 99999999;
  218.             this->outputBox->Multiline = true;
  219.             this->outputBox->Name = L"outputBox";
  220.             this->outputBox->Size = System::Drawing::Size(405, 150);
  221.             this->outputBox->TabIndex = 17;
  222.             //
  223.             // label1
  224.             //
  225.             this->label1->AutoSize = true;
  226.             this->label1->BackColor = System::Drawing::Color::Transparent;
  227.             this->label1->ForeColor = System::Drawing::SystemColors::Control;
  228.             this->label1->Location = System::Drawing::Point(9, 4);
  229.             this->label1->Name = L"label1";
  230.             this->label1->Size = System::Drawing::Size(31, 13);
  231.             this->label1->TabIndex = 18;
  232.             this->label1->Text = L"Input";
  233.             //
  234.             // label2
  235.             //
  236.             this->label2->AutoSize = true;
  237.             this->label2->BackColor = System::Drawing::Color::Transparent;
  238.             this->label2->ForeColor = System::Drawing::SystemColors::Control;
  239.             this->label2->Location = System::Drawing::Point(9, 173);
  240.             this->label2->Name = L"label2";
  241.             this->label2->Size = System::Drawing::Size(39, 13);
  242.             this->label2->TabIndex = 19;
  243.             this->label2->Text = L"Output";
  244.             //
  245.             // mainGUI
  246.             //
  247.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  248.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  249.             this->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
  250.             this->ClientSize = System::Drawing::Size(617, 394);
  251.             this->Controls->Add(this->label2);
  252.             this->Controls->Add(this->label1);
  253.             this->Controls->Add(this->outputBox);
  254.             this->Controls->Add(this->inputBox);
  255.             this->Controls->Add(this->xorR);
  256.             this->Controls->Add(this->rc4R);
  257.             this->Controls->Add(this->teaR);
  258.             this->Controls->Add(this->aesR);
  259.             this->Controls->Add(this->CloseB);
  260.             this->Controls->Add(this->decrypt);
  261.             this->Controls->Add(this->encode);
  262.             this->Controls->Add(this->lbox1);
  263.             this->Controls->Add(this->keyBox);
  264.             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;
  265.             this->MaximizeBox = false;
  266.             this->MinimizeBox = false;
  267.             this->Name = L"mainGUI";
  268.             this->Text = L"Atton\'s Encryption Pad v1.0";
  269.             this->ResumeLayout(false);
  270.             this->PerformLayout();
  271.  
  272.         }
  273. #pragma endregion
  274.     // This is for the close button.
  275. private: System::Void CloseB_Click(System::Object^  sender, System::EventArgs^  e)
  276. {
  277.                  mainGUI:Close();
  278. }
  279.  
  280. // CRAP
  281.          /*
  282. private: System::Void inputBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {}
  283. private: System::Void outputBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {}
  284. */
  285.  
  286. // Encode & Decode Buttons
  287. private: System::Void encode_Click(System::Object^  sender, System::EventArgs^  e)
  288. {
  289.     /*
  290.     String ^ data = inputBox->Text;
  291.     string theData(^data);
  292.     */
  293.     //cout << theData << endl;
  294.     cout << getMode() << endl;
  295.  
  296. }
  297.  
  298. private: System::Void decrypt_Click(System::Object^  sender, System::EventArgs^  e)
  299. {
  300.  
  301. }
  302.  
  303. /*
  304. Aes 1
  305. Tea 2
  306. RC4 3
  307. XOR 4
  308. */
  309.  
  310. // MODE
  311. private: System::Void aesR_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {setMode(1);}
  312. private: System::Void teaR_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {setMode(2);}
  313. private: System::Void rc4R_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {setMode(3);}
  314. private: System::Void xorR_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {setMode(4);}
  315.  
  316. };
  317. }
Advertisement
Add Comment
Please, Sign In to add comment