Реалізація алгоритмів кодування тексту: шифри Атбаш та Плейфера, страница 10

HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Encrypt, NULL, 0, &id);

}

if (Form1->RadioButton2->Checked == true)

{

CreateR();

DWORD id = 0;

HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Decrypt, NULL, 0, &id);

}

}

}

}

//* Кнопка "Зберегти"                                 *//

void __fastcall TForm1::Button3Click(TObject *Sender)

{

if(Memo3->Modified)

if(SaveDialog1->Execute())

Memo3->Lines->SaveToFile(SaveDialog1->FileName);

}

//* Вибрана функція  "Шифрувати"                    *//

void __fastcall TForm1::RadioButton1Click(TObject *Sender)

{

Form1->Memo2->Clear();

Form1->Memo3->Clear();

Form1->Label2->Caption = Form1->Memo1->Text.Length();

Form1->Label3->Caption = Form1->Memo2->Text.Length();

Form1->Button3->Enabled = false;

Form1->ProgressBar1->Position = 0;

}

//* Вибрана функція  "Розшифрувати"                  *//

void __fastcall TForm1::RadioButton2Click(TObject *Sender)

{

Form1->Memo2->Clear();

Form1->Memo3->Clear();

Form1->Label2->Caption = Form1->Memo1->Text.Length();

Form1->Label3->Caption = Form1->Memo2->Text.Length();

Form1->Button3->Enabled = false;

Form1->ProgressBar1->Position = 0;

}

//* Кнопка "Про програму"                               *//

void __fastcall TForm1::Button4Click(TObject *Sender)

{

AboutBox->ShowModal();

}

//*Кнопка "Очистити"                                  *//

void __fastcall TForm1::Button5Click(TObject *Sender)

{

Form1->Memo1->Clear();

Form1->Label2->Caption = Form1->Memo1->Text.Length();

}

//* Кнопка "Копіювати"                                *//

void __fastcall TForm1::Button6Click(TObject *Sender)

{

Form1->Memo1->Text = Form1->Memo2->Text;

Form1->Memo2->Clear();

Form1->Memo3->Clear();

Form1->Label2->Caption = Form1->Memo1->Text.Length();

Form1->Label3->Caption = Form1->Memo2->Text.Length();

}

//--------------------------------------------------------------------------//* Зміна вкладки в програмі                                  *//

void __fastcall TForm1::TabControl1Change(TObject *Sender)

{

if(TabControl1->TabIndex==0)

{

GroupBox1->Visible=true;

GroupBox2->Visible=true;

GroupBox3->Visible=true;

RadioButton1->Visible=true;

RadioButton2->Visible=true;

RadioGroup1->Visible=true;

Button7->Visible=false;

Button4->Visible=false;

Edit2->Visible=false;

Edit3->Visible=false;

Label4->Visible=false;

Label5->Visible=false;

}

if(TabControl1->TabIndex==1)

{

GroupBox1->Visible=false;

GroupBox2->Visible=false;

GroupBox3->Visible=false;

Button7->Visible=true;

Button4->Visible=true;

Edit2->Visible=true;

Edit3->Visible=true;

Label4->Visible=true;

Label5->Visible=true;

RadioButton1->Visible=false;

RadioButton2->Visible=false;

RadioGroup1->Visible=false;

}

}

//--------------------------------------------------------------------------void __fastcall TForm1::N7Click(TObject *Sender)

{

ShowMessage("Зкрити програму?");

Close();

}

//--------------------------------------------------------------------------void __fastcall TForm1::N2Click(TObject *Sender)

{

if(SaveDialog1->Execute())

Memo3->Lines->SaveToFile(SaveDialog1->FileName);

}

//--------------------------------------------------------------------------void __fastcall TForm1::N3Click(TObject *Sender)

{

if(SaveDialog1->Execute())

Memo3->Lines->SaveToFile(SaveDialog1->FileName);

}

//--------------------------------------------------------------------------void __fastcall TForm1::N4Click(TObject *Sender)

{

Form1->Memo1->Text = Form1->Memo2->Text;

Form1->Memo2->Clear();

Form1->Memo3->Clear();

Form1->Label2->Caption = Form1->Memo1->Text.Length();

Form1->Label3->Caption = Form1->Memo2->Text.Length();

}

//---------------------------------------------------------------------------