本文整理汇总了C++中XDebugEvent::GetVariables方法的典型用法代码示例。如果您正苦于以下问题:C++ XDebugEvent::GetVariables方法的具体用法?C++ XDebugEvent::GetVariables怎么用?C++ XDebugEvent::GetVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDebugEvent
的用法示例。
在下文中一共展示了XDebugEvent::GetVariables方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnProperytGet
void LocalsView::OnProperytGet(XDebugEvent& e)
{
e.Skip();
// An item was evaluated using property_get
std::map<wxString, wxDataViewItem>::iterator iter = m_waitingExpand.find( e.GetEvaluted() );
if ( iter == m_waitingExpand.end() ) {
return;
}
wxDataViewItem item = iter->second;
m_waitingExpand.erase( iter );
// Delete the fake node
wxDataViewItemArray children;
m_dataviewModel->GetChildren( item, children );
if ( !children.IsEmpty() ) {
m_dataviewModel->DeleteItems( item, children );
}
XVariable::List_t vars = e.GetVariables();
if ( vars.empty() )
return;
// Since we got here from property_get, XDebug will reply with the specific property (e.g. $myclass->secondClass)
// and all its children. Howeverr, $myclass->secondClass already exist in the tree
// so we are only interested with its children. so we use here vars.begin()->children (vars is always list of size == 1)
wxASSERT_MSG(vars.size() == 1, "property_get returned list of size != 1");
XVariable::List_t childs;
childs = vars.begin()->children;
if ( !childs.empty() ) {
AppendVariablesToTree( item, childs );
m_dataview->Expand( item );
}
}
示例2: OnLocalsUpdated
void LocalsView::OnLocalsUpdated(XDebugEvent& e)
{
e.Skip();
CL_DEBUG("Inside OnLocalsUpdated");
m_dataviewModel->Clear();
m_localsExpandedItems.Clear();
const XVariable::List_t& vars = e.GetVariables();
AppendVariablesToTree( wxDataViewItem(NULL), vars );
// Expand the items that were expanded before the view refresh
for(size_t i=0; i<m_localsExpandedItems.GetCount(); ++i) {
// Ensure it is visible
m_dataview->EnsureVisible( m_localsExpandedItems.Item(i) );
// Ensure its expanded
m_dataview->Expand( m_localsExpandedItems.Item(i) );
}
m_localsExpandedItems.Clear();
}