void PanelObjectList::OnTreeEndLabelEdit(wxTreeEvent& event) { wxTreeItemId id = event.GetItem(); TreeItemDataGenericObjectInfo* pData = (TreeItemDataGenericObjectInfo*)m_pTree_Objects->GetItemData( id ); if( pData && pData->m_pLabelEditFunction ) { //// end the edit to commit the new name //m_pTree_Objects->EndEditLabel( id ); wxString newlabel = event.GetLabel(); if( event.IsEditCancelled() == false ) { // manually set the item to the new name, so the callback func can query for the name. // the edit process seems to happen later RenameObject( pData->m_pObject, newlabel ); // Call the callback and let game code handle the new name pData->m_pLabelEditFunction( pData->m_pObject_LabelEdit ? pData->m_pObject_LabelEdit : pData->m_pObject, id, newlabel ); } } }
void ObjectEditor::createVerticalMenu(){ QVBoxLayout *MainBox=new QVBoxLayout(); QWidget *pane=new QWidget; QVBoxLayout *LayoutPane=new QVBoxLayout(); QHBoxLayout *box=new QHBoxLayout(); pane->setObjectName("Box"); box=new QHBoxLayout(); box->addWidget(new QLabel("Bacground color:")); Bcolor=new ButtonRegulyar("Change color"); connect(Bcolor,SIGNAL(clickButton(QPushButton*)),this,SLOT(ClikedButton(QPushButton*))); box->addWidget(Bcolor); LayoutPane->addLayout(box); box=new QHBoxLayout(); ObjectName=new QLineEdit(""); connect(ObjectName,SIGNAL(editingFinished()),SLOT(RenameObject())); box->addWidget(new QLabel("Object Name: ")); box->addWidget(ObjectName); LayoutPane->addLayout(box); box=new QHBoxLayout(); sizeX=new QSpinBox(); sizeY=new QSpinBox(); box->addWidget(new QLabel("Width:")); box->addWidget(sizeX); box->addWidget(new QLabel(" Height:")); box->addWidget(sizeY); connect(sizeX,SIGNAL(valueChanged(int)),this,SLOT(ObjectSizeXChanged(int))); connect(sizeY,SIGNAL(valueChanged(int)),this,SLOT(ObjectSizeYChanged(int))); LayoutPane->addLayout(box); box=new QHBoxLayout(); ConturEdit=new QCheckBox("Edit HitBox"); ConturEdit->setEnabled(false); showHitBox=new QCheckBox("Show Box"); ConturEdit->setCheckState(Qt::Unchecked); showHitBox->setCheckState(Qt::Unchecked); box->addWidget(showHitBox); box->addWidget(ConturEdit); connect(showHitBox,SIGNAL(stateChanged(int)),SLOT(conturShowChanged(int))); LayoutPane->addLayout(box); pane->setLayout(LayoutPane); pane->setMaximumHeight(120); MainBox->addWidget(pane); pane=new QWidget; pane->setObjectName("Box"); LayoutPane=new QVBoxLayout(); box=new QHBoxLayout(); AnimationsIndex=new QComboBox(); // connect(AnimationsIndex,SIGNAL(currentIndexChanged(int)),this,SLOT(updateFrameList(int))); box->addWidget(new QLabel("Animation :")); box->addWidget(AnimationsIndex); PlayAnimation=new ButtonRegulyar("Play"); connect(PlayAnimation,SIGNAL(clickButton(QPushButton*)),this,SLOT(ClikedButton(QPushButton*))); PlayAnimation->setToolTip("Воспроизведет выбранную анимацию"); box->addWidget(PlayAnimation); LayoutPane->addLayout(box); box=new QHBoxLayout(); ClearAnimation=new ButtonRegulyar("StopAll"); connect(ClearAnimation,SIGNAL(clickButton(QPushButton*)),this,SLOT(ClikedButton(QPushButton*))); box->addWidget(ClearAnimation); LayoutPane->addLayout(box); box=new QHBoxLayout(); box->addWidget(new QLabel("Type: ")); TypeObject=new QComboBox(); QStringList tempList; tempList.push_back("OBJECT"); tempList.push_back("PARALAX"); tempList.push_back("RESURS"); TypeObject->addItems(tempList); connect(TypeObject,SIGNAL(currentIndexChanged(int)),SLOT(typeChanged(int))); box->addWidget(TypeObject); LayoutPane->addLayout(box); pane->setLayout(LayoutPane); pane->setMaximumHeight(100); MainBox->addWidget(pane); adventSettings=new QWidget(); adventSettings->setObjectName("Box"); ModuleLayout =new QHBoxLayout(); adventSettings->setLayout(ModuleLayout); module=new QStackedWidget(); // Module->addWidget(NULL); moduleResursObject=new ModuleResursObject(NULL,this,Projectpatch); moduleParalax=new ModuleParalax(NULL,this,Projectpatch); cleanWindow=new QWidget(); module->addWidget(moduleParalax); module->addWidget(moduleResursObject); module->addWidget(cleanWindow); ModuleLayout->addWidget(module); MainBox->addWidget(adventSettings); VBoxWidget=new QWidget(); VBoxWidget->setLayout(MainBox); VBoxWidget->setEnabled(false); this->addQtWidget(VBoxWidget,EKord(0.70,0.1),EKord(0.30,0.85)); }