本文整理汇总了C++中wxTreeEvent::GetEventObject方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetEventObject方法的具体用法?C++ wxTreeEvent::GetEventObject怎么用?C++ wxTreeEvent::GetEventObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetEventObject方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTreeKeyDown
void SceneBrowser::OnTreeKeyDown(wxTreeEvent& event)
{
switch (event.GetKeyCode())
{
case WXK_F2:
wxStaticCast(event.GetEventObject(), wxTreeCtrl)->EditLabel(mActivedItem);
break;
case WXK_DELETE:
{
mSceneManipulator->removeSelectedObjects(this);
CountLocker locker(mDisableNotifyEvent);
wxTreeCtrl* tree = wxStaticCast(event.GetEventObject(), wxTreeCtrl);
wxArrayTreeItemIds selections;
int count = tree->GetSelections(selections);
for (int i = 0; i < count; ++i)
{
wxTreeItemId item = selections[i];
ObjectItemData* data = static_cast<ObjectItemData*>(tree->GetItemData(item));
if (data)
{
wxASSERT(data->object.expired());
tree->Delete(item);
}
}
}
break;
}
}
示例2: OnTreeNodeExpandedCollapsed
void wxTreebook::OnTreeNodeExpandedCollapsed(wxTreeEvent & event)
{
if ( event.GetEventObject() != m_bookctrl )
{
event.Skip();
return;
}
wxTreeItemId nodeId = event.GetItem();
if ( !nodeId.IsOk() || nodeId == GetTreeCtrl()->GetRootItem() )
return;
int pagePos = DoInternalFindPageById(nodeId);
wxCHECK_RET( pagePos != wxNOT_FOUND, wxT("Internal problem in wxTreebook!..") );
wxBookCtrlEvent ev(GetTreeCtrl()->IsExpanded(nodeId)
? wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED
: wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED,
m_windowId);
ev.SetSelection(pagePos);
ev.SetOldSelection(pagePos);
ev.SetEventObject(this);
GetEventHandler()->ProcessEvent(ev);
}
示例3: wxStaticCast
void
SceneBrowser::OnTreeSelChanged(wxTreeEvent& e)
{
if (mDisableNotifyEvent)
return;
wxTreeCtrl* tree = wxStaticCast(e.GetEventObject(), wxTreeCtrl);
mActivedItem = e.GetItem();
wxArrayTreeItemIds selections;
int count = tree->GetSelections(selections);
// TODO: minimize select status change
mSceneManipulator->clearSelectedObjects(this);
for (int i = 0; i < count; ++i)
{
wxTreeItemId item = selections[i];
ObjectItemData* data = static_cast<ObjectItemData*>(tree->GetItemData(item));
if (data)
{
ObjectPtr object = data->object.lock();
if (object)
mSceneManipulator->selectObject(object);
}
}
}
示例4: OnTreeItemRightClick
void ClassBrowser::OnTreeItemRightClick(wxTreeEvent& event)
{
wxTreeCtrl* tree = (wxTreeCtrl*)event.GetEventObject();
if (!tree)
return;
tree->SelectItem(event.GetItem());
ShowMenu(tree, event.GetItem(), event.GetPoint());
}
示例5: OnTreeItemDoubleClick
void WorkspaceBrowserF::OnTreeItemDoubleClick(wxTreeEvent& event)
{
wxTreeCtrl* tree = (wxTreeCtrl*)event.GetEventObject();
wxTreeItemId id = event.GetItem();
TreeDataF* ctd = (TreeDataF*)tree->GetItemData(id);
if (ctd && ctd->m_pToken)
{
JumpToToken(ctd->m_pToken);
}
}
示例6: OnTreeItemRightClick
void EvtSimHlpEvtHandler::OnTreeItemRightClick (wxTreeEvent &event)
{
wxASSERT_MSG (m_treeItemRightClickProcessed == false,
_T("Tree item right click event handler has already been processed"));
m_treeItemRightClickProcessed = true;
wxMenu *m = new wxMenu (_T("PopupMenu"));
m->Append (1234, _T("PopupMenuItem"));
wxPoint p (0, 0);
WxGuiTestHelper::PopupMenu ((wxTreeCtrl *) event.GetEventObject (), m,
event.GetPoint (), _T("sccDatasetBrowserPopupMenu"));
}
示例7: 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));
}
}
示例8: OnTreeSelectionChange
void wxTreebook::OnTreeSelectionChange(wxTreeEvent& event)
{
if ( event.GetEventObject() != m_bookctrl )
{
event.Skip();
return;
}
wxTreeItemId newId = event.GetItem();
if ( (m_selection == wxNOT_FOUND &&
(!newId.IsOk() || newId == GetTreeCtrl()->GetRootItem())) ||
(m_selection != wxNOT_FOUND && newId == m_treeIds[m_selection]) )
{
// this event can only come when we modify the tree selection ourselves
// so we should simply ignore it
return;
}
int newPos = DoInternalFindPageById(newId);
if ( newPos != wxNOT_FOUND )
SetSelection( newPos );
}
示例9: OnTreeItemRightClick
void WorkspaceBrowserF::OnTreeItemRightClick(wxTreeEvent& event)
{
wxTreeCtrl* tree = (wxTreeCtrl*)event.GetEventObject();
tree->SelectItem(event.GetItem());
ShowMenu(tree, event.GetItem(), event.GetPoint());// + tree->GetPosition());
}
示例10: OnTreeItemDoubleClick
void ClassBrowser::OnTreeItemDoubleClick(wxTreeEvent& event)
{
wxTreeCtrl* wx_tree = (wxTreeCtrl*)event.GetEventObject();
if (!wx_tree || !m_Parser)
return;
wxTreeItemId id = event.GetItem();
CCTreeCtrlData* ctd = (CCTreeCtrlData*)wx_tree->GetItemData(id);
if (ctd && ctd->m_Token)
{
if (wxGetKeyState(WXK_CONTROL) && wxGetKeyState(WXK_SHIFT))
{
// TokenTree* tree = m_Parser->GetTokenTree(); // the one used inside CCDebugInfo
CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
CCDebugInfo info(wx_tree, m_Parser, ctd->m_Token);
info.ShowModal();
CC_LOCKER_TRACK_TT_MTX_UNLOCK(s_TokenTreeMutex)
return;
}
bool toImp = false;
switch (ctd->m_Token->m_TokenKind)
{
case tkConstructor:
case tkDestructor:
case tkFunction:
if (ctd->m_Token->m_ImplLine != 0 && !ctd->m_Token->GetImplFilename().IsEmpty())
toImp = true;
break;
case tkNamespace:
case tkClass:
case tkEnum:
case tkTypedef:
case tkVariable:
case tkEnumerator:
case tkMacroDef:
case tkMacroUse:
case tkAnyContainer:
case tkAnyFunction:
case tkUndefined:
default:
break;
}
wxFileName fname;
if (toImp)
fname.Assign(ctd->m_Token->GetImplFilename());
else
fname.Assign(ctd->m_Token->GetFilename());
cbProject* project = nullptr;
if (!m_NativeParser->IsParserPerWorkspace())
project = m_NativeParser->GetProjectByParser(m_Parser);
else
project = m_NativeParser->GetCurrentProject();
wxString base;
if (project)
{
base = project->GetBasePath();
NormalizePath(fname, base);
}
else
{
const wxArrayString& incDirs = m_Parser->GetIncludeDirs();
for (size_t i = 0; i < incDirs.GetCount(); ++i)
{
if (NormalizePath(fname, incDirs.Item(i)))
break;
}
}
cbEditor* ed = Manager::Get()->GetEditorManager()->Open(fname.GetFullPath());
if (ed)
{
int line;
if (toImp)
line = ctd->m_Token->m_ImplLine - 1;
else
line = ctd->m_Token->m_Line - 1;
ed->GotoTokenPosition(line, ctd->m_Token->m_Name);
}
}