本文整理汇总了C++中wxTreeEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent类的具体用法?C++ wxTreeEvent怎么用?C++ wxTreeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxTreeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTreeItemSelected
void BundlePane::OnTreeItemSelected(wxTreeEvent& event) {
const wxTreeItemId selItem = event.GetItem();
const BundleItemData* data = (BundleItemData*)m_bundleTree->GetItemData(selItem);
// The menu root cannot be removed
if (data->m_type == BUNDLE_MENU) m_bundleMinus->Disable();
else m_bundleMinus->Enable();
}
示例2:
void
mi_frame::on_right_click(wxTreeEvent &event) {
wxTreeItemId item = event.GetItem();
if (tree->GetChildrenCount(item) == 0)
return;
expand_all_elements(item, !tree->IsExpanded(item));
}
示例3: OnItemActivated
//------------------------------------------------------------------------------
void OutputTree::OnItemActivated(wxTreeEvent &event)
{
// get some info about this item
wxTreeItemId itemId = event.GetItem();
GmatTreeItemData *item = (GmatTreeItemData *)GetItemData(itemId);
item->SetTitle(GetItemText(itemId));
GmatAppData::Instance()->GetMainFrame()->CreateChild(item);
}
示例4: OnItemExpanding
void CRemoteTreeView::OnItemExpanding(wxTreeEvent& event)
{
if (m_busy)
return;
wxTreeItemId item = event.GetItem();
if (!item)
return;
if (!ListExpand(item))
{
event.Veto();
return;
}
Refresh(false);
}
示例5: OnBeginDrag
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
// need to explicitly allow drag
if ( event.GetItem() != GetRootItem() )
{
m_draggedItem = event.GetItem();
wxLogMessage(wxT("OnBeginDrag: started dragging %s"),
GetItemText(m_draggedItem).c_str());
event.Allow();
}
else
{
wxLogMessage(wxT("OnBeginDrag: this item can't be dragged."));
}
}
示例6: OnBeginDrag
void ModelListTree::OnBeginDrag(wxTreeEvent& event)
{
ModelTreeItemData* itemData = (ModelTreeItemData*)GetItemData(event.GetItem());
Model* model = itemData->GetModel();
//event.Allow();
}
示例7: OnPageChanging
void CSettingsDialog::OnPageChanging(wxTreeEvent& event)
{
if (!m_activePanel)
return;
if (!m_activePanel->Validate())
event.Veto();
}
示例8: OnItemActivated
//----------------------------------------------------------------------------
void ProjTree::OnItemActivated(wxTreeEvent& event)
{
wxTreeItemId id = event.GetItem();
bool isExpanded = IsExpanded(id);
if (isExpanded) Collapse(id);
else Expand(id);
}
示例9: GetTreeItemData
///////////////////////////////////////////////////////////////////////////////
// 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 );
}
}
}
示例10: UponTreeSelectionChange
void DatabaseView::UponTreeSelectionChange(wxTreeEvent& event)
{
wxTreeCtrl& tree_ctrl = tree();
MultiDimGrid& grid_ctrl = grid();
// save the current selection
wxTreeItemId const old_item = event.GetOldItem();
if(old_item.IsOk())
{
database_tree_item_data* old_item_data =
dynamic_cast<database_tree_item_data*>
(tree_ctrl.GetItemData(old_item)
);
if(old_item_data)
{
old_item_data->set_axes_selected(grid_ctrl.GetGridAxisSelection());
}
}
database_tree_item_data* item_data =
dynamic_cast<database_tree_item_data*>
(tree_ctrl.GetItemData(event.GetItem())
);
if(!item_data)
{
return;
}
table_adapter().SetTDBValue
(&document().GetTDBValue(item_data->db_name().Idx)
);
bool is_topic = tree_ctrl.GetChildrenCount(event.GetItem());
set_grid_label_text(item_data->db_name().LongName);
wxSizer* sizer = grid_ctrl.GetContainingSizer();
LMI_ASSERT(sizer);
sizer->Show(&grid_ctrl, !is_topic);
sizer->Layout();
// restore axis selection if any
grid_ctrl.SetGridAxisSelection(item_data->get_axes_selected());
grid_ctrl.RefreshTableFull();
}
示例11: wxASSERT
void
AnimationSelector::OnAnimationListSelChanged(wxTreeEvent& e)
{
// reset the state
resetState();
wxTreeItemId item = e.GetItem();
wxASSERT(item.IsOk());
wxTreeCtrl* tree = wxStaticCast(e.GetEventObject(), wxTreeCtrl);
mActivedItem = e.GetItem();
wxArrayTreeItemIds selections;
int nCount = tree->GetSelections(selections);
if(nCount <= 0)
return;
if (mIsMeshAnim)
{
GetDataManipulator()->changeMeshAnimation(DoActiveItem(item));
return;
}
GetDataManipulator()->changeAnimation(DoActiveItem(item),0.0);
Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;
if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
{
m_btnPause->Enable(true);
pObjModel->setAnimEditing(m_bPause);
Ogre::String animationName = pObjModel->getCurrentAnimName();
bool bLoop = pObjModel->getAnimationLoop();
Ogre::Real timeTotal = pObjModel->getAnimationLength(animationName);
m_endTimeText->SetValue(Ogre::StringConverter::toString(timeTotal));
m_endFrameText->SetValue(Ogre::StringConverter::toString(timeTotal*STATIC_FPS));
}
}
示例12: OnObjetsListSelectionChanged
void ChooseObjectDialog::OnObjetsListSelectionChanged(wxTreeEvent& event)
{
item = event.GetItem();
gd::TreeItemStringData * data = dynamic_cast<gd::TreeItemStringData*>(objectsList->GetItemData(item));
if(!data)
ChoisirBt->Disable();
else
ChoisirBt->Enable();
}
示例13: directory_ctrlOnTreeItemMenu
void MainWindow::directory_ctrlOnTreeItemMenu( wxTreeEvent& event )
{
wxPoint pt = event.GetPoint();
wxMenu menu(wxEmptyString);
menu.Append(FDBex_ExtractFolder, _("Extract folder to..."));
PopupMenu(&menu, pt);
}
示例14: OnItemSelected
void ModelListTree::OnItemSelected(wxTreeEvent& event)
{
ModelTreeItemData* itemData = (ModelTreeItemData*)GetItemData(event.GetItem());
Model* model = itemData->GetModel();
mInspectorPanel->AttachModel(model);
mInspectorPanel->GetModelPreviewCanvas()->SetPreviewModel(model);
mInspectorPanel->GetModelPreviewCanvas()->AddjustCameraPos();
}
示例15: 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();
}
}