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


C++ wxDataViewCtrl::GetModel方法代码示例

本文整理汇总了C++中wxDataViewCtrl::GetModel方法的典型用法代码示例。如果您正苦于以下问题:C++ wxDataViewCtrl::GetModel方法的具体用法?C++ wxDataViewCtrl::GetModel怎么用?C++ wxDataViewCtrl::GetModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxDataViewCtrl的用法示例。


在下文中一共展示了wxDataViewCtrl::GetModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetNextItem

wxDataViewItem GetNextItem( wxDataViewCtrl const& aView, wxDataViewItem const& aItem )
{
    wxDataViewItem nextItem;

    if( !aItem.IsOk() )
    {
        // No selection. Select the first.
        wxDataViewItemArray children;
        aView.GetModel()->GetChildren( aItem, children );
        return children[0];
    }

    if( aView.IsExpanded( aItem ) )
    {
        wxDataViewItemArray children;
        aView.GetModel()->GetChildren( aItem, children );
        nextItem = children[0];
    }
    else
    {
        // Walk up levels until we find one that has a next sibling.
        for( wxDataViewItem walk = aItem; walk.IsOk(); walk = aView.GetModel()->GetParent( walk ) )
        {
            nextItem = GetNextSibling( aView, walk );

            if( nextItem.IsOk() )
                break;
        }
    }

    return nextItem;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:32,代码来源:wxdataviewctrl_helpers.cpp

示例2: GetPrevItem

wxDataViewItem GetPrevItem( wxDataViewCtrl const& aView, wxDataViewItem const& aItem )
{
    auto prevItem = GetPrevSibling( aView, aItem );

    if( !prevItem.IsOk() )
    {
        prevItem = aView.GetModel()->GetParent( aItem );
    }
    else if( aView.IsExpanded( prevItem ) )
    {
        wxDataViewItemArray children;
        aView.GetModel()->GetChildren( prevItem, children );
        prevItem = children[children.size() - 1];
    }

    return prevItem;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:17,代码来源:wxdataviewctrl_helpers.cpp

示例3: GetNextSibling

wxDataViewItem GetNextSibling( wxDataViewCtrl const& aView, wxDataViewItem const& aItem )
{
    wxDataViewItemArray siblings;
    wxDataViewItem      invalid;
    wxDataViewItem      parent = aView.GetModel()->GetParent( aItem );

    aView.GetModel()->GetChildren( parent, siblings );

    for( size_t i = 0; i < siblings.size(); ++i )
    {
        if( siblings[i] == aItem )
        {
            if( i == siblings.size() - 1 )
                return invalid;
            else
                return siblings[i + 1];
        }
    }

    return invalid;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:21,代码来源:wxdataviewctrl_helpers.cpp


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