PrinterSetupDialog ;: TPopupMenu ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem ;: TMenuItem; FormCreate (Sender: TObject); New1Click (Sender: TObject); Undo1Click (Sender: TObject); Cut1Click (Sender: TObject); Copy1Click (Sender:TObject); Paste1Click (Sender: TObject); AlignLeft1Click (Sender: TObject); AlignRight1Click (Sender: TObject); AlignCenter1Click (Sender: TObject); WordWrap1Click (Sender: TObject); Exit1Click (Sender: TObject); Edit1Click (Sender: TObject); SelectAll1Click (Sender: TObject); Clear1Click (Sender: TObject); Memo1Change (Sender: TObject); FormResize (Sender: TObject); Open1Click (Sender: TObject); Save1Click (Sender: TObject); CountChars1Click (Sender: TObject ); Font1Click (Sender: TObject); Print1Click (Sender: TObject); FormCloseQuery (Sender: TObject; var CanClose: Boolean); SaveAs1Click (Sender: TObject); ReadOnly1Click (Sender: TObject); About1Click (Sender: TObject); Cut2Click (Sender: TObject); Copy2Click (Sender: TObject); Paste2Click (Sender: TObject); SelectAll2Click ( Sender: TObject); PopupMenu1Popup (Sender: TObject) ;: string ;: bool; SaveChanges: Boolean; Save: Boolean; SaveAs: Boolean ;;: TForm1;
{$ R * .DFM} TForm1.FormCreate (Sender: TObject) ;. Filter:= Text Document (* .txt) | * .txt raquo ;;. InitialDir:=GetCurrentDir () ; .DefaultExt:= .txt raquo ;;. Filter:= Text Document (* .txt) | * .txt raquo ;;. InitialDir:=GetCurrentDir () ;. DefaultExt:= .txt raquo ;;. ScrollBars :=ssVertical; .WordWrap:=True; .SelStart:=0; .Checked:=True; .Checked:=True; .Caption:= Notepad - + Untitled raquo ;;:= Untitled ;; TForm1.New1Click (Sender: TObject) ;. Text:= raquo ;;:=False;:= Untitled raquo ;;. Caption:= Notepad - + Untitled raquo ;;; TForm1. Undo1Click (Sender: TObject); (Memo1.Handle, WM_UNDO, 0,0) ;; TForm1.Cut1Click (Sender: TObject) ;. CutToClipboard ;; TForm1.Copy1Click (Sender: TObject) ;. CopyToClipboard ;; TForm1.Paste1Click ( Sender: TObject) ;. PasteFromClipboard ;; TForm1.AlignLeft1Click (Sender: TObject) ;. Alignment:=taLeftJustify; .Checked:=True; .Checked:=False; .Checked:=False ;; TForm1.AlignRight1Click (Sender: TObject ) ;. Alignment:=taRightJustify; .Checked:=False; .Checked:=True; .Checked:=False ;; TForm1.AlignCenter1Click (Sender: TObject) ;. Alignment:=taCenter; .Checked:=False; .Checked :=False; .Checked:=True ;; TForm1.WordWrap1Click (Sender: TObject); Memo1.WordWrap then.WordWrap:=False; .Checked:=False; .ScrollBars:=ssBoth; .WordWrap:=True; .Checked :=True; .ScrollBars:=ssVertical ;;; TForm1.Exit1Click (Sender: TObject) ;;; TForm1.Edit1Click (Sender: TObject) ;: String;
{if some text is selected in the memo, the cut and copy commands} Memo1.SelLength gt; 0 then begin.Enabled:=True; .Enabled:=True; .Enabled:=False; .Enabled:=False ;;
{if the clipboard contains some text, the Paste command} Clipboard.HasFormat (CF_TEXT) then.Enabled:=True.Enabled:=False;:=Memo1.Text; Length (Trim (sMemo) ) gt; 0 then begin.Enabled:=True; .Enabled:=True; .Enabled:=False; .Enabled:=False ;;; TForm1.SelectAll1Click (Sender: TObject) ;. SelectAll ;; TForm1.Clear1Click (Sender: TObject) ; .Text:= raquo ;;:=False ;; TForm1.Memo1Change (Sender: TObject);:=True ;; TForm1.FormResize (Sender: TObject) ;. Width:=Form1.ClientWidth + 1; .Height :=Form1.ClientHeight + 1 ;; TForm1.Open1Click (Sender: TObject); OpenDialog1.Execute Then begin.Caption:= Notepad - + OpenDialog1.FileName; .Lines.LoadFromFile (OpenDialog1.Filename) ;. SelStart:=0;:=OpenDialog1.FileName ;;; TForm1.Save1Click (Sender: TObject); modified then ;; TForm1.CountChars1Click (Sender: TObject);:String; (Memo1.GetTextLen, text); ( Your Document Has + text + Characters ,, [mbOK], 0) ;; TForm1.Font1Click (Sender: TObject) ;. Font:=Memo1.Font; FontDialog1.Execute then begin.Font:=FontDialog1.Font ;;; TForm1.Print1Click (Sender: TObject) ;: String ;: TextFile ;: Integer;:=Memo1.Text; Length (Trim (sMemo))= 0 Then ( No Text To Print , mtError, [MBOK], 0); Length (Trim (sMemo)) lt; gt; 0 ThenPrinterSetupDialog1.Execute then begin (filename); (filename); x:=0 to Memo1.Lines.Count - 1 do (filename, Memo1.Lines [x]); (filename) ;;; TForm1.FormCloseQuery (Sender: TObject; var CanClose: Boolean); modified thenSaveChanges then:=True:=False:=True ;; TForm1.SaveChanges: Boolean ;: Integer;:=True;:=MessageDlg (filename + has changed. Do you want to save the changes? ,, mbYesNoCancel, 0); (code=IDYES) then:=Save; (code=IDCANCEL) then:=False ;; TForm1.Save: Boolean; filename= then:=SaveAs:=False; .Lines.SaveToFile (filename);:=True ;;; TForm1.SaveAs: Boolean; .FileName:=filename; SaveDialog1.Execute then:=SaveDialog1.FileName; .Lines.SaveToFile (filename );:=False; .Caption:= Notepad - + SaveDialog1.filename;:=True;:=False ;; TForm1.SaveAs1Click (Sender: TObject) ;;; TForm1.ReadOnly1Click (Sender: TObject);.Rea...