• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxDataViewItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parent

void MyMusicTreeModel::Delete( const wxDataViewItem &item )
{
    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
    if (!node)      // happens if item.IsOk()==false
        return;

    wxDataViewItem parent( node->GetParent() );
    if (!parent.IsOk())
    {
        wxASSERT(node == m_root);

        // don't make the control completely empty:
        wxLogError( "Cannot remove the root item!" );
        return;
    }

    // is the node one of those we keep stored in special pointers?
    if (node == m_pop)
        m_pop = NULL;
    else if (node == m_classical)
        m_classical = NULL;
    else if (node == m_ninth)
        m_ninth = NULL;

    // first remove the node from the parent's array of children;
    // NOTE: MyMusicTreeModelNodePtrArray is only an array of _pointers_
    //       thus removing the node from it doesn't result in freeing it
    node->GetParent()->GetChildren().Remove( node );

    // free the node
    delete node;

    // notify control
    ItemDeleted( parent, item );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:35,代码来源:mymodels.cpp


示例2: GetItemRect

wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const
{
  if (item.IsOk() && (columnPtr != NULL))
    return GetDataViewPeer()->GetRectangle(item,columnPtr);
  else
    return wxRect();
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:7,代码来源:dataview_osx.cpp


示例3: wxDataViewItem

unsigned int MyMusicTreeModel::GetChildren( const wxDataViewItem &parent,
                                            wxDataViewItemArray &array ) const
{
    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) parent.GetID();
    if (!node)
    {
        array.Add( wxDataViewItem( (void*) m_root ) );
        return 1;
    }

    if (node == m_classical)
    {
        MyMusicTreeModel *model = (MyMusicTreeModel*)(const MyMusicTreeModel*) this;
        model->m_classicalMusicIsKnownToControl = true;
    }

    if (node->GetChildCount() == 0)
    {
        return 0;
    }

    unsigned int count = node->GetChildren().GetCount();
    for (unsigned int pos = 0; pos < count; pos++)
    {
        MyMusicTreeModelNode *child = node->GetChildren().Item( pos );
        array.Add( wxDataViewItem( (void*) child ) );
    }

    return count;
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:30,代码来源:mymodels.cpp


示例4: SetClientObject

void LLDBBreakpointModel::SetClientObject(const wxDataViewItem& item, wxClientData *data)
{
    LLDBBreakpointModel_Item* node = reinterpret_cast<LLDBBreakpointModel_Item*>(item.GetID());
    if ( node ) {
        node->SetClientObject(data);
    }
}
开发者ID:05storm26,项目名称:codelite,代码行数:7,代码来源:lldbbreakpointmodel.cpp


示例5: SetClientObject

void SettersGettersModel::SetClientObject(const wxDataViewItem& item, wxClientData *data)
{
    SettersGettersModel_Item* node = reinterpret_cast<SettersGettersModel_Item*>(item.GetID());
    if ( node ) {
        node->SetClientObject(data);
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:7,代码来源:settersgettersmodel.cpp


示例6: EnsureVisible

void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr)
{
  if (item.IsOk())
  {
    ExpandAncestors(item); // make sure that the item exists in the control
    GetDataViewPeer()->EnsureVisible(item,columnPtr);
  }
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:8,代码来源:dataview_osx.cpp


示例7: Select

void wxDataViewCtrl::Select(wxDataViewItem const& item)
{
  if (item.IsOk())
  {
    ExpandAncestors(item); // make sure that the item exists in the control
    GetDataViewPeer()->Select(item);
  }
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:8,代码来源:dataview_osx.cpp


示例8: GetArtist

wxString MyMusicTreeModel::GetArtist( const wxDataViewItem &item ) const
{
    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
    if (!node)      // happens if item.IsOk()==false
        return wxEmptyString;

    return node->m_artist;
}
开发者ID:euler0,项目名称:Helium,代码行数:8,代码来源:mymodels.cpp


示例9: GetYear

int MyMusicTreeModel::GetYear( const wxDataViewItem &item ) const
{
    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
    if (!node)      // happens if item.IsOk()==false
        return 2000;

    return node->m_year;
}
开发者ID:euler0,项目名称:Helium,代码行数:8,代码来源:mymodels.cpp


示例10: IsContainer

bool vvStampsModel::IsContainer(
	const wxDataViewItem& cItem
	) const
{
	// only the invisible root is a container
	// none of our actual nodes are hierarchical
	return !cItem.IsOk();
}
开发者ID:refaqtor,项目名称:sourcegear_veracity_clone,代码行数:8,代码来源:vvStampsControl.cpp


示例11: UpdateItem

void TreeListModel::UpdateItem(const wxDataViewItem& item, const wxVector<wxVariant>& data)
{
    TreeListModel_Item* node = reinterpret_cast<TreeListModel_Item*>(item.GetID());
    if ( node ) {
        node->SetData( data );
        ItemChanged( item );
    }
}
开发者ID:wuqiong4945,项目名称:memu,代码行数:8,代码来源:treelistmodel.cpp


示例12: Delete

	void Delete(wxDataViewItem const& item) {
		for (std::list<HotkeyModelCombo>::iterator it = children.begin(); it != children.end(); ++it) {
			if (&*it == item.GetID()) {
				model->ItemDeleted(wxDataViewItem(this), wxDataViewItem((void*)&*it));
				children.erase(it);
				return;
			}
		}
	}
开发者ID:Azpidatziak,项目名称:Aegisub,代码行数:9,代码来源:hotkey_data_view_model.cpp


示例13: Delete

	void Delete(wxDataViewItem const& item) {
		for (auto it = children.begin(); it != children.end(); ++it) {
			if (&*it == item.GetID()) {
				model->ItemDeleted(wxDataViewItem(this), wxDataViewItem((void*)&*it));
				children.erase(it);
				return;
			}
		}
	}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:9,代码来源:hotkey_data_view_model.cpp


示例14: wxDataViewItem

unsigned int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetChildren( const wxDataViewItem& aItem,
        wxDataViewItemArray& aItems ) const
{
    if( !aItem.IsOk() )
    {
        for( std::map<wxString, Group>::iterator i = m_Groups.begin(); i != m_Groups.end(); ++i )
            if( i->second.GetCount() > 1 )
                aItems.push_back( wxDataViewItem( &i->second ) );

        for( std::list<Pin>::iterator i = m_Pins.begin(); i != m_Pins.end(); ++i )
            if( !i->GetParent().IsOk() )
                aItems.push_back( wxDataViewItem( &*i ) );

        return aItems.size();
    }
    else
        return reinterpret_cast<Item const*>( aItem.GetID() )->GetChildren( aItems );
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:18,代码来源:dialog_lib_edit_pin_table.cpp


示例15: wxDataViewItem

wxDataViewItem ProjectViewModel::GetParent( const wxDataViewItem& item ) const
{
    if ( !item.IsOk() )
    {
        return wxDataViewItem( 0 );
    }

    ProjectViewModelNode *node = static_cast< ProjectViewModelNode* >( item.GetID() );
    if ( !node
        || node == m_RootNode.Ptr()
        || !node->GetParent()
        || node->GetParent() == m_RootNode.Ptr() )
    {
        return wxDataViewItem( 0 );
    }

    return wxDataViewItem( (void*) node->GetParent() );
}
开发者ID:euler0,项目名称:Helium,代码行数:18,代码来源:ProjectViewModel.cpp


示例16: ItemAdded

bool wxOSXDataViewModelNotifier::ItemAdded(wxDataViewItem const& parent, wxDataViewItem const& item)
{
  bool noFailureFlag;


  wxCHECK_MSG(item.IsOk(),false,"Added item is invalid.");
  noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Add(parent,item);
  AdjustRowHeight(item);
  return noFailureFlag;
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:10,代码来源:dataview_osx.cpp


示例17: GetValue

void DownloadDataViewModel::GetValue(wxVariant& variant,
		const wxDataViewItem& item, unsigned int column) const {

	DownloadInfo * downloadInfo = static_cast<DownloadInfo*>(item.GetID());

	wxASSERT(downloadInfo != nullptr);

	const int MB = 1024 * 1024;

	switch(column)
	{
	case NAME:
		variant = wxVariant(downloadInfo->GetName());
		break;

	case STATUS:
		if (downloadInfo->IsFinished()) {
			variant = wxVariant(wxString(_("complete")));
		} else {
			variant = wxVariant(wxString(_("downloading")));
		}
		break;

	case P_COMPLETE:
		if (downloadInfo->GetSize() < 1) { /* Prevent from division by zero */
			variant = wxVariant(wxString(_T("Indeterminate")));
		} else {
			variant = wxVariant(wxString::Format(wxT("%i%%"), downloadInfo->GetProgressPercent()));
		}
		break;

	case SPEED:
		//TODO: implement
		variant = wxVariant(wxEmptyString);
		break;

	case ETA:
		//TODO: implement
		variant = wxVariant(wxEmptyString);
		break;

	case FILESIZE:
		variant = wxVariant(downloadInfo->GetSize() > 0 ? wxString::Format(wxT("%i"), downloadInfo->GetSize() / MB) : wxString(_T("0")));
		break;

	case DEFAULT_COLUMN:
		//Do nothing
		break;

	default:
		wxASSERT(false);
		break;
	}
}
开发者ID:jpcordovae,项目名称:springlobby,代码行数:54,代码来源:downloaddataviewmodel.cpp


示例18: HasChildren

bool CScoptViewResultsModel::HasChildren(const wxDataViewItem& item) const
{
    if ( !item.IsOk() )
        return false;

    CScoptViewResultsModel_Item* node = reinterpret_cast<CScoptViewResultsModel_Item*>(item.GetID());
    if ( !node ) {
        return false;
    }
    return !node->GetChildren().empty();
}
开发者ID:HTshandou,项目名称:codelite,代码行数:11,代码来源:cscoptviewresultsmodel.cpp


示例19: HasChildren

bool MemCheckDVCErrorsModel::HasChildren(const wxDataViewItem& item) const
{
    if ( !item.IsOk() )
        return false;

    MemCheckDVCErrorsModel_Item* node = reinterpret_cast<MemCheckDVCErrorsModel_Item*>(item.GetID());
    if ( !node ) {
        return false;
    }
    return !node->GetChildren().empty();
}
开发者ID:05storm26,项目名称:codelite,代码行数:11,代码来源:memcheckdvcerrorsmodel.cpp


示例20:

wxVector<wxVariant> MemCheckDVCErrorsModel::GetItemColumnsData(const wxDataViewItem& item) const
{
    if ( !item.IsOk() )
        return wxVector<wxVariant>();

    MemCheckDVCErrorsModel_Item* node = reinterpret_cast<MemCheckDVCErrorsModel_Item*>(item.GetID());
    if ( !node ) {
        return wxVector<wxVariant>();
    }
    return node->GetData();
}
开发者ID:05storm26,项目名称:codelite,代码行数:11,代码来源:memcheckdvcerrorsmodel.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxDataViewItemArray类代码示例发布时间:2022-05-31
下一篇:
C++ wxDataViewEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap