当前位置: 首页>>代码示例>>C++>>正文


C++ XDebugEvent::GetVariables方法代码示例

本文整理汇总了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 );
    }
}
开发者ID:Jactry,项目名称:codelite,代码行数:35,代码来源:localsview.cpp

示例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();
}
开发者ID:Jactry,项目名称:codelite,代码行数:20,代码来源:localsview.cpp


注:本文中的XDebugEvent::GetVariables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。