void AddEffectInfoDialog::OnInitDialog(wxInitDialogEvent &e) { wxDialog::OnInitDialog(e); wxSizer* sizer = new wxBoxSizer( wxVERTICAL ); wxFlexGridSizer *item1 = new wxFlexGridSizer( 2, 0, 0 ); wxComboBox *item2 = new wxComboBox( this, feID_COMBOCTRL_EFFECT, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, NULL, wxCB_DROPDOWN ); item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 ); wxComboBox *item3 = new wxComboBox( this, feID_COMBOCTRL_LOCATOR, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, NULL, wxCB_DROPDOWN ); item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 ); sizer->Add( item1, 0, wxALIGN_CENTER|wxALL, 10 ); wxFlexGridSizer *item5 = new wxFlexGridSizer( 2, 0, 0 ); wxButton *item6 = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 ); item6->SetDefault(); item5->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 ); wxButton *item7 = new wxButton( this, wxID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); sizer->Add( item5, 0, wxALIGN_CENTER|wxALL, 10 ); this->SetSizer( sizer ); sizer->SetSizeHints( this ); Fairy::EffectManager::EffectTemplateIterator it = Fairy::EffectManager::getSingleton().getEffectTemplateIterator(); while ( it.hasMoreElements() ) { item2->AppendString(it.peekNextKey().c_str()); it.moveNext(); } item2->SetSelection(0); SkillObjectEditor* pEditor= static_cast<SkillObjectEditor*>(this->GetParent()); if(!pEditor) return; Fairy::LogicModel *pMbject = pEditor->GetParentFrame()->GetActorSettingEditor()->GetActorObject(); assert (pMbject); Ogre::StringVector boneNameList; for ( unsigned short i=0; i<pMbject->getNumBones(); ++i ) { boneNameList.push_back(pMbject->getBoneName(i)); } Ogre::StringVector locatorNames; pMbject->getLocatorNames(locatorNames); for ( size_t i=0; i<locatorNames.size(); ++i ) { Fairy::LogicModel::LocatorValue value; if(pMbject->getLocatorInfo(locatorNames[i], value)) { if(value.mBoneName != "" ) { for ( int index=0; index<(int)boneNameList.size(); ++index ) { if (boneNameList[index] == value.mBoneName) { // info of the locator is valid item3->Append(locatorNames[i].c_str()); break; } } } } } item3->SetSelection(0); }