本文整理汇总了C++中wxTreeEvent::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetLabel方法的具体用法?C++ wxTreeEvent::GetLabel怎么用?C++ wxTreeEvent::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EvtTreeModifNomFin
/**
* Applique les modifications dans le fichier correspondant au nœud sélectionné
* @param event un évènement
*/
void PreferenceCouleur::EvtTreeModifNomFin(wxTreeEvent &event)
{
if (!event.IsEditCancelled())
{
//renommer le fichier - event.GetLabel();
if (wxFileExists(Parametre::Get()->getCheminCouleur(event.GetLabel())))
{
wxLogMessage(_T("Fichier Existant !"));
m_treeFiles->EndEditLabel(event.GetItem(), true);
m_treeFiles->SetFocus();
}
else
{
if (wxFileExists(Parametre::Get()->getCheminCouleur(m_treeFiles->GetItemText(event.GetItem()))))
{
ModifierFiltre(event.GetLabel().BeforeLast('.'), m_treeFiles->GetItemText(event.GetItem()));
wxRemoveFile(Parametre::Get()->getCheminCouleur(m_treeFiles->GetItemText(event.GetItem())));
m_textNomSet->ChangeValue(event.GetLabel().BeforeLast('.'));
m_treeFiles->SortChildren(m_nodeExistant);
CallListeners();
}
}
}
m_nomAvantModif.Clear();
}
示例2: OnEndLabelEdit
void E_Scene_Groupesurfaces_Groupe::OnEndLabelEdit(wxTreeEvent& treeEvent)
{
if(treeEvent.GetLabel()!="")
{
this->elementInfo.libelleElement=treeEvent.GetLabel();
this->Modified(this); //Indique le l'element a été modifié
}
}
示例3: OnEndEdit
void RegTreeCtrl::OnEndEdit(wxTreeEvent& event)
{
bool ok;
wxString name = event.GetLabel();
TreeNode *pNode = GetNode(event);
if ( pNode->IsKey() )
{
wxRegKey& key = pNode->Key();
ok = key.Rename(name);
}
else
{
pNode = pNode->Parent();
wxRegKey& key = pNode->Key();
ok = key.RenameValue(m_nameOld, name);
}
if ( !ok )
{
wxLogError(wxT("Failed to rename '%s' to '%s'."),
m_nameOld.c_str(), name.c_str());
}
#if 0 // MSW tree ctrl doesn't like this at all, it hangs
else
{
pNode->Refresh();
}
#endif // 0
}
示例4: OnEndLabelEdit
///////////////////////////////////////////////////////////////////////////////
// GUI callback for when a label is done being edited by the user. Creates a
// command to change the name of the dependency node associated with the item.
//
void SceneOutliner::OnEndLabelEdit( wxTreeEvent& args )
{
if ( !args.IsEditCancelled() )
{
SceneOutlinerItemData* data = GetTreeItemData( args.GetItem() );
Reflect::Object* object = data->GetObject();
SceneGraph::SceneNode* node = Reflect::SafeCast< SceneGraph::SceneNode >( object );
if ( node )
{
const tstring newName = args.GetLabel().c_str();
if ( node->GetName() != newName )
{
// Create an undoable command to rename the object
m_CurrentScene->Push( new PropertyUndoCommand<tstring>( new Helium::MemberProperty<SceneGraph::SceneNode, tstring> (node, &SceneGraph::SceneNode::GetName, &SceneGraph::SceneNode::SetGivenName), newName) );
m_CurrentScene->Execute( false );
// Sort
Sort( m_TreeCtrl->GetItemParent( args.GetItem() ) );
// Keep the item in view
if ( !m_TreeCtrl->IsVisible( args.GetItem() ) )
{
m_TreeCtrl->EnsureVisible( args.GetItem() );
}
}
args.Veto();
OnSelectionChanged( (wxTreeEvent)NULL );
}
}
}
示例5: FinishAddingGroup
void PWSTreeCtrl::FinishAddingGroup(wxTreeEvent& evt, wxTreeItemId groupItem)
{
if (evt.IsEditCancelled()) {
// New item, not yet in db. So we could just remove from the tree
Delete(groupItem);
}
else {
// Can't call GetItemGroup here since the item doesn't actually have the new label
wxString groupName = evt.GetLabel();
for (wxTreeItemId parent = GetItemParent(groupItem);
parent != GetRootItem(); parent = GetItemParent(parent)) {
groupName = GetItemText(parent) + wxT(".") + groupName;
}
StringX sxGroup = tostringx(groupName);
// The new item we just added above will get removed once the update GUI callback from core happens.
DBEmptyGroupsCommand* cmd = DBEmptyGroupsCommand::Create(&m_core,
sxGroup,
DBEmptyGroupsCommand::EG_ADD);
if (cmd)
m_core.Execute(cmd);
// evt.GetItem() is not valid anymore. A new item has been inserted instead.
// We can select it using the full path we computed earlier
wxTreeItemId newItem = Find(groupName, GetRootItem());
if (newItem.IsOk())
wxTreeCtrl::SelectItem(newItem);
}
}
示例6: EvtTreeModifNomDebut
/**
* Autorise ou non la modification d'un nœud
* @param event un évènement
*/
void PreferenceCouleur::EvtTreeModifNomDebut(wxTreeEvent &event)
{
if (m_treeFiles->GetItemParent(event.GetItem()) == m_nodeExistant)
m_nomAvantModif = event.GetLabel();
else
{
m_treeFiles->EndEditLabel(event.GetItem(), true);
m_treeFiles->SetFocus();
m_treeFiles->SelectItem(event.GetItem());
m_nomAvantModif.Clear();
}
}
示例7: OnEndLabelEdit
void SkillObjectTree::OnEndLabelEdit(wxTreeEvent& event)
{
wxLogMessage(wxT("OnEndLabelEdit"));
// don't allow anything except letters in the labels
if ( !event.GetLabel().IsWord() )
{
wxMessageBox(wxT("The new label should be a single word."));
event.Veto();
}
}
示例8: OnEndLabelEdit
void wxGxTreeView::OnEndLabelEdit(wxTreeEvent& event)
{
if ( event.GetLabel().IsEmpty() )
{
event.Veto();
return;
}
wxTreeItemId item = event.GetItem();
if(!item.IsOk())
{
event.Veto();
return;
}
wxGxTreeItemData* pData = (wxGxTreeItemData*)GetItemData(event.GetItem());
if(pData == NULL)
{
event.Veto();
return;
}
wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(pData->m_nObjectID);
IGxObjectEdit* pObjEdit = dynamic_cast<IGxObjectEdit*>(pGxObject);
if(pObjEdit == NULL)
{
event.Veto();
return;
}
if(!pObjEdit->Rename(event.GetLabel()))
{
event.Veto();
wxMessageBox(_("Rename error!"), _("Error"), wxICON_ERROR | wxOK );
return;
}
m_pCatalog->ObjectChanged(pGxObject->GetId());
}
示例9: labelEditEvent
void nsSolutionBrowser::labelEditEvent(wxTreeEvent& evt)
{
nsTreeItem* item = (nsTreeItem*)m_tree->GetItemData(m_tree->GetSelection());
if (item && item->m_tree)
{
nsNodeTree* ntree = item->m_tree;
ntree->setName((const char*)evt.GetLabel().mb_str());
nsTreeEvent change(NS_TREE_CHANGED, this, ntree);
nsWorkspace::getSingleton().treeEvent(change);
nsPropertyPage::getSingleton().treeEvent(change);
}
}
示例10: TreeOnEndLabelEdit
void DecisionLogicFrame::TreeOnEndLabelEdit(wxTreeEvent& event)
{
// don't allow anything except letters in the labels
wstring newName = event.GetLabel().wc_str();
if (!m_worker->ValidateFolderName(newName))
{
event.Veto();
}
else
{
m_worker->RenameTable(m_lastName, newName);
}
m_lastName = L"";
}
示例11: OnEndLabelEdit
void MyTreeCtrl::OnEndLabelEdit(wxTreeEvent& event)
{
#if 0
wxLogMessage("OnEndLabelEdit");
// don't allow anything except letters in the labels
if ( !event.GetLabel().IsWord() )
{
wxMessageBox("The label should contain only letters.");
event.Veto();
}
#endif
}
示例12: TreeOnBeginLabelEdit
void DecisionLogicFrame::TreeOnBeginLabelEdit(wxTreeEvent& event)
{
// for testing, prevent this item's label editing
wxTreeItemId itemId = event.GetItem();
if ( EditNotAllowed(itemId) )
{
event.Veto();
}
else
{
m_lastName = event.GetLabel();
}
}
示例13:
void
SamplesTreeCtrl::onEndEditLabel( wxTreeEvent &event )
{
// The item will be renamed by onRenameSample
event.Veto();
wxTreeItemId selectedItem = event.GetItem();
SamplesTreeData *data = (SamplesTreeData *)GetItemData( selectedItem );
// Don't allow speakers to be renamed (yet!)
// TODO allow speakers to be renamed this way.
if ( data == NULL )
return;
smp::sampleManager->renameSample( data->m_sample, event.GetLabel() );
}
示例14: OnEndLabelEdit
//------------------------------------------------------------------------------
void OutputTree::OnEndLabelEdit(wxTreeEvent &event)
{
wxString newLabel = event.GetLabel();
// check to see if label is a single word
if (newLabel.IsWord())
{
GmatTreeItemData *selItem = (GmatTreeItemData *)
GetItemData(GetSelection());
wxString oldLabel = selItem->GetName();
selItem->SetName(newLabel);
}
else
{
event.Veto();
}
}
示例15: OnTreectrlSelChanged
void frmMDFEditor::OnTreectrlSelChanged( wxTreeEvent& event )
{
wxString strPage;
strPage = _("<html><body><h3>");
wxTreeItemId itemID = event.GetItem();
//MyTreeItemData *item = itemId.IsOk() ? (MyTreeItemData *)GetItemData(itemId)
// : NULL;
if ( itemID.IsOk() ) {
strPage += m_mdfTree->GetItemText( itemID );
strPage += event.GetLabel();
}
else {
strPage += _("????");
}
strPage += _("</h3></body></html>");
m_htmlInfoWnd->SetPage( strPage );
event.Skip();
}