//--------------------------------------------------------------------- #include #pragma hdrstop #include "MainForm.h" #include "AniSet.h" #include //--------------------------------------------------------------------- #pragma resource "*.dfm" TAnimSet *AnimSet; //--------------------------------------------------------------------- __fastcall TAnimSet::TAnimSet(TComponent* AOwner) : TForm(AOwner) { } //--------------------------------------------------------------------- void __fastcall TAnimSet::OKClick(TObject *Sender) { if (MainFrm->ActiveMDIChild == NULL) return; TChildImage *Child = (TChildImage *)MainFrm->ActiveMDIChild; Child->LEADImage1->AnimationBackColor = BackGrnClr->Color; Child->LEADImage1->AnimationWidth = StrToInt(Text3->Text); Child->LEADImage1->AnimationHeight = StrToInt(Text4->Text); Child->LEADImage1->AnimationBitsPerPixel = StrToInt(Combo1->Items->Strings[Combo1->ItemIndex]); } //--------------------------------------------------------------------------- void __fastcall TAnimSet::FormCreate(TObject *Sender) { if (MainFrm->ActiveMDIChild == NULL) return; TChildImage *Child = (TChildImage *)MainFrm->ActiveMDIChild; BackGrnClr->Color = Child->LEADImage1->AnimationBackColor; Text3->Text = IntToStr(Child->LEADImage1->AnimationWidth); Text4->Text = IntToStr(Child->LEADImage1->AnimationHeight); for(int i = 0; i < Combo1->Items->Count; i++) { if (Child->LEADImage1->AnimationBitsPerPixel == StrToInt(Combo1->Items->Strings[i])) { Combo1->ItemIndex = i; return; } } } //--------------------------------------------------------------------------- void __fastcall TAnimSet::Text3Change(TObject *Sender) { if (Text3->Text.Length() == 0) OK->Enabled = false; else OK->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TAnimSet::Text3KeyPress(TObject *Sender, char &Key) { if (!((Key >= '0') && (Key <= '9')) && (Key != ' ') && (Key != '\b')) Key = NULL; } //--------------------------------------------------------------------------- void __fastcall TAnimSet::Text4Change(TObject *Sender) { if (Text4->Text.Length() == 0) OK->Enabled = false; else OK->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TAnimSet::Text4KeyPress(TObject *Sender, char &Key) { if (!((Key >= '0') && (Key <= '9')) && (Key != ' ') && (Key != '\b')) Key = NULL; } //--------------------------------------------------------------------------- void __fastcall TAnimSet::BackgroundColorClick(TObject *Sender) { if (ColorDialog->Execute() == true) BackGrnClr->Color = ColorDialog->Color; } //---------------------------------------------------------------------------