#pragma once
#include <iostream>
#include "string.h"
#include "BinaryTree.h"
#include "DataMerge.h"
using namespace std;
namespace MyTree {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
dataentry = new CBinaryTree();
//pData = new CDataMerge();
}
public:
//CDataMerge *pData;
CBinaryTree *dataentry;
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^ StudentTxt;
protected:
private: System::Windows::Forms::Label^ IDlbl;
private: System::Windows::Forms::TextBox^ LastTxt;
private: System::Windows::Forms::TextBox^ FirstTxt;
protected:
private: System::Windows::Forms::TextBox^ textBox4;
private: System::Windows::Forms::Label^ Lastlbl;
private: System::Windows::Forms::Label^ Firstlbl;
private: System::Windows::Forms::Label^ Degreelbl;
private: System::Windows::Forms::Button^ SubmitBtn;
private: System::Windows::Forms::Button^ SearchBtn;
private: System::Windows::Forms::Button^ ClearBtn;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->StudentTxt = (gcnew System::Windows::Forms::TextBox());
this->IDlbl = (gcnew System::Windows::Forms::Label());
this->LastTxt = (gcnew System::Windows::Forms::TextBox());
this->FirstTxt = (gcnew System::Windows::Forms::TextBox());
this->textBox4 = (gcnew System::Windows::Forms::TextBox());
this->Lastlbl = (gcnew System::Windows::Forms::Label());
this->Firstlbl = (gcnew System::Windows::Forms::Label());
this->Degreelbl = (gcnew System::Windows::Forms::Label());
this->SubmitBtn = (gcnew System::Windows::Forms::Button());
this->SearchBtn = (gcnew System::Windows::Forms::Button());
this->ClearBtn = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// StudentTxt
//
this->StudentTxt->Location = System::Drawing::Point(113, 33);
this->StudentTxt->Name = L"StudentTxt";
this->StudentTxt->Size = System::Drawing::Size(76, 20);
this->StudentTxt->TabIndex = 0;
//
// IDlbl
//
this->IDlbl->AutoSize = true;
this->IDlbl->Location = System::Drawing::Point(12, 40);
this->IDlbl->Name = L"IDlbl";
this->IDlbl->Size = System::Drawing::Size(56, 13);
this->IDlbl->TabIndex = 1;
this->IDlbl->Text = L"Student Id";
//
// LastTxt
//
this->LastTxt->Location = System::Drawing::Point(113, 88);
this->LastTxt->Name = L"LastTxt";
this->LastTxt->Size = System::Drawing::Size(100, 20);
this->LastTxt->TabIndex = 2;
this->LastTxt->UseWaitCursor = true;
//
// FirstTxt
//
this->FirstTxt->Location = System::Drawing::Point(328, 86);
this->FirstTxt->Name = L"FirstTxt";
this->FirstTxt->Size = System::Drawing::Size(100, 20);
this->FirstTxt->TabIndex = 3;
//
// textBox4
//
this->textBox4->Location = System::Drawing::Point(113, 141);
this->textBox4->Name = L"textBox4";
this->textBox4->Size = System::Drawing::Size(100, 20);
this->textBox4->TabIndex = 4;
//
// Lastlbl
//
this->Lastlbl->AutoSize = true;
this->Lastlbl->Location = System::Drawing::Point(21, 93);
this->Lastlbl->Name = L"Lastlbl";
this->Lastlbl->Size = System::Drawing::Size(58, 13);
this->Lastlbl->TabIndex = 5;
this->Lastlbl->Text = L"Last Name";
//
// Firstlbl
//
this->Firstlbl->AutoSize = true;
this->Firstlbl->Location = System::Drawing::Point(256, 94);
this->Firstlbl->Name = L"Firstlbl";
this->Firstlbl->Size = System::Drawing::Size(57, 13);
this->Firstlbl->TabIndex = 6;
this->Firstlbl->Text = L"First Name";
//
// Degreelbl
//
this->Degreelbl->AutoSize = true;
this->Degreelbl->Location = System::Drawing::Point(29, 149);
this->Degreelbl->Name = L"Degreelbl";
this->Degreelbl->Size = System::Drawing::Size(42, 13);
this->Degreelbl->TabIndex = 7;
this->Degreelbl->Text = L"Degree";
//
// SubmitBtn
//
this->SubmitBtn->Location = System::Drawing::Point(24, 198);
this->SubmitBtn->Name = L"SubmitBtn";
this->SubmitBtn->Size = System::Drawing::Size(85, 26);
this->SubmitBtn->TabIndex = 8;
this->SubmitBtn->Text = L"SUBMIT";
this->SubmitBtn->UseVisualStyleBackColor = true;
this->SubmitBtn->Click += gcnew System::EventHandler(this, &Form1::SubmitBtn_Click);
//
// SearchBtn
//
this->SearchBtn->Location = System::Drawing::Point(184, 198);
this->SearchBtn->Name = L"SearchBtn";
this->SearchBtn->Size = System::Drawing::Size(99, 26);
this->SearchBtn->TabIndex = 9;
this->SearchBtn->Text = L"SEARCH";
this->SearchBtn->UseVisualStyleBackColor = true;
this->SearchBtn->Click += gcnew System::EventHandler(this, &Form1::SearchBtn_Click);
//
// ClearBtn
//
this->ClearBtn->Location = System::Drawing::Point(346, 198);
this->ClearBtn->Name = L"ClearBtn";
this->ClearBtn->Size = System::Drawing::Size(81, 26);
this->ClearBtn->TabIndex = 10;
this->ClearBtn->Text = L"CLEAR";
this->ClearBtn->UseVisualStyleBackColor = true;
this->ClearBtn->Click += gcnew System::EventHandler(this, &Form1::ClearBtn_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(462, 293);
this->Controls->Add(this->ClearBtn);
this->Controls->Add(this->SearchBtn);
this->Controls->Add(this->SubmitBtn);
this->Controls->Add(this->Degreelbl);
this->Controls->Add(this->Firstlbl);
this->Controls->Add(this->Lastlbl);
this->Controls->Add(this->textBox4);
this->Controls->Add(this->FirstTxt);
this->Controls->Add(this->LastTxt);
this->Controls->Add(this->IDlbl);
this->Controls->Add(this->StudentTxt);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
char value1;
char value2;
//char result;
private: System::Void SubmitBtn_Click(System::Object^ sender, System::EventArgs^ e)
{
value1=NULL;
String ^buf = LastTxt->Text->ToString();
value1 = Convert::ToInt32(buf);
const char* TextBuffer = (const char*)
(Marshal::StringToHGlobalAnsi(buf)).ToPointer();
strcpy_s (MyData->insert, TextBuffer);
//Marshal::FreeHGlobal(IntPtr((void*)TextBuffer));
CBinaryTree<string> tree1;
tree1.insert(TextBuffer);
//String ^buf = FirstTxt->Text->ToString();
}
private: System::Void SearchBtn_Click(System::Object^ sender, System::EventArgs^ e)
{
}
private: System::Void ClearBtn_Click(System::Object^ sender, System::EventArgs^ e)
{
}
};
}