add a menu item to test setting focus (see #626 comment:42)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7235c54d3b
commit
5cfb5f66af
@ -115,6 +115,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
MENU_LINK(SetImageSize)
|
||||
MENU_LINK(CollapseAndReset)
|
||||
MENU_LINK(EnsureVisible)
|
||||
MENU_LINK(SetFocus)
|
||||
MENU_LINK(AddItem)
|
||||
MENU_LINK(InsertItem)
|
||||
MENU_LINK(IncIndent)
|
||||
@ -265,6 +266,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
||||
tree_menu->Append(TreeTest_SortRev, wxT("Sort in reversed order"));
|
||||
tree_menu->AppendSeparator();
|
||||
tree_menu->Append(TreeTest_EnsureVisible, wxT("Make the last item &visible"));
|
||||
tree_menu->Append(TreeTest_SetFocus, wxT("Set &focus to the tree"));
|
||||
tree_menu->AppendSeparator();
|
||||
tree_menu->Append(TreeTest_IncIndent, wxT("Add 5 points to indentation\tAlt-I"));
|
||||
tree_menu->Append(TreeTest_DecIndent, wxT("Reduce indentation by 5 points\tAlt-R"));
|
||||
@ -713,6 +715,11 @@ void MyFrame::OnEnsureVisible(wxCommandEvent& WXUNUSED(event))
|
||||
m_treeCtrl->DoEnsureVisible();
|
||||
}
|
||||
|
||||
void MyFrame::OnSetFocus(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_treeCtrl->SetFocus();
|
||||
}
|
||||
|
||||
void MyFrame::OnInsertItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
int image = wxGetApp().ShowImages() ? MyTreeCtrl::TreeCtrlIcon_File : -1;
|
||||
|
@ -228,6 +228,7 @@ public:
|
||||
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(false); }
|
||||
|
||||
void OnEnsureVisible(wxCommandEvent& event);
|
||||
void OnSetFocus(wxCommandEvent& event);
|
||||
|
||||
void OnCount(wxCommandEvent& event);
|
||||
void OnCountRec(wxCommandEvent& event);
|
||||
@ -339,6 +340,7 @@ enum
|
||||
TreeTest_ToggleSel,
|
||||
TreeTest_CollapseAndReset,
|
||||
TreeTest_EnsureVisible,
|
||||
TreeTest_SetFocus,
|
||||
TreeTest_AddItem,
|
||||
TreeTest_InsertItem,
|
||||
TreeTest_IncIndent,
|
||||
|
Loading…
Reference in New Issue
Block a user