m_okButton = new wxButton(window, wxID_OK, "Close", wxPoint(-1, -1), wxSize(80, 25));
m_cancelButton = new wxButton(window, ID_DELETE_PAGE, "Delete page", wxPoint(-1, -1), wxSize(80, 25));
m_addPageButton = new wxButton(window, ID_ADD_PAGE, "Add page", wxPoint(-1, -1), wxSize(80, 25));
+ m_nextPageButton = new wxButton(window, ID_NEXT_PAGE, "Next page", wxPoint(-1, -1), wxSize(80, 25));
m_okButton->SetDefault();
wxLayoutConstraints* c = new wxLayoutConstraints;
+ c->right.SameAs(m_addPageButton, wxLeft, 4);
+ c->bottom.SameAs(window, wxBottom, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ m_nextPageButton->SetConstraints(c);
+
+ c = new wxLayoutConstraints;
c->right.SameAs(window, wxRight, 4);
c->bottom.SameAs(window, wxBottom, 4);
c->height.AsIs();
EVT_BUTTON(wxID_OK, MyFrame::OnOK)
EVT_BUTTON(ID_DELETE_PAGE, MyFrame::OnDeletePage)
EVT_BUTTON(ID_ADD_PAGE, MyFrame::OnAddPage)
+ EVT_BUTTON(ID_NEXT_PAGE, MyFrame::OnNextPage)
EVT_IDLE(MyFrame::OnIdle)
END_EVENT_TABLE()
m_notebook->DeletePage( m_notebook->GetPageCount()-1 );
}
+void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event))
+{
+ m_notebook->AdvanceSelection();
+}
+
void MyFrame::OnOK(wxCommandEvent& WXUNUSED(event) )
{
Destroy();
wxButton* m_okButton;
wxButton* m_cancelButton;
wxButton* m_addPageButton;
+ wxButton* m_nextPageButton;
};
DECLARE_APP(MyApp)
void OnOK(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
void OnAddPage(wxCommandEvent& event);
+ void OnNextPage(wxCommandEvent& event);
void OnDeletePage(wxCommandEvent& event);
void OnIdle(wxIdleEvent& event);
#define ID_NOTEBOOK 1000
#define ID_ADD_PAGE 1200
#define ID_DELETE_PAGE 1201
+#define ID_NEXT_PAGE 1202
}
case WXK_SPACE:
{
- m_current->ReverseHilight();
- RefreshLine( m_current );
+ if (m_mode & wxLC_SINGLE_SEL)
+ {
+ wxListEvent le( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, GetParent()->GetId() );
+ le.SetEventObject( GetParent() );
+ le.m_itemIndex = GetIndexOfLine( m_current );
+ m_current->GetItem( 0, le.m_item );
+ GetParent()->GetEventHandler()->ProcessEvent( le );
+ }
+ else
+ {
+ m_current->ReverseHilight();
+ RefreshLine( m_current );
+ }
break;
}
case WXK_INSERT: