您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddRoot函数代码示例

51自学网 2021-06-01 19:41:25
  C++
这篇教程C++ AddRoot函数代码示例写得很实用,希望能帮到您。

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

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

示例1: QDialog

Dialog::Dialog(QWidget *parent) :    QDialog(parent),    ui(new Ui::Dialog){    ui->setupUi(this);    ui->treeWidget->setColumnCount(2);    ui->treeWidget->setHeaderLabels(QStringList() << "one" <<"two");    AddRoot("1. Hello", "World");    AddRoot("2. Hello", "World");    AddRoot("3. Hello", "World");}
开发者ID:WACodeAcademy,项目名称:GUI-dev,代码行数:11,


示例2: wxTreeCtrl

//============================================================================// TreeView//============================================================================wxGD::TreeView::TreeView( Handler *handler, wxWindow *parent ):wxTreeCtrl( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,                    wxTR_DEFAULT_STYLE | wxTR_HIDE_ROOT ),m_handler( handler ){    wxImageList *imageList = m_handler->GetLargeImageList();    if( !imageList )        return;    SetImageList( imageList );    int imageIndex = ArtProvider::GetItemImageListIndex( "controls", "Project" );    AddRoot( "Project", imageIndex );    Bind( wxEVT_COMMAND_TREE_BEGIN_DRAG,        &TreeView::OnBeginDrag,     this );    Bind( wxEVT_COMMAND_TREE_END_DRAG,          &TreeView::OnEndDrag,       this );    Bind( wxEVT_COMMAND_TREE_ITEM_COLLAPSED,    &TreeView::OnItemCollapsed, this );    Bind( wxEVT_COMMAND_TREE_ITEM_EXPANDED,     &TreeView::OnItemExpanded,  this );    Bind( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,  &TreeView::OnItemRightClick,this );    Bind( wxEVT_COMMAND_TREE_SEL_CHANGED,       &TreeView::OnSelChanged,    this );    Bind( wxGD_EVT_OBJECT_CREATED, &TreeView::OnObjectCreated, this );}
开发者ID:wxguidesigner,项目名称:wxGUIDesigner,代码行数:28,


示例3: wxDynamicCast

bool wxGxTreeViewBase::Activate(IApplication* const pApplication, wxXmlNode* const pConf){	if(!wxGxView::Activate(pApplication, pConf))		return false;    wxGxApplicationBase* pGxApp = dynamic_cast<wxGxApplicationBase*>(pApplication);    if(NULL == pGxApp)        return false;    m_pSelection = pGxApp->GetGxSelection();    m_pApp = dynamic_cast<wxGISApplicationBase*>(pApplication);    if(NULL == m_pApp)        return false;     if(!GetGxCatalog())		return false;    m_pCatalog = wxDynamicCast(GetGxCatalog(), wxGxCatalogUI);    //delete    m_pDeleteCmd = m_pApp->GetCommand(wxT("wxGISCatalogMainCmd"), 4);	//new	m_pNewMenu = dynamic_cast<wxGISNewMenu*>(m_pApp->GetCommandBar(NEWMENUNAME));    AddRoot(m_pCatalog);    m_ConnectionPointCatalogCookie = m_pCatalog->Advise(this);    if(m_pSelection)        m_ConnectionPointSelectionCookie = m_pSelection->Advise(this);	return true;};
开发者ID:Mileslee,项目名称:wxgis,代码行数:31,


示例4: wxLogTrace

void DirectoryTree::InitTree()  {  wxLogTrace(DIRECTORYTREE_EVENTS, wxT("InitTree()"));  DeleteAllItems();#ifdef __UNIX  wxTreeItemId tidRoot = AddChild(wxTreeItemId(), FILE_SYSTEM_ROOT);#elif _WINDOWS  wxTreeItemId tidRoot = AddRoot(FILE_SYSTEM_ROOT, 0, 1, NULL);#endif // OS	if(!tidRoot.IsOk())    {    wxLogDebug(wxT("DirectoryTree::InitTree(): AddRoot() failed."));    return;     }#ifdef _WINDOWS  // Enumerate the system volumes  TCHAR szDrives[0x200];  DWORD dwTotalLength = GetLogicalDriveStrings(0x200 * sizeof(TCHAR), szDrives);  DWORD dwOffset = 0;  while(dwOffset < dwTotalLength)    {    TCHAR * szDrive = szDrives + dwOffset;    wxString sDrive(szDrive);    AddChild(tidRoot, sDrive);    DWORD dwLength = wcslen(szDrive);    dwOffset += dwLength + 1;    }#endif // OS  }
开发者ID:joeyates,项目名称:sherpa,代码行数:32,


示例5: wxTreeCtrlEx

CRemoteTreeView::CRemoteTreeView(wxWindow* parent, wxWindowID id, CState* pState, CQueueView* pQueue)	: wxTreeCtrlEx(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_EDIT_LABELS | wxTR_LINES_AT_ROOT | wxTR_HAS_BUTTONS | wxNO_BORDER | wxTR_HIDE_ROOT),	CSystemImageList(16),	CStateEventHandler(pState){#ifdef __WXMAC__	SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));#endif	pState->RegisterHandler(this, STATECHANGE_REMOTE_DIR);	pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);	CreateImageList();	UpdateSortMode();	RegisterOption(OPTION_FILELIST_NAMESORT);	m_busy = false;	m_pQueue = pQueue;	AddRoot(_T(""));	m_ExpandAfterList = wxTreeItemId();	SetDropTarget(new CRemoteTreeViewDropTarget(this));	Enable(false);}
开发者ID:oneminot,项目名称:filezilla3,代码行数:26,


示例6: QDialog

WidgetImageSelector::WidgetImageSelector( QString &imageData ,QWidget *parent) :    QDialog(parent),    imageDataRef(imageData),    ui(new Ui::WidgetImageSelector){    ui->setupUi(this);    int selectTopItem;    //Set columns count    ui->WidgetImageSelectorTreeWidget->setColumnCount(3);    if(QTreeWidgetItem* header = ui->WidgetImageSelectorTreeWidget->headerItem()) {      header->setText(0, SET_COLUMN_ZERO_HEADER_TEXT);      header->setText(1, SET_COLUMN_ONE_HEADER_TEXT);      header->setText(2, SET_COLUMN_TWO_HEADER_TEXT);    }    /*Resize columns to content    for(int i = 0; i < 3; i++){        ui->WidgetImageSelectorTreeWidget->resizeColumnToContents(i);    }*/    AddRoot();    // Select the image    if(imageData != NULL)    {        selectTopItem = imageData.toInt() - 1u;    }    else    {        selectTopItem = 94 - 1u;    }    // Select the top level Item    ui->WidgetImageSelectorTreeWidget->setCurrentItem(ui->WidgetImageSelectorTreeWidget->topLevelItem(selectTopItem));}
开发者ID:dinguluer,项目名称:UiMagician,代码行数:35,


示例7: sourceFile

void PHPOutlineTree::BuildTree(const wxFileName& filename){    m_filename = filename;    PHPSourceFile sourceFile(filename, NULL);    sourceFile.SetParseFunctionBody(false);    sourceFile.Parse();    wxWindowUpdateLocker locker(this);    DeleteAllItems();    wxTreeItemId root = AddRoot(wxT("Root"));    wxImageList* images = new wxImageList(clGetScaledSize(16), clGetScaledSize(16), true);    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/globals")));            // 0    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_private")));   // 1    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_protected"))); // 2    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_public")));    // 3    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_private")));     // 4    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_protected")));   // 5    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_public")));      // 6    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/namespace")));          // 7    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/class")));              // 8    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/enumerator")));         // 9    AssignImageList(images);    // Build the tree view    BuildTree(root, sourceFile.Namespace());    if(HasChildren(GetRootItem())) {        ExpandAll();    }}
开发者ID:lpc1996,项目名称:codelite,代码行数:31,


示例8: wxTreeCtrlEx

CLocalTreeView::CLocalTreeView(wxWindow* parent, wxWindowID id, CState *pState, CQueueView *pQueueView)	: wxTreeCtrlEx(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_EDIT_LABELS | wxTR_LINES_AT_ROOT | wxTR_HAS_BUTTONS | wxNO_BORDER),	CSystemImageList(16),	CStateEventHandler(pState),	m_pQueueView(pQueueView){	wxGetApp().AddStartupProfileRecord(_T("CLocalTreeView::CLocalTreeView"));#ifdef __WXMAC__	SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));#endif	pState->RegisterHandler(this, STATECHANGE_LOCAL_DIR);	pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);	SetImageList(GetSystemImageList());#ifdef __WXMSW__	m_pVolumeEnumeratorThread = 0;	CreateRoot();#else	wxTreeItemId root = AddRoot(_T("/"));	SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Normal);	SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_Selected);	SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Expanded);	SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_SelectedExpanded);	SetDir(_T("/"));#endif	SetDropTarget(new CLocalTreeViewDropTarget(this));}
开发者ID:Hellcenturion,项目名称:MILF,代码行数:32,


示例9: string_to_object

voidNSBrowserTreeCtrl::build_tree(){	// resolve name service reference	int dummy = 0;	CORBA::ORB_var orb = CORBA::ORB_init(dummy,0);	std::string ns;	ns = Qedo::ConfigurationReader::instance()->lookup_config_value( "/General/NameService" );;	//ns = "corbaloc::tri:12356/NameService";	CORBA::Object_var obj;	obj = orb -> string_to_object( ns.c_str() );	CreateImageList();	try {		nameService = CosNaming::NamingContext::_narrow(obj.in());	} catch (CORBA::SystemException) {};	if (!CORBA::is_nil(nameService))	{    wxTreeItemId rootId = AddRoot(wxT("RootContext"),                                  TreeCtrlIcon_FolderOpened , TreeCtrlIcon_Folder ,                                  new NSBrowserTreeItemData(wxT("Root item")));		 AddItemsRecursively(rootId, nameService);	}}
开发者ID:BackupTheBerlios,项目名称:qedo-svn,代码行数:27,


示例10: wxRemotelyScrolledTreeCtrl

TestTree::TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt,        const wxSize& sz, long style):        wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style){    m_imageList = new wxImageList(16, 16, true);#if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW    m_imageList->Add(wxIcon(icon1_xpm));    m_imageList->Add(wxIcon(icon2_xpm));#elif defined(__WXMSW__)    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CLOSED_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE));    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FILE"), wxBITMAP_TYPE_ICO_RESOURCE));#else#error "Sorry, we don't have icons available for this platforms."#endif    SetImageList(m_imageList);    // Add some dummy items    wxTreeItemId rootId = AddRoot(_("Root"), -1, -1);    int i;    for (i = 1; i <= 20; i++)    {        wxString label;        label.Printf(wxT("Item %d"), i);        wxTreeItemId id = AppendItem(rootId, label, 0);        //SetItemImage( id, 1, wxTreeItemIcon_Expanded );        int j;        for (j = 0; j < 10; j++)            AppendItem(id, _("Child"), 1);    }    Expand(rootId);}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:33,


示例11: wxGetApp

//----------------------------------------wxTreeItemId CDatasetTreeCtrl::AddItemToTree(const wxString& datasetName){  wxTreeItemId id;  CWorkspaceDataset* wks = wxGetApp().GetCurrentWorkspaceDataset();  if (wks == NULL)  {    return id;  }    if (wks->GetDatasetCount() <= 0)  {    return id;  }  CDataset* dataset = wks->GetDataset(datasetName);    int image = CTreeCtrl::TreeCtrlIcon_File;  wxTreeItemId rootId = GetRootItem();    if (!rootId)  {    rootId = AddRoot("Root", CTreeCtrl::TreeCtrlIcon_Folder, CTreeCtrl::TreeCtrlIcon_Folder);  }  id = AppendItem(rootId, datasetName.c_str(), image, image + 1, new CDatasetTreeItemData(dataset));  return id;}
开发者ID:adakite,项目名称:main,代码行数:32,


示例12: init_data

void Download::getItems(){       F_Type f;    Data data = init_data(LIST_FILE);    QTreeWidgetItem *father=NULL,*child=NULL;    m_client->write_data(&data,sizeof(Data));    start:    m_client->read_data(&f,sizeof(F_Type));       if(f.type == -222)        goto end;    if(f.level == 0)        goto j_father;    if(f.level > 0)        goto j_child;    goto end;    j_father:    father=AddRoot(f.name,f.path,f.type,f.size);    goto start;    j_child:    if(f.level == 1)        child=AddChild(father,f.name,f.path,f.type,f.size);    else if(f.level>=1)        child=AddChild(child,f.name,f.path,f.type,f.size);    goto start;    end:        return;}
开发者ID:valentingrigorean,项目名称:Collaborative-Notepad,代码行数:27,


示例13: wxTreeCtrl

OPJMarkerTree::OPJMarkerTree(wxWindow *parent, OPJChildFrame *subframe, wxFileName fname, wxString name, const wxWindowID id,           const wxPoint& pos, const wxSize& size, long style)          : wxTreeCtrl(parent, id, pos, size, style){    m_reverseSort = false;	m_fname = fname;	m_peektextCtrl = ((OPJFrame *) (parent->GetParent()->GetParent()))->m_textCtrlbrowse;    CreateImageList();    // Add some items to the tree    //AddTestItemsToTree(5, 5);    int image = wxGetApp().ShowImages() ? OPJMarkerTree::TreeCtrlIcon_Folder : -1;    wxTreeItemId rootId = AddRoot(name,                                  image, image,                                  new OPJMarkerData(name));    OPJParseThread *pthread = CreateParseThread(0x00, subframe);    if (pthread->Run() != wxTHREAD_NO_ERROR)        wxLogMessage(wxT("Can't start parse thread!"));    else		wxLogMessage(wxT("New parse thread started."));	m_childframe = subframe;}
开发者ID:ArphonePei,项目名称:PDFConverter,代码行数:25,


示例14: wxTreeCtrl

                   P3DPlantModelTreeCtrl::P3DPlantModelTreeCtrl                                      (wxWindow           *parent,                                       P3DPlantModel      *PlantModel,                                       P3DBranchPanel     *BranchPanel)                   : wxTreeCtrl(parent,PLANT_TREE_CTRL_ID,wxDefaultPosition,                                wxDefaultSize,wxTR_HAS_BUTTONS | wxRAISED_BORDER) {  this->BranchPanel = BranchPanel;  SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));  P3DBranchModel  *PlantBase;  PlantBase = PlantModel->GetPlantBase();  wxTreeItemId RootId = AddRoot(MakeTreeItemLabel(PlantBase->GetName(),PlantBase));  SetItemData(RootId,new P3DPlantModelTreeCtrlItemData(PlantBase));  AppendChildrenRecursive(PlantBase,RootId);  #if defined(__WXMSW__)   {    SetItemBold(RootId,true);   }  #endif }
开发者ID:Benjamin-L,项目名称:Dinosauria,代码行数:27,


示例15: QDialog

MyDialog::MyDialog(QWidget *parent) :    QDialog(parent),    ui(new Ui::MyDialog){    ui->setupUi(this);    ui->label->setText("mydialog label ********");    ui->listWidget->addItem("Hello");    for(int i= 0; i< 9; i++)        ui->listWidget->addItem(QString::number(i) + " Item");    ui->treeWidget->setColumnCount(2);//    ui->treeWidget->setHeaderLabel("col a");    ui->treeWidget->setHeaderLabels(QStringList() << "First" << "Second");    AddRoot("1 Hello","World");    AddRoot("2 Hello","World");    AddRoot("3 Hello","World");}
开发者ID:thomasalvatran,项目名称:Notepad,代码行数:18,


示例16: AddRoot

void Registry::GarbageCollect(Object root){ #ifdef KAI_USE_TRICOLOR	AddRoot(root);	TriColor();#else	MarkSweepAndDestroy(root); #endif}
开发者ID:kalineh,项目名称:KAI,代码行数:9,


示例17: ClearProps

 void ClearProps() {     DeleteAllItems();     AddRoot(_("Properties"));     if (m_EditCtrl)     {         m_EditCtrl->EndEdit();         m_EditCtrl = NULL;     } }
开发者ID:mentat,项目名称:YardSale,代码行数:10,


示例18: wxTreeCtrl

SessionTreeControl::SessionTreeControl( wxWindow* parent ) :    wxTreeCtrl( parent, wxID_ANY, parent->GetPosition(), parent->GetSize() ){    rootID = AddRoot( _("Sessions"), -1, -1, new wxTreeItemData() );    videoNodeID = AppendItem( rootID, _("Video") );    audioNodeID = AppendItem( rootID, _("Audio") );    Expand( rootID );    timer = new RotateTimer( this );}
开发者ID:Adhesion,项目名称:grav,代码行数:10,


示例19: DeleteAllItems

void SymbolTree::BuildTree(const wxFileName &fileName){	// Clear the tree	DeleteAllItems();	m_items.clear();	m_globalsNode = wxTreeItemId();	m_prototypesNode = wxTreeItemId();	m_macrosNode = wxTreeItemId();	m_sortItems.clear();	m_fileName = fileName;	// Get the current tree	m_tree = TagsManagerST::Get()->Load(m_fileName);	if ( !m_tree ) {		return;	}	// Add invisible root node	wxTreeItemId root;	root = AddRoot(fileName.GetFullName(), 15, 15);	TreeWalker<wxString, TagEntry> walker(m_tree->GetRoot());	// add three items here:	// the globals node, the mcros and the prototype node	m_globalsNode    = AppendItem(root, wxT("Global Functions and Variables"), 2, 2, new MyTreeItemData(wxT("Global Functions and Variables"), wxEmptyString));	m_prototypesNode = AppendItem(root, wxT("Functions Prototypes"), 2, 2, new MyTreeItemData(wxT("Functions Prototypes"), wxEmptyString));	m_macrosNode     = AppendItem(root, wxT("Macros"), 2, 2, new MyTreeItemData(wxT("Macros"), wxEmptyString));	// Iterate over the tree and add items	m_sortItems.clear();	Freeze();	for (; !walker.End(); walker++) {		// Add the item to the tree		TagNode* node = walker.GetNode();		// Skip root node		if (node->IsRoot())			continue;		// Add the node		AddItem(node);	}	SortTree(m_sortItems);	Thaw();	//select the root node by default	if (!(GetWindowStyleFlag() & wxTR_HIDE_ROOT)) {		//root is visible, select it		SelectItem(GetRootItem());	}}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:54,


示例20: AddRoot

wxTreeItemId CocaSystemTree::add( const coca::ISystem& system, wxString name ){    wxTreeItemId id = AddRoot( name, E_COCA_IMAGE );    if ( system.getRoot() ) { add( *system.getRoot(), id ); }    Expand( id );    EnsureVisible( id );    SelectItem( id );    return id;}
开发者ID:harmboschloo,项目名称:CocaProject,代码行数:11,


示例21: AddRoot

void browsers::TDTbrowser::collectInfo(const wxString libname, laydata::TDTHierTree* tdtH) {   AddRoot(libname);   if (!tdtH) return; // new, empty design    laydata::TDTHierTree* root = tdtH->GetFirstRoot();   wxTreeItemId nroot;   while (root){      nroot = AppendItem(GetRootItem(), wxString(root->GetItem()->name().c_str()));      SetItemTextColour(nroot,*wxLIGHT_GREY);      collectChildren(root, nroot);      root = root->GetNextRoot();   }}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:12,


示例22: DUI_ASSERT

HDUITREEITEM	CDUITreeViewImpl::AddChildItem(HDUITREEITEM hParent , HDUITREEITEM hChild) {	DUI_ASSERT(hChild);	if ( hParent == NULL )		return AddRoot(hChild);	if ( hParent->AddControl(hChild) )		return hChild;	return NULL;}
开发者ID:achellies,项目名称:DUI,代码行数:12,


示例23: AppendItem

// create a new tree item and insert it into the treeRegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(    TreeNode *pParent,    const wxString& strName,    int idImage,    const wxString *pstrValue,    wxRegKey::WOW64ViewMode viewMode){    // create new item & insert it    TreeNode *pNewNode = new TreeNode;    pNewNode->m_pTree  = this;    pNewNode->m_pParent = pParent;    pNewNode->m_strName = strName;    pNewNode->m_bKey    = pstrValue == NULL;    pNewNode->m_pKey    = NULL;    pNewNode->m_viewMode = viewMode;    if (pParent)    {        pNewNode->m_id  = AppendItem(pParent->Id(),            pNewNode->IsKey() ? strName : *pstrValue,            idImage);    }    else    {        pNewNode->m_id  = AddRoot(strName);    }    wxASSERT_MSG( pNewNode->m_id, wxT("can't create tree control item!"));    // save the pointer in the item    SetItemData(pNewNode->m_id, pNewNode);    // add it to the list of parent's children    if ( pParent != NULL )    {        pParent->m_aChildren.Add(pNewNode);    }    if ( pNewNode->IsKey() )    {        SetItemHasChildren(pNewNode->Id());        if ( !pNewNode->IsRoot() )        {            // set the expanded icon as well            SetItemImage(pNewNode->Id(),                RegImageList::OpenedKey,                wxTreeItemIcon_Expanded);        }    }    return pNewNode;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:53,


示例24: dummy

void DESIGN_TREE_FRAME::ReCreateDesignTree(){    wxWindowUpdateLocker dummy(this);   // Avoid flicker when rebuilding the tree    DeleteAllItems();    const WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();    // root tree:    wxFileName      fn( ((PL_EDITOR_FRAME*) GetParent())->GetCurrFileName() );    wxTreeItemId    rootitem;    if( fn.GetName().IsEmpty() )        rootitem = AddRoot( wxT( "<default>" ), 0, 0 );    else        rootitem = AddRoot( fn.GetName(), 0, 0 );    SetItemBold( rootitem, true );    // Now adding all current items    for( unsigned ii = 0; ii < pglayout.GetCount(); ii++ )    {        WORKSHEET_DATAITEM* item = pglayout.GetItem( ii );        int img = 0;        switch( item->GetType() )        {            case WORKSHEET_DATAITEM::WS_SEGMENT: img = 1; break;            case WORKSHEET_DATAITEM::WS_RECT: img = 2; break;            case WORKSHEET_DATAITEM::WS_TEXT: img = 3; break;            case WORKSHEET_DATAITEM::WS_POLYPOLYGON: img = 4; break;            case WORKSHEET_DATAITEM::WS_BITMAP: img = 5; break;        }        wxTreeItemId cell= AppendItem( rootitem, item->m_Name, img, img );        DESIGN_TREE_ITEM_DATA* data = new DESIGN_TREE_ITEM_DATA( item );        SetItemData( cell, data );    }    Expand( rootitem );}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:39,


示例25: noUpdate

wxTreeItemId udCodeItemsTree::CreateTreeItems(udProjectItem* item, wxTreeItemId parent){	wxTreeItemId treeId;    if( item )    {		#ifdef __WXMSW__		wxWindowUpdateLocker noUpdate( this );		#endif		int nImageIndex = udArt::GetImageIndex(item->GetClassInfo()->GetClassName());		        // create tree item relevat to project items        if( item->IsKindOf( CLASSINFO(udRootItem)) )        {			treeId = AddRoot( wxT("Reusable code fragments"), nImageIndex, nImageIndex, new udTreeItem(this, item));			//EnsureVisible( treeId );			//Expand( treeId );			m_mapTreeItems[ (wxUIntPtr)item ] = treeId;        }		else if( item->IsKindOf( CLASSINFO(udCodePackageItem)) )		{			treeId = CreateItem( parent, item, nImageIndex );			//EnsureVisible( treeId );			//Expand( treeId );		}		else if( item->IsKindOf( CLASSINFO(udVariableItem)) || 				 item->IsKindOf( CLASSINFO(udFunctionItem)) ) 		{			treeId = CreateItem( parent, item, nImageIndex );		}				// show new tree item		if( treeId.IsOk() )		{			EnsureVisible( treeId );			Expand( treeId );					// create item's children as well			SerializableList::compatibility_iterator node = item->GetFirstChildNode();			while(node)			{				CreateTreeItems((udProjectItem*)node->GetData(), treeId);				node = node->GetNext();			}		}	}		return treeId;}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:50,



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


C++ AddSC_SmartSCripts函数代码示例
C++ AddResource函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。