#pragma hdrstop
#include "Unit3.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
AnsiString fileName= "Yangi hujjat";
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Shrift2Click(TObject *Sender)
{
FontDialog1->Font=Memo1->Font;
if( FontDialog1->Execute()){
Memo1->Font = FontDialog1->Font;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Nusxalash1Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Qirqibolish1Click(TObject *Sender)
{
Memo1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Joylash1Click(TObject *Sender)
{
Memo1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Barchasinibelgilash1Click(TObject *Sender)
{
Memo1->SelectAll();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Saqlash2Click(TObject *Sender)
{
if(SaveDialog1->Execute()){
fileName=SaveDialog1->FileName + ".txt";
Memo1->Lines->SaveToFile(fileName);
Caption=ExtractFileName(fileName);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Saqlash1Click(TObject *Sender)
{
if(fileName =="Yangi hujjat"){
Saqlash2->Click();
} else{
Memo1->Lines->SaveToFile(fileName);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Yangi2Click(TObject *Sender)
{
int abs = MessageDlg("O'zgarishlar saqlansinmi ?", mtInformation, TMsgDlgButtons()<if( abs == mrYes){
Saqlash1->Click();
if ( OpenDialog1->Execute()){
fileName = OpenDialog1->FileName;
Memo1->Lines->LoadFromFile(fileName);
Caption = ExtractFileName(fileName);
}
} else if(abs == mrNo) {
if ( OpenDialog1->Execute()){
fileName = OpenDialog1->FileName;
Memo1->Lines->LoadFromFile(fileName);
Caption = ExtractFileName(fileName);
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Yangi1Click(TObject *Sender)
{
int abs = MessageDlg("O'zgarishlar saqlansinmi ?", mtInformation, TMsgDlgButtons()<if( abs == mrYes){
Saqlash1->Click();
fileName ="Yangi hujjat";
Caption = fileName;
Memo1->Clear();
} else if(abs == mrNo) {
fileName ="Yangi hujjat";
Caption = fileName;
Memo1->Clear();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Chiqish1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::FormClose(TObject *Sender, TCloseAction &Action)
{
if(Memo1->Modified){
int abs = MessageDlg("O'zgarishlar saqlansinmi ?", mtInformation, TMsgDlgButtons()<if( abs == mrYes){
Saqlash1->Click();
} else if(abs == mrCancel) {
Abort();
}
}
else{
Form3->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Dasturxaqida1Click(TObject *Sender)
{
Form1->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Yordam1Click(TObject *Sender)
{
ShowMessage("Dasturda muammolar bo'lsa abrorbekkamolov2@gmail.com ga murojat qiling");
}
//---------------------------------------------------------------------------
Blaknotimiz tayyor!