if(r == mrYes){
Save1->Click();
}else if(r == mrCancel){
CanClose = false ;
}
}
RichEdit1->Text = "";
RichEdit1->Modified = False;
filename = "" ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Exit1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::WordWrap1Click(TObject *Sender)
{
WordWrap1->Checked = !WordWrap1->Checked ;
RichEdit1->WordWrap = WordWrap1->Checked ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
StatusBar1->Panels->Items[1]->Text = RichEdit1->Text.Length();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Cut1Click(TObject *Sender)
{
RichEdit1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Copy1Click(TObject *Sender)
{
RichEdit1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Paste1Click(TObject *Sender)
{
RichEdit1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SelectAll1Click(TObject *Sender)
{
RichEdit1->SelectAll();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Font1Click(TObject *Sender)
{
FontDialog1->Execute();
RichEdit1->Font = FontDialog1->Font ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Delete1Click(TObject *Sender)
{
RichEdit1->Lines->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::imeDate1Click(TObject *Sender)
{
StatusBar1->Panels->Items[2]->Text = Now();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Find1Click(TObject *Sender)
{
FindDialog1->FindText = RichEdit1->SelText;
FindDialog1->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ReplaceDialog1Replace(TObject *Sender)
{
RichEdit1->SetFocus();
if (RichEdit1->SelText != "")
{
RichEdit1->SelText = ReplaceDialog1->ReplaceText;
if (ReplaceDialog1->Options.Contains(frReplaceAll))
RichEdit1->SelStart += ReplaceDialog1->ReplaceText.Length();
}
else if (ReplaceDialog1->Options.Contains(frReplace))
{
ShowMessage("Текст '" + ReplaceDialog1->FindText + "' не найден");
return;
}
if (ReplaceDialog1->Options.Contains(frReplaceAll))
FindDialog1Find(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FindDialog1Find(TObject *Sender)
{
int FoundAt, StartPos, ToEnd;
TSearchTypes Option;
TReplaceDialog *dlg = (TReplaceDialog *)Sender;
StartPos = RichEdit1->SelStart;
if (RichEdit1->SelLength) StartPos += RichEdit1->SelLength;
ToEnd = RichEdit1->Text.Length() - StartPos;
if (dlg->Options.Contains(frWholeWord))
Option << stWholeWord;
else Option >> stWholeWord;
if (dlg->Options.Contains(frMatchCase))
Option << stMatchCase;
else Option >> stMatchCase;
FoundAt = RichEdit1->FindText(dlg->FindText, StartPos, ToEnd, Option);
if (FoundAt != -1) // если найдено
{
RichEdit1->SelStart = FoundAt;
RichEdit1->SelLength = dlg->FindText.Length();
if ((dlg->Name == "ReplaceDialog1")&&(dlg->Options.Contains(frReplaceAll)))
ReplaceDialog1Replace(Sender);
}
else ShowMessage("Текст '" + dlg->FindText +
"' не найден");
RichEdit1->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Left1Click(TObject *Sender)
{
RichEdit1->Paragraph->Alignment = taLeftJustify ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Right1Click(TObject *Sender)
{
RichEdit1->Paragraph->Alignment = taRightJustify ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Centr1Click(TObject *Sender)
{
RichEdit1->Paragraph->Alignment = taCenter ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Information1Click(TObject *Sender)
{
ShowMessage("Ushbu dastur 612-19 guruh talabasi Umidjon Mirzarahimov tomonidan yasalgan !!! Tushunmovchiliklar bo`lsa Telegram orqali @Umidjon_Mirzarahimov ga murojat qilishingiz mumkin .") ;
}
//---------------------------------------------------------------------------
Do'stlaringiz bilan baham: