Dedline № 2
№
|
Bajardi
|
Tekshirdi
|
Dastur
|
Bahosi
|
1
|
620-20-guruh talabasi Maxkamboyeva Gulchexra
|
Qayumov
A
|
Bloknot dasturi
|
|
2
|
|
|
|
|
Dastur Kodi
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Yaratish1Click(TObject *Sender)
{
if (Memo1->Modified==true) {
switch(MessageDlg("Ma'lumotlar o'zgartirildi! Saqlaysizmi?", mtConfirmation, mbYesNoCancel,1))
{
case mrYes: Saqlash1->Click();break;
case mrNo: Memo1->Lines->Clear();break;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ochish1Click(TObject *Sender)
{
OpenTextFileDialog1->Execute();
Memo1->Lines->LoadFromFile(OpenTextFileDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::YangiSaqlash1Click(TObject *Sender)
{
if (SaveTextFileDialog1->Execute()) {
Memo1->Lines->SaveToFile(SaveTextFileDialog1->FileName);
Memo1->Modified=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Saqlash1Click(TObject *Sender)
{
if (OpenTextFileDialog1->FileName.IsEmpty()) {
YangiSaqlash1->Click();
}
else
{
Memo1->Lines->SaveToFile(OpenTextFileDialog1->FileName);
Memo1->Modified=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Chiqish1Click(TObject *Sender)
{
if (Memo1->Modified == true) {
switch(MessageDlg("Ma'lumotlarni Saqlaysizmi?", mtConfirmation, mbYesNoCancel, 1))
{
case mrYes: Saqlash1->Click();break;
case mrNo: Close();break;
case mrCancel: Abort();break;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
int qator = Memo1->Lines->Count;
int simvol = Memo1->Text.Length();
StatusBar1->SimpleText = "Ma'lumotlar " + IntToStr(qator) + " ta qator va " + IntToStr(simvol) + " ta belgidan iborat!!!";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (Memo1->Modified == true) {
switch(MessageDlg("Ma'lumotlarni Saqlaysizmi?", mtConfirmation, mbYesNoCancel, 1))
{
case mrYes: Saqlash1->Click();break;
case mrNo: break;
case mrCancel: Abort();break;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Nusxaolish1Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Kesish1Click(TObject *Sender)
{
Memo1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Qoyish1Click(TObject *Sender)
{
Memo1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Barchasinibelgilash1Click(TObject *Sender)
{
Memo1->SelectAll();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ChopEtish1Click(TObject *Sender)
{
PrintDialog1->Execute();
Form1->Print();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Shrift1Click(TObject *Sender)
{
FontDialog1->Execute();
Memo1->Font = FontDialog1->Font;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::htmlbr1Click(TObject *Sender)
{
if (htmlbr1->Checked==true) {
Memo1->WordWrap = false;
}
else
{
Memo1->WordWrap = true;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MuallifKim1Click(TObject *Sender)
{
StatusBar1->SimpleText = "Muallif: TATUFF Talabasi Xurshidbek Qayumjonov";
}
//---------------------------------------------------------------------------
Do'stlaringiz bilan baham: |