//--------------------------------------------------------------------- #include "all.h" //--------------------------------------------------------------------- #pragma resource "*.dfm" TCtrAnimationDlg *CtrAnimationDlg; //--------------------------------------------------------------------- __fastcall TCtrAnimationDlg::TCtrAnimationDlg(TComponent* AOwner) : TForm(AOwner) { } //--------------------------------------------------------------------- void __fastcall TCtrAnimationDlg::OnShow(TObject *Sender) { SourceImageLstBox->Clear(); AnimationImageLstBox->Clear(); for (L_INT i=0;i MDIChildCount;i++) { SourceImageLstBox->Items->Add(MainForm->MDIChildren[i]->Caption); ListBox_SetItemData(SourceImageLstBox->Handle,i,(int)MainForm->MDIChildren[i]); } SourceImageLstBox->ItemIndex = 0; AddBtn->Enabled = (SourceImageLstBox->Items->Count>0); RemoveBtn->Enabled = FALSE; OKBtn->Enabled = FALSE; } //--------------------------------------------------------------------------- void __fastcall TCtrAnimationDlg::AddBtnClick(TObject *Sender) { for (L_INT i=0; i < SourceImageLstBox->Items->Count; i++) if (SourceImageLstBox->Selected[i]) { L_INT nIndex = AnimationImageLstBox->Items->Add(SourceImageLstBox->Items->Strings[i]); ListBox_SetItemData(AnimationImageLstBox->Handle,nIndex, ListBox_GetItemData(SourceImageLstBox->Handle,i)); } OKBtn->Enabled = (AnimationImageLstBox->Items->Count>1); RemoveBtn->Enabled = (AnimationImageLstBox->Items->Count>0); } //--------------------------------------------------------------------------- void __fastcall TCtrAnimationDlg::RemoveBtnClick(TObject *Sender) { for(L_INT i=AnimationImageLstBox->Items->Count-1 ;i>=0;i--) if(AnimationImageLstBox->Selected[i]) AnimationImageLstBox->Items->Delete(i); OKBtn->Enabled = (AnimationImageLstBox->Items->Count>1); RemoveBtn->Enabled = (AnimationImageLstBox->Items->Count>0); } //--------------------------------------------------------------------------- void __fastcall TCtrAnimationDlg::OKBtnClick(TObject *Sender) { TMDIChild* Child; LBitmapBase Bitmap; m_BitmapList.Create(); L_INT nCount = AnimationImageLstBox->Items->Count; for (L_INT i=0; iHandle,i); if(Child==NULL) continue; Bitmap = Child->m_LAniWnd; // copy the bitmap m_BitmapList.InsertItem(&Bitmap, i); } m_BitmapList.SetCurrentIndex(0); } //---------------------------------------------------------------------------