void __fastcall TForm1::N19Click(TObject *Sender) { FindDialog1->Position = Point(RichEdit1->Left + RichEdit1->Width, RichEdit1->Top); FindDialog1->Execute(); } //--------------------------------------------------------------------------- void __fastcall TForm1::N30Click(TObject *Sender) { if(FontDialog1->Execute()) { RichEdit1->SelAttributes->Assign(FontDialog1->Font); } } //--------------------------------------------------------------------------- void __fastcall TForm1::N28Click(TObject *Sender) { Application->CreateForm(__classid(TAboutBox), &AboutBox); AboutBox->ShowModal(); AboutBox->Free(); } //--------------------------------------------------------------------------- void __fastcall TForm1::N7Click(TObject *Sender) { if (PrintDialog1->Execute()) RichEdit1->Print(" "); } //--------------------------------------------------------------------------- void __fastcall TForm1::N24Click(TObject *Sender) { StatusBar1->Visible=! StatusBar1->Visible; N24->Checked=! N24->Checked; } //--------------------------------------------------------------------------- void __fastcall TForm1::N22Click(TObject *Sender) { Panel1->Visible=! Panel1->Visible; N22->Checked=! N22->Checked; } //--------------------------------------------------------------------------- void __fastcall TForm1::N23Click(TObject *Sender) { Panel2->Visible=! Panel2->Visible; N23->Checked=! N23->Checked; } //--------------------------------------------------------------------------- void __fastcall TForm1::SpeedButton16Click(TObject *Sender) { if(ColorDialog1->Execute()) {RichEdit1->Color=ColorDialog1->Color;} } //--------------------------------------------------------------------------- void __fastcall TForm1::SpeedButton17Click(TObject *Sender) { RichEdit1->Paragraph->Alignment=taLeftJustify; } //--------------------------------------------------------------------------- void __fastcall TForm1::SpeedButton18Click(TObject *Sender) { RichEdit1->Paragraph->Alignment=taCenter; } //--------------------------------------------------------------------------- void __fastcall TForm1::SpeedButton19Click(TObject *Sender) { if(SpeedButton11->Down==true) { RichEdit1->Paragraph->Numbering=nsBullet; } else { RichEdit1->Paragraph->Numbering=nsNone; } } //--------------------------------------------------------------------------- void __fastcall TForm1::SpeedButton15Click(TObject *Sender) { RichEdit1->Paragraph->Alignment=taRightJustify; } //--------------------------------------------------------------------------- void __fastcall TForm1::CSpinEdit1KeyPress(TObject *Sender, char &Key) { if((Key!=VK_BACK)&&(Key!='9')&&(Key!='8')&&(Key!='7')&&(Key!='6')) { Set <char, '0','9'> Dig; Dig << '0'<< '1'<< '2' << '3'<< '4' << '5'<< ' 6 '<< ' 7 '<< ' 8 '<< ' 9 ' ; if ( ! Dig.Contains(Key)) { Key = 0; Beep () ;} } } //--------------------------------------------------------------------------- void __fastcall TForm1::FormShow(TObject *Sender) { int i; for (i=0; i<Screen->Fonts->Count; i++) { ComboBox1->Items->Add (Screen->Fonts->Strings[i] ) ; } CSpinEdit1->Value=RichEdit1->SelAttributes->Size; } продолжение
|