Читайте также: |
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, ComCtrls, ImgList, Buttons, ToolWin, ActnList,
StdActns;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
RichEdit1: TRichEdit;
FontDialog1: TFontDialog;
File1: TMenuItem;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
ImageList1: TImageList;
N6: TMenuItem;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
N7: TMenuItem;
ToolBar1: TToolBar;
ToolButton4: TToolButton;
ToolButton8: TToolButton;
Edit1: TEdit;
UpDown1: TUpDown;
ToolButton9: TToolButton;
ActionList1: TActionList;
PopupMenu1: TPopupMenu;
EditCut1: TEditCut;
EditCopy1: TEditCopy;
EditPaste1: TEditPaste;
EditSelectAll1: TEditSelectAll;
EditUndo1: TEditUndo;
EditDelete1: TEditDelete;
N11: TMenuItem;
N31: TMenuItem;
N41: TMenuItem;
N51: TMenuItem;
N61: TMenuItem;
N71: TMenuItem;
ColorSelect1: TColorSelect;
fg1: TMenuItem;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
procedure N4Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton6Click(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure ToolButton10Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N13Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N15Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var a:string;
FileWork: String;
implementation
{$R *.dfm}
procedure TForm1.N3Click(Sender: TObject);
begin
//RichEdit1.PlainText:= True;
if SaveDialog1.Execute
then RichEdit1.Lines.SaveToFile(SaveDialog1.Filename);
end;
procedure TForm1.N4Click(Sender: TObject);
begin
close;
end;
procedure TForm1.N1Click(Sender: TObject);
begin
if OpenDialog1.Execute
then RichEdit1.Lines.LoadFromFile(OpenDialog1.FileName);
Filework:=opendialog1.filename;
end;
procedure TForm1.N2Click(Sender: TObject);
begin
RichEdit1.PlainText:= True;
RichEdit1.Lines.SaveToFile(Filework);
end;
procedure TForm1.ToolButton1Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsBold];
end;
procedure TForm1.ToolButton2Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsItalic];
end;
procedure TForm1.ToolButton3Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsUnderline];
end;
procedure TForm1.ToolButton5Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taLeftJustify;
end;
procedure TForm1.ToolButton6Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taCenter;
end;
procedure TForm1.ToolButton7Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taRightJustify;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
RichEdit1.SelAttributes.Size:=StrToInt(Edit1.Text);
end;
procedure TForm1.ToolButton10Click(Sender: TObject);
begin
if FontDialog1.Execute then RichEdit1.Font:= FontDialog1.Font;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsBold];
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsItalic];
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
RichEdit1.SelAttributes.Style:=[fsUnderline];
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taLeftJustify;
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taCenter;
end;
procedure TForm1.BitBtn6Click(Sender: TObject);
begin
RichEdit1.Paragraph.Alignment:=taRightJustify;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
MessageDlg('Made by Nazar',mtCustom,
[mbOk], 0);
end;
procedure TForm1.N9Click(Sender: TObject);
begin
if FontDialog1.Execute
then RichEdit1.SelAttributes.Assign(FontDialog1.Font);
end;
procedure TForm1.N10Click(Sender: TObject);
begin
richedit1.Font.color:=clred;
N10.checked:=true;
end;
procedure TForm1.N12Click(Sender: TObject);
begin
richedit1.Font.color:=clgreen;
N12.checked:=true;
end;
procedure TForm1.N13Click(Sender: TObject);
begin
richedit1.Font.color:=clblue;
N13.checked:=true;
end;
procedure TForm1.N14Click(Sender: TObject);
begin
richedit1.Font.color:=clyellow;
N14.checked:=true;
end;
procedure TForm1.N15Click(Sender: TObject);
begin
richedit1.Font.color:=clblack;
N15.checked:=true;
end;
end.
Дата добавления: 2015-07-17; просмотров: 82 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Апробація | | | Текст програми |