本文整理汇总了C++中wxTreeEvent::GetKeyCode方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetKeyCode方法的具体用法?C++ wxTreeEvent::GetKeyCode怎么用?C++ wxTreeEvent::GetKeyCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetKeyCode方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyDown
void FileExplorerTab::OnKeyDown(wxTreeEvent& event)
{
if(event.GetKeyCode() == WXK_DELETE || event.GetKeyCode() == WXK_NUMPAD_DELETE) {
wxCommandEvent dummy;
OnDeleteNode(dummy);
} else {
event.Skip();
}
}
示例2: OnTreeKeyDown
void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
{
if(event.GetKeyCode() == WXK_RETURN)
OnOK(event);
else
event.Skip(); // Ensure standard behavior when enter is not pressed
}
示例3: OnTreeKeyDown
void SceneBrowser::OnTreeKeyDown(wxTreeEvent& event)
{
switch (event.GetKeyCode())
{
case WXK_F2:
wxStaticCast(event.GetEventObject(), wxTreeCtrl)->EditLabel(mActivedItem);
break;
case WXK_DELETE:
{
mSceneManipulator->removeSelectedObjects(this);
CountLocker locker(mDisableNotifyEvent);
wxTreeCtrl* tree = wxStaticCast(event.GetEventObject(), wxTreeCtrl);
wxArrayTreeItemIds selections;
int count = tree->GetSelections(selections);
for (int i = 0; i < count; ++i)
{
wxTreeItemId item = selections[i];
ObjectItemData* data = static_cast<ObjectItemData*>(tree->GetItemData(item));
if (data)
{
wxASSERT(data->object.expired());
tree->Delete(item);
}
}
}
break;
}
}
示例4: OnItemActivated
void CppSymbolTree::OnItemActivated(wxTreeEvent &event)
{
if (event.GetKeyCode() == WXK_RETURN) {
wxTreeItemId item = GetSelection();
DoItemActivated(item, event, true);
} else {
event.Skip();
}
}
示例5: OnKeyDown
void PanelObjectList::OnKeyDown(wxTreeEvent& event)
{
if( event.GetKeyCode() == WXK_F2 )
{
wxArrayTreeItemIds selecteditems;
unsigned int numselected = (unsigned int)g_pPanelObjectList->m_pTree_Objects->GetSelections( selecteditems );
if( numselected == 1 )
{
wxTreeItemId id = selecteditems[0].GetID();
m_pTree_Objects->EditLabel( id );
}
return;
}
event.Skip();
}
示例6: OnTreeKeyDown
// unfortunately, under GTK we won't get the original wxKeyEvent
// to reset m_metaDown
void frmMain::OnTreeKeyDown(wxTreeEvent& event)
{
switch (event.GetKeyCode())
{
case WXK_F1:
OnHelp(event);
break;
case WXK_F5:
Refresh(currentObject);
break;
case WXK_DELETE:
OnDelete(event);
break;
default:
event.Skip();
break;
}
}
示例7: OnTreeKeyDown
void LocationDlg::OnTreeKeyDown( wxTreeEvent &event )
{
if (event.GetKeyCode() != WXK_DELETE)
{
event.Skip();
return;
}
wxTreeItemId selid = m_current;
wxTreeItemId parent = GetAnimTree()->GetItemParent(selid);
if (parent == m_root)
{
// delete anim
m_pAnimPaths->erase(m_pAnimPaths->begin() + m_iAnim);
m_iAnim = -1;
RefreshAnims();
UpdateEnabling();
}
else
{
// delete point
wxTreeItemIdValue cookie;
wxTreeItemId id;
int count = 0;
for (id = GetAnimTree()->GetFirstChild(parent, cookie);
id.IsOk();
id = GetAnimTree()->GetNextChild(parent, cookie))
{
if (id == selid)
break;
count++;
}
vtAnimPath *anim = GetAnim(m_iAnim);
anim->RemovePoint(count);
GetAnimTree()->Delete(m_current);
}
}
示例8: OnTreeKeyDown
// unfortunately, under GTK we won't get the original wxKeyEvent
// to reset m_metaDown
void frmMain::OnTreeKeyDown(wxTreeEvent &event)
{
int keyCode = event.GetKeyCode();
switch (keyCode)
{
case WXK_F1:
OnHelp(event);
break;
case WXK_F5:
Refresh(currentObject);
break;
case WXK_DELETE:
OnDelete(event);
break;
// Is tempting to write all cases(this handler) in tree control itself
case WXK_LEFT:
case WXK_RIGHT:
browser->NavigateTree(keyCode);
break;
default:
event.Skip();
break;
}
}
示例9: TreeOnKeyDownItem
void DecisionLogicFrame::TreeOnKeyDownItem(wxTreeEvent& event)
{
if (event.GetKeyCode() == 127) //delete
m_worker->DeleteTable(m_tree->GetItemText(event.GetItem()).wc_str());
}
示例10: OnTreeKeyDown
void BundlePane::OnTreeKeyDown(wxTreeEvent& event) {
const int key = event.GetKeyCode();
if (key == WXK_DELETE || key == WXK_BACK) {
DeleteItem();
}
}
示例11: bmx_wxtreeevent_getkeycode
int bmx_wxtreeevent_getkeycode(wxTreeEvent & event) {
return event.GetKeyCode();
}
示例12: OnKeyDown
void WatchWindow::OnKeyDown(wxTreeEvent& event)
{
if (event.GetKeyCode() == WXK_DELETE ||
event.GetKeyCode() == WXK_BACK)
{
wxTreeItemId item = GetSelection();
if (item.IsOk() && GetItemParent(item) == m_root)
{
wxTreeItemId next = GetNextSibling(item);
Delete(item);
CreateEmptySlotIfNeeded();
// Select the next item.
if (!next.IsOk())
{
wxTreeItemIdValue cookie;
next = GetLastChild(GetRootItem(), cookie);
}
SelectItem(next);
}
}
else
{
// If we're not currently editing a field, begin editing. This
// eliminates the need to double click to begin editing.
int code = event.GetKeyCode();
if (!m_editing && code < 256 && (isgraph(code) || IsSpace(code)))
{
// Get the currently selected item in the list.
wxTreeItemId item = GetSelection();
if (item.IsOk())
{
if (IsSpace(code))
{
EditLabel(item, "");
}
else
{
EditLabel(item, wxString(static_cast<char>(code)));
}
event.Skip(false);
}
}
else
{
event.Skip(true);
}
}
}