ΠΠ·ΡΡΠ΅Π½ΠΈΠ΅ ΠΏΡΠΈΠ½ΡΠΈΠΏΠ° ΡΠ°Π±ΠΎΡΡ ΡΠ΅ΠΊΡΡΠΎΠ²ΠΎΠ³ΠΎ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠ°
RichEdit1→SelAttributes→Size = StrToInt (ComboBox2→Text); Void __fastcall TForm1: ToolButton7Click (TObject *Sender). Void __fastcall TForm1: ToolButton6Click (TObject *Sender). Void __fastcall TForm1: ToolButton4Click (TObject *Sender). Void __fastcall TForm1: ToolButton3Click (TObject *Sender). Void __fastcall TForm1: ToolButton2Click (TObject *Sender). Void __fastcall TForm1… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΠ·ΡΡΠ΅Π½ΠΈΠ΅ ΠΏΡΠΈΠ½ΡΠΈΠΏΠ° ΡΠ°Π±ΠΎΡΡ ΡΠ΅ΠΊΡΡΠΎΠ²ΠΎΠ³ΠΎ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠ° (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
Π¦Π΅Π»Ρ ΡΠ°Π±ΠΎΡΡ — ΠΏΠΎΠ½ΡΡΡ ΠΎΡΠ½ΠΎΠ²Ρ ΡΠ°Π±ΠΎΡΡ ΠΏΡΠΎΡΡΠ΅ΠΉΡΠ΅Π³ΠΎ ΡΠ΅ΠΊΡΡΠΎΠ²ΠΎΠ³ΠΎ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠ°.
Π’Π΅ΠΎΡΠΈΡ
Π’Π΅ΠΊΡΡΠΎΠ²ΡΠΉ ΡΠ΅Π΄Π°ΠΊΡΠΎΡ — ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΠ½Π°Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°, ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Π½Π°Ρ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΡΠ΅ΠΊΡΡΠΎΠ²ΡΡ ΡΠ°ΠΉΠ»ΠΎΠ², Π° ΡΠ°ΠΊΠΆΠ΅ ΠΈΡ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° Π½Π° ΡΠΊΡΠ°Π½Π΅, Π²ΡΠ²ΠΎΠ΄Π° Π½Π° ΠΏΠ΅ΡΠ°ΡΡ, ΠΏΠΎΠΈΡΠΊΠ° ΡΡΠ°Π³ΠΌΠ΅Π½ΡΠΎΠ² ΡΠ΅ΠΊΡΡΠ° ΠΈ Ρ. ΠΏ.
Π Π°Π·Π»ΠΈΡΠ°ΡΡ Π΄Π²Π° ΡΠΈΠΏΠ° ΡΠ΅ΠΊΡΡΠΎΠ²ΡΡ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠΎΠ².
ΠΠ΅ΡΠ²ΡΠΉ ΡΠΈΠΏ ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½ Π½Π° ΡΠ°Π±ΠΎΡΡ Ρ ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°ΡΠ΅Π»ΡΠ½ΠΎΡΡΡΡ ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ² Π² ΡΠ΅ΠΊΡΡΠΎΠ²ΡΡ ΡΠ°ΠΉΠ»Π°Ρ . Π’Π°ΠΊΠΈΠ΅ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΡ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠΈΠ²Π°ΡΡ ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΡ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΡ — ΠΏΠΎΠ΄ΡΠ²Π΅ΡΠΊΡ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ°, ΡΠΎΡΡΠΈΡΠΎΠ²ΠΊΡ ΡΡΡΠΎΠΊ, ΡΠ°Π±Π»ΠΎΠ½Ρ, ΠΊΠΎΠ½Π²Π΅ΡΡΠ°ΡΠΈΡ ΠΊΠΎΠ΄ΠΈΡΠΎΠ²ΠΎΠΊ, ΠΏΠΎΠΊΠ°Π· ΠΊΠΎΠ΄ΠΎΠ² ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ² ΠΈ Ρ. ΠΏ. ΠΠ½ΠΎΠ³Π΄Π° ΠΈΡ Π½Π°Π·ΡΠ²Π°ΡΡ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠ°ΠΌΠΈ ΠΊΠΎΠ΄Π°, ΡΠ°ΠΊ ΠΊΠ°ΠΊ ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ΅ ΠΈΡ ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ — Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΈΡΡ ΠΎΠ΄Π½ΡΡ ΠΊΠΎΠ΄ΠΎΠ² ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΠ½ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ.
ΠΡΠΎΡΠΎΠΉ ΡΠΈΠΏ ΡΠ΅ΠΊΡΡΠΎΠ²ΡΡ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠΎΠ² ΠΈΠΌΠ΅Π΅Ρ ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠ΅ΠΊΡΡΠ°, Π²Π½Π΅Π΄ΡΠ΅Π½ΠΈΡ Π² Π½Π΅Π³ΠΎ Π³ΡΠ°ΡΠΈΠΊΠΈ ΠΈ ΡΠΎΡΠΌΡΠ», ΡΠ°Π±Π»ΠΈΡ ΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ². Π’Π°ΠΊΠΈΠ΅ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΡ ΡΠ°ΡΡΠΎ Π½Π°Π·ΡΠ²Π°ΡΡ ΡΠ΅ΠΊΡΡΠΎΠ²ΡΠΌΠΈ ΠΏΡΠΎΡΠ΅ΡΡΠΎΡΠ°ΠΌΠΈ ΠΈ ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Ρ ΠΎΠ½ΠΈ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΡΠ°Π·Π»ΠΈΡΠ½ΠΎΠ³ΠΎ ΡΠΎΠ΄Π° Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠΎΠ², ΠΎΡ Π»ΠΈΡΠ½ΡΡ ΠΏΠΈΡΠ΅ΠΌ Π΄ΠΎ ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΡΡ Π±ΡΠΌΠ°Π³. ΠΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΏΡΠΈΠΌΠ΅Ρ — Microsoft Word.
ΠΠ°Π΄Π°Π½ΠΈΠ΅
ΠΡΠΈΠ²Π΅Π΄Π΅Π½Π½Π°Ρ Π½ΠΈΠΆΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅Ρ ΡΠΎΠ±ΠΎΠΉ ΡΠ΅ΠΊΡΡΠΎΠ²ΡΠΉ ΡΠ΅Π΄Π°ΠΊΡΠΎΡ. Π Π°Π·Π±Π΅ΡΠΈΡΠ΅ΡΡ Π² ΠΎΡΠ½ΠΎΠ²Π½ΡΡ ΠΏΡΠΈΠ½ΡΠΈΠΏΠ°Ρ Π΅Π΅ ΡΠ°Π±ΠΎΡΡ. ΠΠΏΠΈΡΠΈΡΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ, ΠΎΠΏΠ΅ΡΠ°ΡΠΎΡΡ, ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΡ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ VCL, ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΈ ΡΠΎΠ±ΡΡΠΈΠΉ. ΠΠ±ΡΡΡΠ½ΠΈΡΠ΅, Π΄Π»Ρ ΡΠ΅Π³ΠΎ ΠΎΠ½ΠΈ Π½ΡΠΆΠ½Ρ Π² Π΄Π°Π½Π½ΠΎΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅.
#include.
#pragma hdrstop.
#include «lab15_task1.h» .
#pragma package (smart_init).
#pragma resource «*.dfm» .
TForm1 *Form1;
AnsiString FileName;
__fastcall TForm1: TForm1(TComponent* Owner).
: TForm (Owner).
{.
FileName = «ΠΠ΅Π·ΡΠΌΡΠ½Π½ΡΠΉ» ;
Form1->Caption = «Π’Π΅ΠΊΡΡΠΎΠ²ΡΠΉ ΡΠ΅Π΄Π°ΠΊΡΠΎΡ — «+ FileName;
ComboBox1->Items->Assign (Screen->Fonts);
}.
void __fastcall TForm1: N8Click (TObject *Sender).
{.
Form1->Close ();
}.
void __fastcall TForm1: N6Click (TObject *Sender).
{.
if (OpenDialog1->Execute ()).
{.
RichEdit1->Lines->LoadFromFile (OpenDialog1->FileName);
FileName = OpenDialog1->FileName;
Form1->Caption = «Π’Π΅ΠΊΡΡΠΎΠ²ΡΠΉ ΡΠ΅Π΄Π°ΠΊΡΠΎΡ — «+.
OpenDialog1->FileName;
}.
}.
void __fastcall TForm1: N7Click (TObject *Sender).
{.
if (RichEdit1->Modified).
{.
if (SaveDialog1->Execute ()).
{.
RichEdit1->Lines->SaveToFile (SaveDialog1->FileName);
RichEdit1->Modified = false;
}.
}.
}.
void __fastcall TForm1: N5Click (TObject *Sender).
{.
if (RichEdit1->Lines->Count > 0).
{.
int answer;
answer = MessageBox (0," Π‘ΠΎΡ ΡΠ°Π½ΠΈΡΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅.
ΠΎΠΊΠ½Π°?" ," Π‘ΠΎΡ ΡΠ°Π½ΠΈΡΡ?", MB_YESNOCANCEL);
if (answer==IDYES).
{.
N7Click (Sender);
RichEdit1->Clear ();
}.
else if (answer==IDNO).
{.
RichEdit1->Clear ();
}.
}.
}.
void __fastcall TForm1: N9Click (TObject *Sender).
{.
if (FileName == «ΠΠ΅Π·ΡΠΌΡΠ½Π½ΡΠΉ.txt»).
{.
N7Click (Sender);
}.
else.
{.
RichEdit1->Lines->SaveToFile (FileName);
}.
}.
void __fastcall TForm1: N10Click (TObject *Sender).
{.
PrinterSetupDialog1->Execute ();
}.
void __fastcall TForm1: N11Click (TObject *Sender).
{.
if (PrintDialog1->Execute ()).
{.
RichEdit1->Print (OpenDialog1->FileName);
}.
}.
void __fastcall TForm1: N12Click (TObject *Sender).
{.
RichEdit1->CutToClipboard ();
}.
void __fastcall TForm1: N13Click (TObject *Sender).
{.
RichEdit1->CopyToClipboard ();
}.
void __fastcall TForm1: N14Click (TObject *Sender).
{.
RichEdit1->PasteFromClipboard ();
}.
void __fastcall TForm1: N16Click (TObject *Sender).
{.
if (N16->Checked).
{.
RichEdit1->WordWrap = false;
N16->Checked = false;
}.
else.
{.
RichEdit1->WordWrap = true;
N16->Checked = true;
}.
}.
void __fastcall TForm1: N15Click (TObject *Sender).
{.
if (FontDialog1->Execute ()).
{.
RichEdit1->Font = FontDialog1->Font;
}.
}.
void __fastcall TForm1: N17Click (TObject *Sender).
{.
RichEdit1->Clear ();
}.
void __fastcall TForm1: N19Click (TObject *Sender).
{.
RichEdit1->Undo ();
}.
void __fastcall TForm1: N20Click (TObject *Sender).
{.
N19Click (Sender);
}.
void __fastcall TForm1: N21Click (TObject *Sender).
{.
N12Click (Sender);
}.
void __fastcall TForm1: N22Click (TObject *Sender).
{.
N13Click (Sender);
}.
void __fastcall TForm1: N23Click (TObject *Sender).
{.
N14Click (Sender);
}.
void __fastcall TForm1: N24Click (TObject *Sender).
{.
N17Click (Sender);
}.
void __fastcall TForm1: N31Click (TObject *Sender).
{.
RichEdit1->SelectAll ();
}.
void __fastcall TForm1: N32Click (TObject *Sender).
{.
N31Click (Sender);
}.
void __fastcall TForm1: ComboBox1Change (TObject *Sender).
{.
RichEdit1->SelAttributes->Name = ComboBox1->Text;
}.
void __fastcall TForm1: ComboBox2Change (TObject *Sender).
{.
RichEdit1->SelAttributes->Size = StrToInt (ComboBox2->Text);
}.
void __fastcall TForm1: N33Click (TObject *Sender).
{.
MessageBox (NULL, «ΠΠ°Π±ΠΎΡΠ°ΡΠΎΡΠ½Π°Ρ ΡΠ°Π±ΠΎΡΠ° № 17 «, «Π ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅…», MB_OK | MB_ICONINFORMATION);
}.
void __fastcall TForm1: ToolButton1Click (TObject *Sender).
{.
N9Click (Sender);
}.
void __fastcall TForm1: ToolButton3Click (TObject *Sender).
{.
N5Click (Sender);
}.
void __fastcall TForm1: ToolButton2Click (TObject *Sender).
{.
N6Click (Sender);
}.
void __fastcall TForm1: N34Click (TObject *Sender).
{.
RichEdit1->Paragraph->Alignment = taLeftJustify;
N34->Checked = true;
N35->Checked = false;
N36->Checked = false;
}.
void __fastcall TForm1: N35Click (TObject *Sender).
{.
RichEdit1->Paragraph->Alignment = taCenter;
N34->Checked = false;
N35->Checked = true;
N36->Checked = false;
}.
void __fastcall TForm1: N36Click (TObject *Sender).
{.
RichEdit1->Paragraph->Alignment = taRightJustify;
N34->Checked = false;
N35->Checked = false;
N36->Checked = true;
}.
void __fastcall TForm1: ToolButton4Click (TObject *Sender).
{.
N34Click (Sender);
}.
void __fastcall TForm1: ToolButton6Click (TObject *Sender).
{.
N35Click (Sender);
}.
void __fastcall TForm1: ToolButton7Click (TObject *Sender).
{.
N36Click (Sender);
}.
void __fastcall TForm1: ToolButton10Click (TObject *Sender).
{.
N10Click (Sender);
}.