本文整理汇总了C++中wxTreeItemId类的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeItemId类的具体用法?C++ wxTreeItemId怎么用?C++ wxTreeItemId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxTreeItemId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WXUNUSED
void BundlePane::OnMenuExport(wxCommandEvent& WXUNUSED(event)) {
const wxTreeItemId selItem = m_bundleTree->GetSelection();
if (!selItem.IsOk()) return;
// Get the item name
const BundleItemData* data = (BundleItemData*)m_bundleTree->GetItemData(selItem);
wxString name;
if (data->IsBundle()) {
const wxFileName bundlePath = m_plistHandler.GetBundlePath(data->m_bundleId);
name = bundlePath.GetDirs().Last();
}
else {
const wxFileName bundlePath = m_plistHandler.GetBundleItemPath(data->m_type, data->m_bundleId, data->m_itemId);
name = bundlePath.GetFullName();
}
// Get destination path from user
const wxString msg = data->IsBundle() ? _("Export Bundle as..") : _("Export Bundle Item as");
wxFileDialog dlg(this, msg, wxEmptyString, name, wxFileSelectorDefaultWildcardStr, wxFD_SAVE);
if (dlg.ShowModal() != wxID_OK) return;
const wxString path = dlg.GetPath();
if (path.empty()) return;
// Export the item
if (data->IsBundle()) {
wxFileName dstPath;
dstPath.AssignDir(path);
m_plistHandler.ExportBundle(dstPath, data->m_bundleId);
}
else m_plistHandler.ExportBundleItem(path, data->m_type, data->m_bundleId, data->m_itemId);
}
开发者ID:khmerlovers,项目名称:e,代码行数:31,代码来源:BundlePane.cpp
示例2: wxCHECK_MSG
wxTreeItemId PHPFileLayoutTree::TryGetPrevItem(wxTreeItemId item)
{
wxCHECK_MSG(item.IsOk(), wxTreeItemId(), wxT("invalid tree item"));
// find out the starting point
wxTreeItemId prevItem = GetPrevSibling(item);
if(!prevItem.IsOk()) {
prevItem = GetItemParent(item);
if(prevItem == GetRootItem()) {
return wxTreeItemId();
}
}
// from there we must be able to navigate until this item
while(prevItem.IsOk()) {
ScrollTo(prevItem);
if(!IsVisible(prevItem)) {
return wxTreeItemId();
}
const wxTreeItemId nextItem = GetNextVisible(prevItem);
if(!nextItem.IsOk() || nextItem == item) return prevItem;
prevItem = nextItem;
}
return wxTreeItemId();
}
开发者ID:05storm26,项目名称:codelite,代码行数:30,代码来源:php_file_layout_tree.cpp
示例3: DoInternalGetPage
int wxTreebook::GetPageParent(size_t pagePos) const
{
wxTreeItemId nodeId = DoInternalGetPage( pagePos );
wxCHECK_MSG( nodeId.IsOk(), wxNOT_FOUND, wxT("Invalid page index spacified!") );
const wxTreeItemId parent = GetTreeCtrl()->GetItemParent( nodeId );
return parent.IsOk() ? DoInternalFindPageById(parent) : wxNOT_FOUND;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:9,代码来源:treebkg.cpp
示例4: wxASSERT
bool BundlePane::IsTreeItemParentOf(const wxTreeItemId parent, const wxTreeItemId child) const {
wxASSERT(parent.IsOk() && child.IsOk());
wxTreeItemId item = m_bundleTree->GetItemParent(child);
while (item.IsOk()) {
if (item == parent) return true;
item = m_bundleTree->GetItemParent(item);
}
return false;
}
开发者ID:khmerlovers,项目名称:e,代码行数:12,代码来源:BundlePane.cpp
示例5: FindWindow
void ecAdminDialog::OnRemove(wxCommandEvent& event)
{
wxTreeCtrl* treeCtrl = (wxTreeCtrl*) FindWindow( ecID_ADMIN_DIALOG_TREE) ;
const wxTreeItemId hTreeItem = treeCtrl->GetSelection ();
if (! hTreeItem || !hTreeItem.IsOk())
return;
if (wxYES != wxMessageBox (_("The selected package will be deleted from the repository. Core eCos packages may be restored only by reinstalling eCos.\n\nDo you wish to continue?"),
_("Remove Package"), wxYES_NO | wxICON_EXCLAMATION))
return;
ecAdminItemData* data = (ecAdminItemData*) treeCtrl->GetItemData (hTreeItem);
if (data) // if a package node is selected
{
// remove all package version nodes
wxString pstrPackage(data->m_string);
bool bStatus = TRUE;
long cookie;
wxTreeItemId hChildItem = treeCtrl->GetFirstChild (hTreeItem, cookie);
while (hChildItem && bStatus)
{
const wxTreeItemId hNextChildItem = treeCtrl->GetNextSibling (hChildItem);
bStatus = RemovePackageVersion (hChildItem);
hChildItem = hNextChildItem;
}
// remove the package node
if (bStatus)
{
treeCtrl->Delete (hTreeItem);
}
}
else // a version node is selected
{
// remove the version node
const wxTreeItemId hParentItem = treeCtrl->GetParent (hTreeItem);
wxASSERT (hParentItem && hParentItem.IsOk() );
if (RemovePackageVersion (hTreeItem) && ! treeCtrl->ItemHasChildren (hParentItem)) // if the only version was deleted
{
// remove the package node
treeCtrl->Delete (hParentItem);
}
}
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:51,代码来源:admindlg.cpp
示例6: MoreOfAnItem
void
DeckLibraryTab::MoreOfAnItem (wxTreeItemId oItemId, long lCount)
{
wxTreeItemId oChild;
wxTreeItemIdValue cookie;
long lCardRef;
if (!oItemId.IsOk ()) return;
MyTreeItemData * pData = (MyTreeItemData *) m_pTree->GetItemData (oItemId);
if (pData != NULL) {
// we know what to modify
lCardRef = pData->GetValue ();
if (lCardRef >= 0) {
if (lCount > 0) {
m_pModel->AddToLibrary (lCardRef, lCount, TRUE);
} else {
m_pModel->DelFromLibrary (lCardRef, -lCount, TRUE);
}
}
} else {
// We don't know what to modify, so we'll try with a child
oChild = m_pTree->GetFirstChild (oItemId, cookie);
if (oChild.IsOk ()) {
MoreOfAnItem (oChild, lCount);
}
}
}
开发者ID:ErikGartner,项目名称:ardb,代码行数:28,代码来源:decklibrarytab.cpp
示例7: Source_Drop
//---------------------------------------------------------
bool CData_Source_PgSQL::Source_Drop(const wxTreeItemId &Item)
{
static wxString Username = "postgres", Password = "postgres";
CData_Source_PgSQL_Data *pData = Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL ) return( false );
if( !DLG_Login(Username, Password, _TL("Drop Database")) )
{
return( false );
}
pData->Set_Username(Username);
pData->Set_Password(Password);
if( pData->Get_Type() == TYPE_SOURCE && pData->is_Connected() )
{
RUN_MODULE(DB_PGSQL_DB_Drop, true, // CDatabase_Drop
SET_PARAMETER("PG_HOST", pData->Get_Host ())
&& SET_PARAMETER("PG_PORT", pData->Get_Port ())
&& SET_PARAMETER("PG_NAME", pData->Get_DBName ())
&& SET_PARAMETER("PG_USER", pData->Get_Username())
&& SET_PARAMETER("PG_PWD" , pData->Get_Password())
);
return( bResult );
}
return( false );
}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:30,代码来源:data_source_pgsql.cpp
示例8: Source_Create
//---------------------------------------------------------
bool CData_Source_PgSQL::Source_Create(const wxTreeItemId &Item)
{
CData_Source_PgSQL_Data *pData = Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL ) return( false );
if( pData->Get_Type() == TYPE_ROOT
|| pData->Get_Type() == TYPE_SERVER )
{
CSG_Module *pModule = SG_Get_Module_Library_Manager().Get_Module("db_pgsql", DB_PGSQL_DB_Create);
if( pModule && pModule->On_Before_Execution() )
{
if( pData->Get_Type() == TYPE_SERVER )
{
pModule->Set_Parameter("PG_HOST", pData->Get_Host());
pModule->Set_Parameter("PG_PORT", pData->Get_Port());
}
if( DLG_Parameters(pModule->Get_Parameters()) )
{
pModule->Execute();
}
}
}
return( true );
}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:27,代码来源:data_source_pgsql.cpp
示例9: if
//---------------------------------------------------------
void CData_Source_PgSQL::Append_Table(const wxTreeItemId &Parent, const SG_Char *Name, int Type, int Image)
{
CData_Source_PgSQL_Data *pData = Parent.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Parent) : NULL; if( pData == NULL ) return;
wxTreeItemId Item = AppendItem(Parent, Name, Image, Image, new CData_Source_PgSQL_Data(Type, Name, pData->Get_Server()));
if( Type == TYPE_GRIDS )
{
CSG_Table Grids;
RUN_MODULE(DB_PGSQL_Table_Query, false, // CTable_Query
SET_PARAMETER("CONNECTION", pData->Get_Server())
&& SET_PARAMETER("TABLES" , Name)
&& SET_PARAMETER("TABLE" , &Grids)
&& SET_PARAMETER("FIELDS" , SG_T("rid, name"))
);
if( bResult )
{
for(int i=0; i<Grids.Get_Count(); i++)
{
AppendItem(Item, Grids[i].asString(1), IMG_GRID, IMG_GRID,
new CData_Source_PgSQL_Data(TYPE_GRID, CSG_String::Format("%s:rid=%d", Name, Grids[i].asInt(0)), pData->Get_Server())
);
}
}
}
}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:29,代码来源:data_source_pgsql.cpp
示例10: Source_Open
//---------------------------------------------------------
void CData_Source_PgSQL::Source_Open(const wxTreeItemId &Item)
{
CData_Source_PgSQL_Data *pData = Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL ) return;
if( pData->Get_Type() == TYPE_ROOT
|| pData->Get_Type() == TYPE_SERVER )
{
CSG_Module *pModule = SG_Get_Module_Library_Manager().Get_Module("db_pgsql", DB_PGSQL_Get_Connection); // CGet_Connection
if( pModule && pModule->On_Before_Execution() )
{
if( pData->Get_Type() == TYPE_SERVER )
{
pModule->Set_Parameter("PG_HOST", pData->Get_Host());
pModule->Set_Parameter("PG_PORT", pData->Get_Port());
}
if( DLG_Parameters(pModule->Get_Parameters()) )
{
pModule->Execute();
}
}
}
else if( pData->is_Connected() )
{
Update_Source(Item);
}
else if( !Source_Open(pData, true) )
{
DLG_Message_Show_Error(_TL("Could not connect to data source."), _TL("Connect to PostgreSQL"));
}
}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:33,代码来源:data_source_pgsql.cpp
示例11: GetFirstChild
wxTreeItemId CocaSystemTree::findId( const void* nodePointer, wxTreeItemId id ) const
{
if ( !id.IsOk() ) { return id; }
if ( nodePointer == getNode( id ) ) { return id; }
wxTreeItemIdValue cookie = 0;
id = GetFirstChild( id, cookie );
for ( ; id.IsOk(); id = GetNextSibling( id ) )
{
wxTreeItemId foundId = findId( nodePointer, id );
if ( foundId.IsOk() ) { return foundId; }
}
return id; // is invalid
}
开发者ID:harmboschloo,项目名称:CocaProject,代码行数:16,代码来源:CocaSystemTree.cpp
示例12: Search
void MainWindow::Search(wxTreeItemId search,bool toogle)
{
wxTreeItemIdValue cookie;
NodeTree *itemData = search.IsOk() ? (NodeTree *) tree->GetItemData(search)
:NULL;
if(itemData->getTipo()==N_World )
if(itemData->pointer.world->getNumObjects()!=0)
Search(tree->GetFirstChild(search,cookie),toogle);
if(itemData->menus.menu_positionable)
{
if(itemData->menus.menu_composed || itemData->pointer.positionableentity->getOwner()->getClassName()=="World")
{
if(toogle)
itemData->pointer.positionableentity->setDrawReferenceSystem();
else
itemData->pointer.positionableentity->setDrawReferenceSystem(false);
if(itemData->menus.menu_composed)
if(itemData->pointer.composedentity->getNumObjects()>0)
Search(tree->GetFirstChild(search,cookie),toogle);
}
}
if(tree->GetLastChild(tree->GetItemParent(search))==search)
return;
Search(tree->GetNextSibling(search),toogle);
}
开发者ID:CristinaGajate,项目名称:Apolo,代码行数:30,代码来源:mainWindow.cpp
示例13: GetTreeItem
wxTreeItemId wxSpinTreeCtrl::GetTreeItem(const char *nodeId, wxTreeItemId idParent, wxTreeItemIdValue cookie)
{
if (! idParent.IsOk())
return NULL;
wxSpinTreeItemData *treeData = (wxSpinTreeItemData*)GetItemData(idParent);
if (treeData && treeData->m_pNode.valid())
{
if (strcmp(treeData->m_pNode->id->s_name, nodeId) == 0)
{
return idParent;
}
}
if (ItemHasChildren(idParent))
{
wxTreeItemId child;
for (child = GetFirstChild(idParent, cookie); child.IsOk(); child = GetNextChild(idParent, cookie))
{
wxTreeItemId targetItem = GetTreeItem(nodeId, child, cookie);
if (targetItem.IsOk())
return targetItem;
}
}
return GetTreeItem(nodeId, GetNextSibling(idParent), cookie);
}
开发者ID:mikewoz,项目名称:spinframework,代码行数:26,代码来源:wxSpinTreeCtrl.cpp
示例14: RecursiveSearch
bool ClassBrowser::RecursiveSearch(const wxString& search, wxTreeCtrl* tree, const wxTreeItemId& parent, wxTreeItemId& result)
{
if (!parent.IsOk() || !tree)
return false;
// first check the parent item
if (FoundMatch(search, tree, parent))
{
result = parent;
return true;
}
wxTreeItemIdValue cookie;
wxTreeItemId child = tree->GetFirstChild(parent, cookie);
if (!child.IsOk())
return RecursiveSearch(search, tree, FindNext(search, tree, parent), result);
while (child.IsOk())
{
if (FoundMatch(search, tree, child))
{
result = child;
return true;
}
if (tree->ItemHasChildren(child))
{
if (RecursiveSearch(search, tree, child, result))
return true;
}
child = tree->GetNextChild(parent, cookie);
}
return RecursiveSearch(search, tree, FindNext(search, tree, parent), result);
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:35,代码来源:classbrowser.cpp
示例15: wxT
wxString DebuggerTreeListCtrlBase::GetItemPath(const wxTreeItemId &item)
{
wxArrayString pathArr;
if(item.IsOk() == false)
return wxT("");
DbgTreeItemData* data = (DbgTreeItemData*) m_listTable->GetItemData(item);
if(data && data->_gdbId.IsEmpty()) {
// not a variable object item
return m_listTable->GetItemText(item);
}
wxTreeItemId parent = item;
while(parent.IsOk() && m_listTable->GetRootItem() != parent) {
DbgTreeItemData* itemData = (DbgTreeItemData*) m_listTable->GetItemData(parent);
if(itemData && !itemData->_isFake) {
pathArr.Add(m_listTable->GetItemText(parent));
}
parent = m_listTable->GetItemParent(parent);
}
if(pathArr.IsEmpty())
return wxT("");
wxString itemPath;
for(int i=(int)pathArr.GetCount()-1; i>=0; i--) {
itemPath << pathArr.Item(i) << wxT(".");
}
itemPath.RemoveLast();
return itemPath;
}
开发者ID:since2014,项目名称:codelite,代码行数:31,代码来源:simpletablebase.cpp
示例16: RenameObject
void PanelObjectList::RenameObject(wxTreeItemId id, const char* desc)
{
if( id.IsOk() )
{
m_pTree_Objects->SetItemText( id, desc );
}
}
开发者ID:jaccen,项目名称:MyFramework,代码行数:7,代码来源:PanelObjectList.cpp
示例17: GetItemText
wxTreeItemId PHPFileLayoutTree::RecurseSearch(const wxTreeItemId& item, const wxString& word)
{
if(!item.IsOk()) return wxTreeItemId();
if(item != GetRootItem()) {
wxString curtext = GetItemText(item);
curtext.MakeLower();
if(curtext.StartsWith(word)) {
return item;
}
}
if(ItemHasChildren(item)) {
wxTreeItemIdValue cookie;
wxTreeItemId child = GetFirstChild(item, cookie);
while(child.IsOk()) {
wxTreeItemId selection = RecurseSearch(child, word);
if(selection.IsOk()) {
return selection;
}
child = GetNextChild(item, cookie);
}
}
return wxTreeItemId();
}
开发者ID:05storm26,项目名称:codelite,代码行数:26,代码来源:php_file_layout_tree.cpp
示例18: GetFirstChild
wxTreeItemId luProjTree::findItemByData(const wxTreeItemId& parent, const wxString& data)
{
if (!parent.IsOk()) return parent;
ItemData* item = dynamic_cast<ItemData*>(GetItemData(parent));
if (item && item->GetName() == data)
return parent;
if (item) gkPrintf("%s", (const char*)item->GetName());
if (HasChildren(parent))
{
wxTreeItemIdValue cookie;
wxTreeItemId item = GetFirstChild(parent, cookie);
while (item.IsOk())
{
wxTreeItemId find = findItemByData(item, data); //find is item self or children.
if (find.IsOk()) return find;
item = GetNextChild(item, cookie);
}
}
return wxTreeItemId(); //not found
}
开发者ID:dryadf68116,项目名称:vuforia-gamekit-integration,代码行数:25,代码来源:luProjPanel.cpp
示例19: ShowMenu
void SkillObjectTree::ShowMenu(wxTreeItemId id, const wxPoint& pt)
{
SkillTreeItemData *item = id.IsOk() ? (SkillTreeItemData *)GetItemData(id): NULL;
if (item == NULL)
{
return;
}
if (item->GetDesc() == "Skill root item")
{
wxMenu menu("");
menu.Append(feID_MENU_SKILL_NEW_EFFECT, wxT("添加效果"));
menu.Append(feID_MENU_SKILL_NEW_CAMERASHAKE, wxT("添加相机震动"));
menu.Append(feID_MENU_SKILL_NEW_RIBBON, wxT("添加刀光"));
menu.Append(feID_MENU_SKILL_NEW_SOUND, wxT("添加声音"));
menu.Append(feID_MENU_SKILL_NEW_SCENELIGHT, wxT("添加场景灯光"));
menu.Append(FEID_MENU_SKILL_NEW_BULLETFLOW, wxT("添加导弹"));
PopupMenu(&menu, pt);
}
else if (item->GetDesc() == "Skill Element")
{
wxMenu menu("");
menu.Append(feID_MENU_SKILL_DELEMENT_ELEMENT, wxT("删除元素"));
PopupMenu(&menu, pt);
}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:26,代码来源:SkillObjectTree.cpp
示例20: ShowMenu
void DebuggerTree::ShowMenu(wxTreeItemId id, const wxPoint& pt)
{
wxString caption;
wxMenu menu(wxEmptyString);
// if we right-clicked on a pointer, add a "dereference pointer" entry
wxString itemtext = m_pTree->GetItemText(id);
if (itemtext.Find(_T('*')) != wxNOT_FOUND)
{
menu.Append(idDereferenceValue, wxString::Format(_("Dereference pointer '%s'"), itemtext.BeforeFirst(_T('=')).c_str()));
menu.AppendSeparator();
}
// add watch always visible
menu.Append(idAddWatch, _("&Add watch"));
menu.Append(idWatchThis, _("Watch '*&this'"));
// we have to have a valid id for the following to be enabled
WatchTreeData* data = dynamic_cast<WatchTreeData*>(m_pTree->GetItemData(id));
if (id.IsOk() && // valid item
data && data->m_pWatch) // *is* a watch
{
menu.Append(idEditWatch, _("&Edit watch"));
menu.Append(idDeleteWatch, _("&Delete watch"));
}
menu.AppendSeparator();
menu.Append(idChangeValue, _("&Change value..."));
menu.AppendSeparator();
menu.Append(idLoadWatchFile, _("&Load watch file"));
menu.Append(idSaveWatchFile, _("&Save watch file"));
menu.AppendSeparator();
menu.Append(idDeleteAllWatches, _("Delete all watches"));
PopupMenu(&menu, pt);
}
开发者ID:yjdwbj,项目名称:cb10-05-ide,代码行数:35,代码来源:debuggertree.cpp
注:本文中的wxTreeItemId类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论