return true;
}
-wxPanel *CreateUserCreatedPage(wxBookCtrl *parent)
+wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent)
{
wxPanel *panel = new wxPanel(parent);
return panel;
}
-wxPanel *CreateRadioButtonsPage(wxBookCtrl *parent)
+wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent)
{
wxPanel *panel = new wxPanel(parent);
return panel;
}
-wxPanel *CreateVetoPage(wxBookCtrl *parent)
+wxPanel *CreateVetoPage(wxBookCtrlBase *parent)
{
wxPanel *panel = new wxPanel(parent);
return panel;
}
-wxPanel *CreateBigButtonPage(wxBookCtrl *parent)
+wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent)
{
wxPanel *panel = new wxPanel(parent);
}
-wxPanel *CreateInsertPage(wxBookCtrl *parent)
+wxPanel *CreateInsertPage(wxBookCtrlBase *parent)
{
wxPanel *panel = new wxPanel(parent);
return panel;
}
-int GetIconIndex(wxBookCtrl* bookCtrl)
+int GetIconIndex(wxBookCtrlBase* bookCtrl)
{
if (bookCtrl && bookCtrl->GetImageList())
{
return -1;
}
-void CreateInitialPages(wxBookCtrl *parent)
+void CreateInitialPages(wxBookCtrlBase *parent)
{
// Create and add some panels to the notebook
parent->SetSelection(1);
}
-wxPanel *CreatePage(wxBookCtrl *parent, const wxString&pageName)
+wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName)
{
if
(
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;
#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"));
return 0;
}
+#ifdef __SMARTPHONE__
+ #define MARGIN 0
+#else
+ #define MARGIN 4
+#endif
+
#define RECREATE( wxBookType , idBook, oldBook , newBook ) \
{ \
int flags; \
CreateInitialPages(newBook); \
} \
\
- m_sizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, 4); \
+ m_sizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, MARGIN); \
\
m_sizerFrame->Hide(newBook); \
}
ShowCurrentBook();
}
-wxBookCtrl *MyFrame::GetCurrentBook()
+wxBookCtrlBase *MyFrame::GetCurrentBook()
{
switch (m_type)
{
void MyFrame::OnType(wxCommandEvent& event)
{
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
m_type = event.GetId();
{
static unsigned s_pageAdded = 0;
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook )
{
{
static unsigned s_pageIns = 0;
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook )
{
void MyFrame::OnDeleteCurPage(wxCommandEvent& WXUNUSED(event))
{
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook )
{
void MyFrame::OnDeleteLastPage(wxCommandEvent& WXUNUSED(event))
{
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook )
{
void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event))
{
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook )
{
{
static int s_nPages = wxNOT_FOUND;
static int s_nSel = wxNOT_FOUND;
- static wxBookCtrl *s_currBook = NULL;
+ static wxBookCtrlBase *s_currBook = NULL;
- wxBookCtrl *currBook = GetCurrentBook();
+ wxBookCtrlBase *currBook = GetCurrentBook();
int nPages = currBook ? currBook->GetPageCount() : 0;
int nSel = currBook ? currBook->GetSelection() : wxNOT_FOUND;
}
}
+#if USE_LOG
+ #define BOOKEVENT_LOG m_text->SetInsertionPointEnd();
+#else
+ #define BOOKEVENT_LOG
+#endif
+
#define BOOKEVENT(OnBook,wxBookEvent,bookStr,wxEVT_PAGE_CHANGED,wxEVT_PAGE_CHANGING,s_num) \
void MyFrame::OnBook(wxBookEvent& event) \
{ \
else if (eventType == wxEVT_PAGE_CHANGING) \
{ \
int idx = event.GetOldSelection(); \
- wxBookCtrl *book = (wxBookCtrl *)event.GetEventObject(); \
+ wxBookCtrlBase *book = (wxBookCtrlBase *)event.GetEventObject(); \
if ( idx != wxNOT_FOUND && book && book->GetPageText(idx) == VETO_PAGE_NAME ) \
{ \
if \
\
wxLogMessage(logMsg.c_str()); \
\
- m_text->SetInsertionPointEnd(); \
+ BOOKEVENT_LOG \
}
#if wxUSE_NOTEBOOK