lick (Sender: TObject); FormCreate (Sender : TObject); btnAddDictonaryClick (Sender: TObject); RichEdit1Change (Sender: TObject);
{Private declarations}
{Public declarations};: TForm1;: array [1 .. 200] of string;
{$ R *. dfm} TForm1.btnOpenClick (Sender: TObject); OpenDialog1.Execute then.Caption: = OpenDialog1.FileName;. Lines.LoadFromFile (OpenDialog1.FileName);. SelStart: = 0;. Panels [0]. Text: = 'Файл завантажений';. Enabled: = true;;; TForm1.btnSaveClick (Sender: TObject);. FileName: = Form1.Caption; SaveDialog1.Execute then.Lines.SaveToFile ( SaveDialog1.FileName + '. txt');. Caption: = SaveDialog1.FileName;. Panels [0]. Text: = 'Файл збережений';;; TForm1.btnExitClick (Sender: TObject);. Terminate;; TForm1.FormCreate (Sender: TObject); OpenDialog1 do: = Options + [ofPathMustExist, ofFileMustExist];: = ExtractFilePath (Application.ExeName);: = 'Текстові файли (*. txt) | *. txt | Всі файли (*) | *' ;; OpenDialog2 do: = Options + [ofPathMustExist, ofFileMustExist];: = ExtractFilePath (Application.ExeName);: = 'Файл словника (*. nbdic) | *. nbdic';; SaveDialog1 do: = ExtractFilePath (Application.ExeName) ;: = 'Текстовий файл (*. txt) | *. txt';;; TForm1.btnAddDictonaryClick (Sender: TObject);: integer;: TStringList; OpenDialog2.Execute then: = TStringList.Create;. LoadFromFile (OpenDialog2.FileName );. Panels [0]. Text: = 'Словник завантажений. Написано слів: '+ IntToStr (strList.Count); i: = 0 to strList.Count-1 do [i]: = strList [i];. Free;. Enabled: = false;;; TForm1.RichEdit1Change (Sender: TObject);, foundAt, curPos, i: integer;. OnChange: = nil;. Lines.BeginUpdate;: = RichEdit1.SelStart;. SelectAll;. SelAttributes.Style: = RichEdit1.SelAttributes.Style - [FsBold];. SelAttributes . Color: = clBlack; i: = Low (word) to High (word) do: = RichEdit1.FindText (word [i], 0, Length (RichEdit1.Text), [StWholeWord]); foundAt <> - 1 do.SelStart: = foundAt;. SelLength: = Length (word [i]);. SelAttributes.Style: = RichEdit1.SelAttributes.Style + [FsBold];. SelAttributes.Color: = clRed;: = RichEdit1.FindText ( word [i], foundAt + 1, Length (RichEdit1.Text), [StWholeWord]);;;. SelStart: = curPos;. Lines.EndUpdate;. OnChange: = RichEdit1Change;;;.