Реферат: Разработка текстового редактора
{
if (OpenDialog->Execute())
{
RichEdit1->Lines->LoadFromFile(OpenDialog->FileName);
FFileName = OpenDialog->FileName;
RichEdit1->SetFocus();
RichEdit1->Modified = false;
RichEdit1->ReadOnly = OpenDialog->Options.Contains(ofReadOnly);
Form1->Caption = OpenDialog->FileName;
}
}
void __fastcall TForm1::FileSave1Execute(TObject *Sender)
{
if (FFileName == LoadStr(sUntitled))
{
FileSaveAs1Execute(Sender);
Form1->Caption = SaveDialog->FileName; }
else
{
RichEdit1->Lines->SaveToFile(FFileName);
RichEdit1->Modified = false; }
}
void __fastcall TForm1::FileSaveAs1Execute(TObject *Sender)
{
String str;
TVarRec vrs[1];
if (SaveDialog->Execute())
{
if (FileExists(SaveDialog->FileName))