X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11d1f1599cea954c43049818f3620e810e6ac11e..da98e15760bfcad41a5579e64955caadc2e535f3:/samples/notebook/notebook.cpp diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 8f4127ef39..ad083b352e 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -24,6 +24,10 @@ #include "wx/artprov.h" #include "notebook.h" +#if !defined(__WXMSW__) && !defined(__WXPM__) + #include "../sample.xpm" +#endif + IMPLEMENT_APP(MyApp) bool MyApp::OnInit() @@ -188,13 +192,23 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame((wxWindow *) NULL, wxID_ANY, title, pos, size, style) { +#if wxUSE_NOTEBOOK m_type = ID_BOOK_NOTEBOOK; +#elif wxUSE_CHOICEBOOK + m_type = ID_BOOK_CHOICEBOOK; +#elif wxUSE_LISTBOOK + m_type = ID_BOOK_LISTBOOK; +#elif + #error "Don't use Notebook sample without any book enabled in wxWidgets build!" +#endif + m_orient = ID_ORIENT_DEFAULT; m_chkShowImages = true; m_multi = false; - // menu of the sample + SetIcon(wxICON(sample)); + // menu of the sample wxMenu *menuType = new wxMenu; #if wxUSE_NOTEBOOK menuType->AppendRadioItem(ID_BOOK_NOTEBOOK, wxT("&Notebook\tCtrl-1")); @@ -205,6 +219,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, #if wxUSE_CHOICEBOOK menuType->AppendRadioItem(ID_BOOK_CHOICEBOOK, wxT("&Choicebook\tCtrl-3")); #endif + menuType->Check(m_type, true); wxMenu *menuOrient = new wxMenu; menuOrient->AppendRadioItem(ID_ORIENT_DEFAULT, wxT("&Default\tCtrl-4")); @@ -325,6 +340,12 @@ int MyFrame::SelectFlag(int id, int nb, int lb, int chb) return 0; } +#ifdef __SMARTPHONE__ + #define MARGIN 0 +#else + #define MARGIN 4 +#endif + #define RECREATE( wxBookType , idBook, oldBook , newBook ) \ { \ int flags; \ @@ -393,7 +414,7 @@ int MyFrame::SelectFlag(int id, int nb, int lb, int chb) CreateInitialPages(newBook); \ } \ \ - m_sizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, 4); \ + m_sizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, MARGIN); \ \ m_sizerFrame->Hide(newBook); \ }