本文整理汇总了C++中wxTreeEvent::GetItem方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetItem方法的具体用法?C++ wxTreeEvent::GetItem怎么用?C++ wxTreeEvent::GetItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnItemRClick
void MyTreeCtrl::OnItemRClick(wxTreeEvent& event)
{
wxTreeItemId itemId = event.GetItem();
MyTreeItemData *item = itemId.IsOk() ? (MyTreeItemData *)GetItemData(itemId)
: NULL;
wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc()
: _T(""));
event.Skip();
}
示例2: OnCollapse
void frmMain::OnCollapse(wxTreeEvent &event)
{
#ifdef WIN32
// This is weird stuff, but somewhere comes a collapse after we have done
// connecting the server and expanding the tree.
// Possibly not necessary
if (event.GetItem() == denyCollapseItem)
event.Veto();
#endif
denyCollapseItem = wxTreeItemId();
}
示例3: OnItemMenu
void luProjTree::OnItemMenu(wxTreeEvent& event)
{
wxTreeItemId itemId = event.GetItem();
wxPoint clientpt = event.GetPoint();
wxPoint screenpt = ClientToScreen(clientpt);
showMenu(itemId, clientpt);
event.Skip();
}
示例4: OnItemCollapsing
// item collapse event handler
void fileDissectTreeCtrl::OnItemCollapsing(wxTreeEvent& event)
{
wxTreeItemId id = event.GetItem();
// prevent the root from collapsing
if (id == GetRootItem())
{
event.Veto();
return;
}
}
示例5: OnItemMenu
void ModelListTree::OnItemMenu(wxTreeEvent& event)
{
ModelTreeItemData* itemData = (ModelTreeItemData*)GetItemData(event.GetItem());
Model* model = itemData->GetModel();
wxPoint pt = event.GetPoint();
wxMenu menu;
menu.Append(ID_MODEL_PANEL_ITEM_MENU_ADD_TO_SCENE, wxT("&add to scene"));
PopupMenu(&menu, pt);
}
示例6: OnSelectModInMasterlist
void UserRulesEditorFrame::OnSelectModInMasterlist(wxTreeEvent& event) {
//Need to find item in masterlist. :( Why can't tree lists store index number?
string itemStr = MasterlistModsList->GetItemText(event.GetItem()).ToUTF8();
size_t pos = game.masterlist.FindItem(itemStr, MOD);
if (pos != game.masterlist.Items().size()) {
string messagesOut = "";
vector<Message> messages = game.masterlist.ItemAt(pos).Messages();
for (vector<Message>::iterator messageIter = messages.begin(); messageIter != messages.end(); ++messageIter)
messagesOut += messageIter->KeyToString() + ": " + messageIter->Data() + "\n\n";
ModMessagesBox->SetValue(wxString(messagesOut.substr(0,messagesOut.length()-2).c_str(), wxConvUTF8));
}
}
示例7: OnTreeBeginLabelEdit
void PanelObjectList::OnTreeBeginLabelEdit(wxTreeEvent& event)
{
wxTreeItemId id = event.GetItem();
TreeItemDataGenericObjectInfo* pData = (TreeItemDataGenericObjectInfo*)m_pTree_Objects->GetItemData( id );
// don't allow edits if there's no callback.
if( pData == 0 || pData->m_pLabelEditFunction == 0 )
{
// cancel the edit
event.Veto();
}
}
示例8: onItemCollapsing
void CategoryTree::onItemCollapsing( wxTreeEvent& p_event ) {
auto id = p_event.GetItem( );
auto* itemData = static_cast<const CategoryTreeItem*>( this->GetItemData( id ) );
// Skip if this is not a category
if ( !itemData || itemData->dataType( ) != CategoryTreeItem::DT_Category ) {
return;
}
// Set icon to the closed folder
this->SetItemImage( id, CategoryTreeImageList::IT_ClosedFolder );
}
示例9: GetItemData
void
SamplesTreeCtrl::onCollapsing( wxTreeEvent &event )
{
wxTreeItemId item = event.GetItem();
wxTreeItemData *data = GetItemData( item );
if ( !data ) // Prevent collapsing of speakers
{
event.Veto();
return;
}
}
示例10: OnItemActivated
void luProjTree::OnItemActivated(wxTreeEvent& event)
{
wxTreeItemId itemId = event.GetItem();
ItemData* item = (ItemData*)GetItemData(itemId);
luMainFrame* frame = getLuMainFrame();
if (!item || !frame) return;
int data = item->GetData();
wxString name = item->GetName();
}
示例11: OnExpandItem
void wxGenericDirCtrl::OnExpandItem(wxTreeEvent &event)
{
wxTreeItemId parentId = event.GetItem();
// VS: this is needed because the event handler is called from wxTreeCtrl
// ctor when wxTR_HIDE_ROOT was specified
if (!m_rootId.IsOk())
m_rootId = m_treeCtrl->GetRootItem();
ExpandDir(parentId);
}
示例12: SceneTooltipSet
void ScenePanel::SceneTooltipSet(wxTreeEvent& evt)
{
wxTreeItemId item = evt.GetItem();
SceneTreeItemData *sceneData = dynamic_cast<SceneTreeItemData*>(mSceneTree->GetItemData(item));
if (sceneData != NULL)
{
evt.SetToolTip(wxString::Format(wxT("%d meshes"), sceneData->GetData()->mNumMeshes));
}
return;
}
示例13: OnSelRightClick
////////////////////////////////////////////////////////////////////////////////
// This handler will display a popup menu for the item at the mouse position
////////////////////////////////////////////////////////////////////////////////
void frmMain::OnSelRightClick(wxTreeEvent& event)
{
wxTreeItemId item = event.GetItem();
if (item != browser->GetSelection())
{
browser->SelectItem(item);
currentObject = browser->GetObject(item);
}
if (currentObject)
doPopup(browser, event.GetPoint(), currentObject);
}
示例14: OnChange
void YardEmployee::OnChange(wxTreeEvent& event)
{
m_loading = true;
empItemData * data = static_cast<empItemData *>(m_tree->GetItemData(event.GetItem()));
if (!data)
return;
try {
m_emp = wxGetApp().DB().EmployeeGet(data->GetID());
}
catch (YardDBException& e)
{
wxLogDebug(wxT("Error (employee not loaded): %s, %s"),e.what(), e.GetSQL().c_str());
return;
}
if (m_emp.GetPicLocal() != "")
{
wxImage pic(m_emp.GetPicLocal().c_str());
if (pic.Ok())
m_pic->SetBitmap(pic);
else
wxLogDebug(wxT("Bad image data (pic)."));
}
else
m_pic->SetBitmap(wxImage("res/ys_employee_128x128.png"));
if (m_emp.GetSigLocal() != "")
{
wxImage sig(m_emp.GetSigLocal().c_str());
if (sig.Ok())
m_sig->SetBitmap(sig);
else
wxLogDebug(wxT("Bad image data (sig)."));
}
else
m_sig->SetBitmap(wxNullBitmap);
m_first->SetValue(m_emp.GetFirst().c_str());
m_middle->SetValue(m_emp.GetMiddle().c_str());
m_last->SetValue(m_emp.GetLast().c_str());
m_address->SetValue(m_emp.GetAddress().c_str());
m_id->SetValue(m_emp.GetIdS().c_str());
m_taxid->SetValue(m_emp.GetTaxIdS().c_str());
m_phone->SetValue(m_emp.GetPhone().c_str());
wxString pos;
pos.Printf(wxT("Title: %s"), m_emp.GetACL().c_str());
m_position->SetLabel(pos);
pos.Printf(wxT("Hire date: %s"), m_emp.GetSince().c_str());
m_hire->SetLabel(pos);
m_loading = false;
}
示例15: OnSelectionChanged
void WorkspacePanel::OnSelectionChanged(wxTreeEvent& event)
{
SelectionList list;
wxTreeItemId id = event.GetItem();
if(isProject(id)) list.push_back(getProject(id));
else if(isMaterial(id)) list.push_back(getMaterial(id));
else if(isTechnique(id)) list.push_back(getTechnique(id));
else if(isPass(id)) list.push_back(getPass(id));
// else its the workspace so just leave the list empty as if nothing were selected
SelectionService::getSingletonPtr()->setSelection(list);
}