wxBookCtrl->wxBookCtrlBase. wxBookCtrl is now most suitable book for given platform. Samples adjustement.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-11-23 11:45:07 +00:00
parent 13e175eafc
commit 61c083e781
27 changed files with 240 additions and 210 deletions

View File

@@ -101,8 +101,8 @@ wxURL has undergone some radical changes.
* Many accessors of wxURL - GetHostName, GetProtocolName, and GetPath, * Many accessors of wxURL - GetHostName, GetProtocolName, and GetPath,
have been replaced by its parent's (wxURI) counterparts - GetServer, have been replaced by its parent's (wxURI) counterparts - GetServer,
GetScheme, and GetPath, respectively. GetScheme, and GetPath, respectively.
* ConvertToValidURI has been replaced by wxURI. Do not use * ConvertToValidURI has been replaced by wxURI. Do not use
ConvertToValidURI for future applications. ConvertToValidURI for future applications.
* ConvertFromURI has been replaced by wxURI::Unescape. * ConvertFromURI has been replaced by wxURI::Unescape.
@@ -190,7 +190,7 @@ wxURL has undergone some radical changes.
\subsection{Depreciated changes since 2.4.x} \subsection{Depreciated changes since 2.4.x}
- wxURL::GetInputStream() and similar functionality has been depreciated in - wxURL::GetInputStream() and similar functionality has been depreciated in
favor of other ways of connecting, such as though sockets or wxFileSystem. favor of other ways of connecting, such as though sockets or wxFileSystem.
- wxDocManager::GetNoHistoryFiles() renamed to GetHistoryFilesCount() - wxDocManager::GetNoHistoryFiles() renamed to GetHistoryFilesCount()

View File

@@ -344,7 +344,7 @@ The sample also provides some timings for adding/deleting/sorting a lot of
\subsection{Mediaplayer sample}\label{samplemediaplayer} \subsection{Mediaplayer sample}\label{samplemediaplayer}
This sample demonstrates how to use all the features of This sample demonstrates how to use all the features of
\helpref{wxMediaCtrl}{wxmediactrl} and play various types of sound, video, \helpref{wxMediaCtrl}{wxmediactrl} and play various types of sound, video,
and other files. and other files.
@@ -352,7 +352,7 @@ It replaces the old dynamic sample.
\subsection{Notebook sample}\label{samplenotebook} \subsection{Notebook sample}\label{samplenotebook}
This samples shows family of controls which derive from wxBookCtrl base class. This samples shows family of controls which derive from wxBookCtrlBase base class.
Although initially it was written to demonstrate \helpref{wxNotebook}{wxnotebook} Although initially it was written to demonstrate \helpref{wxNotebook}{wxnotebook}
only, it can now be also used to see \helpref{wxListbook}{wxlistbook} and only, it can now be also used to see \helpref{wxListbook}{wxlistbook} and
\helpref{wxChoicebook}{wxchoicebook} in action. Test each of the controls, their \helpref{wxChoicebook}{wxchoicebook} in action. Test each of the controls, their

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: wx/bookctrl.h // Name: wx/bookctrl.h
// Purpose: wxBookCtrl: common base class for wxList/Tree/Notebook // Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
// Created: 19.08.03 // Created: 19.08.03
@@ -32,26 +32,26 @@ WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
class WXDLLEXPORT wxImageList; class WXDLLEXPORT wxImageList;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxBookCtrl // wxBookCtrlBase
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxBookCtrl : public wxControl class WXDLLEXPORT wxBookCtrlBase : public wxControl
{ {
public: public:
// construction // construction
// ------------ // ------------
wxBookCtrl() wxBookCtrlBase()
{ {
Init(); Init();
} }
wxBookCtrl(wxWindow *parent, wxBookCtrlBase(wxWindow *parent,
wxWindowID winid, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, long style = 0,
const wxString& name = wxEmptyString) const wxString& name = wxEmptyString)
{ {
Init(); Init();
@@ -67,7 +67,7 @@ public:
const wxString& name = wxEmptyString); const wxString& name = wxEmptyString);
// dtor // dtor
virtual ~wxBookCtrl(); virtual ~wxBookCtrlBase();
// accessors // accessors
@@ -84,7 +84,7 @@ public:
{ {
int n = GetSelection(); int n = GetSelection();
return n == wxNOT_FOUND ? NULL return n == wxNOT_FOUND ? NULL
: wx_const_cast(wxBookCtrl *, this)->GetPage(n); : wx_const_cast(wxBookCtrlBase *, this)->GetPage(n);
} }
// get the currently selected page or wxNOT_FOUND if none // get the currently selected page or wxNOT_FOUND if none
@@ -208,18 +208,18 @@ protected:
bool m_ownsImageList; bool m_ownsImageList;
DECLARE_NO_COPY_CLASS(wxBookCtrl) DECLARE_NO_COPY_CLASS(wxBookCtrlBase)
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxBookCtrlEvent: page changing events generated by derived classes // wxBookCtrlBaseEvent: page changing events generated by derived classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxBookCtrlEvent : public wxNotifyEvent class WXDLLEXPORT wxBookCtrlBaseEvent : public wxNotifyEvent
{ {
public: public:
wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, wxBookCtrlBaseEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
int nSel = -1, int nOldSel = -1) int nSel = -1, int nOldSel = -1)
: wxNotifyEvent(commandType, winid) : wxNotifyEvent(commandType, winid)
{ {
m_nSel = nSel; m_nSel = nSel;
@@ -239,6 +239,35 @@ private:
m_nOldSel; // previously selected page m_nOldSel; // previously selected page
}; };
// make a default book control for given platform
#if defined(__WXMSW__) && defined(__SMARTPHONE__)
#include "wx\choicebook.h"
#define wxBookCtrl wxChoicebook
#define wxBookCtrlEvent wxChoicebookEvent
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn)
#define wxBC_TOP wxNB_TOP
#define wxBC_BOTTOM wxNB_BOTTOM
#define wxBC_LEFT wxNB_LEFT
#define wxBC_RIGHT wxNB_RIGHT
#define wxBC_DEFAULT wxNB_DEFAULT
#else
#include "wx\notebook.h"
#define wxBookCtrl wxNotebook
#define wxBookCtrlEvent wxNotebookEvent
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn)
#define wxBC_TOP wxCHB_TOP
#define wxBC_BOTTOM wxCHB_BOTTOM
#define wxBC_LEFT wxCHB_LEFT
#define wxBC_RIGHT wxCHB_RIGHT
#define wxBC_DEFAULT wxCHB_DEFAULT
#endif
#endif // wxUSE_BOOKCTRL #endif // wxUSE_BOOKCTRL
#endif // _WX_BOOKCTRL_H_ #endif // _WX_BOOKCTRL_H_

View File

@@ -28,7 +28,7 @@ class WXDLLEXPORT wxChoice;
// wxChoicebook // wxChoicebook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoicebook : public wxBookCtrl class WXDLLEXPORT wxChoicebook : public wxBookCtrlBase
{ {
public: public:
wxChoicebook() wxChoicebook()
@@ -107,12 +107,12 @@ private:
// choicebook event class and related stuff // choicebook event class and related stuff
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoicebookEvent : public wxBookCtrlEvent class WXDLLEXPORT wxChoicebookEvent : public wxBookCtrlBaseEvent
{ {
public: public:
wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = -1, int nOldSel = -1) int nSel = -1, int nOldSel = -1)
: wxBookCtrlEvent(commandType, id, nSel, nOldSel) : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
{ {
} }

View File

@@ -43,7 +43,7 @@ class WXDLLEXPORT wxStaticLine;
// wxListbook // wxListbook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxListbook : public wxBookCtrl class WXDLLEXPORT wxListbook : public wxBookCtrlBase
{ {
public: public:
wxListbook() wxListbook()
@@ -129,12 +129,12 @@ private:
// listbook event class and related stuff // listbook event class and related stuff
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxListbookEvent : public wxBookCtrlEvent class WXDLLEXPORT wxListbookEvent : public wxBookCtrlBaseEvent
{ {
public: public:
wxListbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, wxListbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND) int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
: wxBookCtrlEvent(commandType, id, nSel, nOldSel) : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
{ {
} }

View File

@@ -47,7 +47,7 @@ typedef wxWindow wxNotebookPage; // so far, any window can be a page
// wxNotebookBase: define wxNotebook interface // wxNotebookBase: define wxNotebook interface
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxNotebookBase : public wxBookCtrl class WXDLLEXPORT wxNotebookBase : public wxBookCtrlBase
{ {
public: public:
// ctors // ctors
@@ -62,8 +62,8 @@ public:
long style = 0, long style = 0,
const wxString& name = wxNOTEBOOK_NAME) ; const wxString& name = wxNOTEBOOK_NAME) ;
// wxNotebook-specific additions to wxBookCtrl interface // wxNotebook-specific additions to wxBookCtrlBase interface
// ----------------------------------------------------- // ---------------------------------------------------------
// get the number of rows for a control with wxNB_MULTILINE style (not all // get the number of rows for a control with wxNB_MULTILINE style (not all
// versions support it - they will always return 1 then) // versions support it - they will always return 1 then)
@@ -95,12 +95,12 @@ protected:
// notebook event class and related stuff // notebook event class and related stuff
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxNotebookEvent : public wxBookCtrlEvent class WXDLLEXPORT wxNotebookEvent : public wxBookCtrlBaseEvent
{ {
public: public:
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
int nSel = -1, int nOldSel = -1) int nSel = -1, int nOldSel = -1)
: wxBookCtrlEvent(commandType, winid, nSel, nOldSel) : wxBookCtrlBaseEvent(commandType, winid, nSel, nOldSel)
{ {
} }

View File

@@ -644,7 +644,7 @@ private:
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
// NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
// don't do anything. wxBookCtrl::DoGetBestSize does the job now. // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxBookCtrlSizer // wxBookCtrlSizer
@@ -654,14 +654,14 @@ private:
// this sizer works with wxNotebook/wxListbook/... and sizes the control to // this sizer works with wxNotebook/wxListbook/... and sizes the control to
// fit its pages // fit its pages
class WXDLLEXPORT wxBookCtrl; class WXDLLEXPORT wxBookCtrlBase;
class WXDLLEXPORT wxBookCtrlSizer : public wxSizer class WXDLLEXPORT wxBookCtrlSizer : public wxSizer
{ {
public: public:
wxDEPRECATED( wxBookCtrlSizer(wxBookCtrl *bookctrl) ); wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase *bookctrl) );
wxBookCtrl *GetControl() const { return m_bookctrl; } wxBookCtrlBase *GetControl() const { return m_bookctrl; }
virtual void RecalcSizes(); virtual void RecalcSizes();
virtual wxSize CalcMin(); virtual wxSize CalcMin();
@@ -671,7 +671,7 @@ protected:
// and still have warning-free build of the library itself: // and still have warning-free build of the library itself:
wxBookCtrlSizer() {} wxBookCtrlSizer() {}
wxBookCtrl *m_bookctrl; wxBookCtrlBase *m_bookctrl;
private: private:
DECLARE_CLASS(wxBookCtrlSizer) DECLARE_CLASS(wxBookCtrlSizer)
@@ -681,7 +681,7 @@ private:
#if wxUSE_NOTEBOOK #if wxUSE_NOTEBOOK
// before wxBookCtrl we only had wxNotebookSizer, keep it for backwards // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
// compatibility // compatibility
class WXDLLEXPORT wxNotebook; class WXDLLEXPORT wxNotebook;

View File

@@ -23,7 +23,7 @@
#include "wx/spinbutt.h" #include "wx/spinbutt.h"
#endif #endif
#include "wx/tglbtn.h" #include "wx/tglbtn.h"
#include "wx/notebook.h" #include "wx/bookctrl.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/artprov.h" #include "wx/artprov.h"
@@ -88,8 +88,8 @@ public:
void OnRadioButton1( wxCommandEvent &event ); void OnRadioButton1( wxCommandEvent &event );
void OnRadioButton2( wxCommandEvent &event ); void OnRadioButton2( wxCommandEvent &event );
void OnSetFont( wxCommandEvent &event ); void OnSetFont( wxCommandEvent &event );
void OnPageChanged( wxNotebookEvent &event ); void OnPageChanged( wxBookCtrlEvent &event );
void OnPageChanging( wxNotebookEvent &event ); void OnPageChanging( wxBookCtrlEvent &event );
void OnSliderUpdate( wxCommandEvent &event ); void OnSliderUpdate( wxCommandEvent &event );
void OnUpdateLabel( wxCommandEvent &event ); void OnUpdateLabel( wxCommandEvent &event );
#if wxUSE_SPINBTN #if wxUSE_SPINBTN
@@ -142,7 +142,7 @@ public:
wxCheckBox *m_checkbox; wxCheckBox *m_checkbox;
wxTextCtrl *m_text; wxTextCtrl *m_text;
wxNotebook *m_notebook; wxBookCtrl *m_book;
wxStaticText *m_label; wxStaticText *m_label;
@@ -355,7 +355,7 @@ bool MyApp::OnInit()
// MyPanel // MyPanel
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const int ID_NOTEBOOK = 1000; const int ID_BOOK = 1000;
const int ID_LISTBOX = 130; const int ID_LISTBOX = 130;
const int ID_LISTBOX_SEL_NUM = 131; const int ID_LISTBOX_SEL_NUM = 131;
@@ -420,8 +420,8 @@ const int ID_SIZER_CHECKBIG = 206;
BEGIN_EVENT_TABLE(MyPanel, wxPanel) BEGIN_EVENT_TABLE(MyPanel, wxPanel)
EVT_SIZE ( MyPanel::OnSize) EVT_SIZE ( MyPanel::OnSize)
EVT_NOTEBOOK_PAGE_CHANGING(ID_NOTEBOOK, MyPanel::OnPageChanging) EVT_BOOKCTRL_PAGE_CHANGING(ID_BOOK, MyPanel::OnPageChanging)
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged) EVT_BOOKCTRL_PAGE_CHANGED(ID_BOOK, MyPanel::OnPageChanged)
EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox) EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox)
EVT_LISTBOX (ID_LISTBOX_SORTED, MyPanel::OnListBox) EVT_LISTBOX (ID_LISTBOX_SORTED, MyPanel::OnListBox)
EVT_LISTBOX_DCLICK(ID_LISTBOX, MyPanel::OnListBoxDoubleClick) EVT_LISTBOX_DCLICK(ID_LISTBOX, MyPanel::OnListBoxDoubleClick)
@@ -542,7 +542,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_spintext = NULL; m_spintext = NULL;
m_checkbox = NULL; m_checkbox = NULL;
m_text = NULL; m_text = NULL;
m_notebook = NULL; m_book = NULL;
m_label = NULL; m_label = NULL;
m_text = new wxTextCtrl(this, wxID_ANY, _T("This is the log window.\n"), m_text = new wxTextCtrl(this, wxID_ANY, _T("This is the log window.\n"),
@@ -551,7 +551,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text)); m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text));
m_notebook = new wxNotebook(this, ID_NOTEBOOK); m_book = new wxBookCtrl(this, ID_BOOK);
wxString choices[] = wxString choices[] =
{ {
@@ -580,7 +580,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
imagelist-> Add( wxBitmap( text_xpm )); imagelist-> Add( wxBitmap( text_xpm ));
imagelist-> Add( wxBitmap( radio_xpm )); imagelist-> Add( wxBitmap( radio_xpm ));
imagelist-> Add( wxBitmap( gauge_xpm )); imagelist-> Add( wxBitmap( gauge_xpm ));
m_notebook->SetImageList(imagelist); m_book->SetImageList(imagelist);
#elif defined(__WXMSW__) #elif defined(__WXMSW__)
// load images from resources // load images from resources
enum enum
@@ -600,12 +600,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
wxBitmap bmp(s_iconNames[n]); wxBitmap bmp(s_iconNames[n]);
if ( !bmp.Ok() || (imagelist->Add(bmp) == -1) ) if ( !bmp.Ok() || (imagelist->Add(bmp) == -1) )
{ {
wxLogWarning(wxT("Couldn't load the image '%s' for the notebook page %d."), wxLogWarning(wxT("Couldn't load the image '%s' for the book control page %d."),
s_iconNames[n], n); s_iconNames[n], n);
} }
} }
m_notebook->SetImageList(imagelist); m_book->SetImageList(imagelist);
#else #else
// No images for now // No images for now
@@ -619,7 +619,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
#endif #endif
wxPanel *panel = new wxPanel(m_notebook); wxPanel *panel = new wxPanel(m_book);
m_listbox = new wxListBox( panel, ID_LISTBOX, m_listbox = new wxListBox( panel, ID_LISTBOX,
wxPoint(10,10), wxSize(120,70), wxPoint(10,10), wxSize(120,70),
5, choices, wxLB_ALWAYS_SB ); 5, choices, wxLB_ALWAYS_SB );
@@ -658,10 +658,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
(void)new wxCheckBox( panel, ID_CHANGE_COLOUR, _T("&Toggle colour"), (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, _T("&Toggle colour"),
wxPoint(110,170) ); wxPoint(110,170) );
panel->SetCursor(wxCursor(wxCURSOR_HAND)); panel->SetCursor(wxCursor(wxCURSOR_HAND));
m_notebook->AddPage(panel, _T("wxListBox"), true, Image_List); m_book->AddPage(panel, _T("wxListBox"), true, Image_List);
#if wxUSE_CHOICE #if wxUSE_CHOICE
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultCoord), 5, choices ); m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultCoord), 5, choices );
m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultCoord), m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultCoord),
5, choices, wxCB_SORT ); 5, choices, wxCB_SORT );
@@ -679,10 +679,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
(void)new wxButton( panel, ID_CHOICE_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); (void)new wxButton( panel, ID_CHOICE_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
(void)new wxCheckBox( panel, ID_CHOICE_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) ); (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) );
m_notebook->AddPage(panel, _T("wxChoice"), false, Image_Choice); m_book->AddPage(panel, _T("wxChoice"), false, Image_Choice);
#endif // wxUSE_CHOICE #endif // wxUSE_CHOICE
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
(void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"), (void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"),
wxPoint(5, 5), wxSize(150, 100)); wxPoint(5, 5), wxSize(150, 100));
m_combo = new MyComboBox( panel, ID_COMBO, _T("This"), m_combo = new MyComboBox( panel, ID_COMBO, _T("This"),
@@ -698,7 +698,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
(void)new wxButton( panel, ID_COMBO_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
(void)new wxCheckBox( panel, ID_COMBO_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) ); (void)new wxCheckBox( panel, ID_COMBO_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) );
m_notebook->AddPage(panel, _T("wxComboBox"), false, Image_Combo); m_book->AddPage(panel, _T("wxComboBox"), false, Image_Combo);
wxString choices2[] = wxString choices2[] =
{ {
@@ -708,7 +708,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
"Seventh", "Eighth", "Nineth", "Tenth" */ "Seventh", "Eighth", "Nineth", "Tenth" */
}; };
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
(void)new MyRadioBox( panel, ID_RADIOBOX, _T("&That"), wxPoint(10,160), wxDefaultSize, WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS ); (void)new MyRadioBox( panel, ID_RADIOBOX, _T("&That"), wxPoint(10,160), wxDefaultSize, WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS );
m_radio = new wxRadioBox( panel, ID_RADIOBOX, _T("T&his"), wxPoint(10,10), wxDefaultSize, WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS ); m_radio = new wxRadioBox( panel, ID_RADIOBOX, _T("T&his"), wxPoint(10,10), wxDefaultSize, WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS );
m_radio->SetForegroundColour(*wxRED); m_radio->SetForegroundColour(*wxRED);
@@ -726,9 +726,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, _T("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP ); wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, _T("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP );
rb->SetValue( false ); rb->SetValue( false );
(void)new wxRadioButton( panel, ID_RADIOBUTTON_2, _T("&Radiobutton2"), wxPoint(340,170), wxDefaultSize ); (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, _T("&Radiobutton2"), wxPoint(340,170), wxDefaultSize );
m_notebook->AddPage(panel, _T("wxRadioBox"), false, Image_Radio); m_book->AddPage(panel, _T("wxRadioBox"), false, Image_Radio);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
(void)new wxStaticBox( panel, wxID_ANY, _T("&wxGauge and wxSlider"), wxPoint(10,10), wxSize(222,130) ); (void)new wxStaticBox( panel, wxID_ANY, _T("&wxGauge and wxSlider"), wxPoint(10,10), wxSize(222,130) );
m_gauge = new wxGauge( panel, wxID_ANY, 200, wxPoint(18,50), wxSize(155, 30), wxGA_HORIZONTAL|wxNO_BORDER ); m_gauge = new wxGauge( panel, wxID_ANY, 200, wxPoint(18,50), wxSize(155, 30), wxGA_HORIZONTAL|wxNO_BORDER );
m_gauge->SetBackgroundColour(*wxGREEN); m_gauge->SetBackgroundColour(*wxGREEN);
@@ -785,9 +785,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_spinctrl->SetValue(15); m_spinctrl->SetValue(15);
#endif // wxUSE_SPINCTRL #endif // wxUSE_SPINCTRL
m_notebook->AddPage(panel, _T("wxGauge"), false, Image_Gauge); m_book->AddPage(panel, _T("wxGauge"), false, Image_Gauge);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
#if !defined(__WXMOTIF__) // wxStaticBitmap not working under Motif yet. #if !defined(__WXMOTIF__) // wxStaticBitmap not working under Motif yet.
wxIcon icon = wxArtProvider::GetIcon(wxART_INFORMATION); wxIcon icon = wxArtProvider::GetIcon(wxART_INFORMATION);
@@ -846,18 +846,18 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/); wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/);
m_label->SetForegroundColour( *wxBLUE ); m_label->SetForegroundColour( *wxBLUE );
m_notebook->AddPage(panel, _T("wxBitmapXXX")); m_book->AddPage(panel, _T("wxBitmapXXX"));
// sizer // sizer
panel = new wxPanel(m_notebook); panel = new wxPanel(m_book);
panel->SetAutoLayout( true ); panel->SetAutoLayout( true );
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer *csizer = wxStaticBoxSizer *csizer =
new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")), wxHORIZONTAL ); new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")), wxHORIZONTAL );
wxCheckBox *check1, *check2, *check3, *check4, *check14, *checkBig; wxCheckBox *check1, *check2, *check3, *check4, *check14, *checkBig;
check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, _T("1")); check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, _T("1"));
check1->SetValue (true); check1->SetValue (true);
@@ -877,13 +877,13 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, _T("Big")); checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, _T("Big"));
checkBig->SetValue (true); checkBig->SetValue (true);
csizer->Add (checkBig); csizer->Add (checkBig);
sizer->Add (csizer); sizer->Add (csizer);
m_hsizer = new wxBoxSizer( wxHORIZONTAL ); m_hsizer = new wxBoxSizer( wxHORIZONTAL );
m_buttonSizer = new wxBoxSizer (wxVERTICAL); m_buttonSizer = new wxBoxSizer (wxVERTICAL);
m_sizerBtn1 = new wxButton(panel, wxID_ANY, _T("Test Button &1 (tab order 1)") ); m_sizerBtn1 = new wxButton(panel, wxID_ANY, _T("Test Button &1 (tab order 1)") );
m_buttonSizer->Add( m_sizerBtn1, 0, wxALL, 10 ); m_buttonSizer->Add( m_sizerBtn1, 0, wxALL, 10 );
m_sizerBtn2 = new wxButton(panel, wxID_ANY, _T("Test Button &2 (tab order 3)") ); m_sizerBtn2 = new wxButton(panel, wxID_ANY, _T("Test Button &2 (tab order 3)") );
@@ -904,7 +904,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
panel->SetSizer( sizer ); panel->SetSizer( sizer );
m_notebook->AddPage(panel, _T("wxSizer")); m_book->AddPage(panel, _T("wxSizer"));
} }
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) ) void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
@@ -913,11 +913,11 @@ void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
int y = 0; int y = 0;
GetClientSize( &x, &y ); GetClientSize( &x, &y );
if (m_notebook) m_notebook->SetSize( 2, 2, x-4, y*2/3-4 ); if (m_book) m_book->SetSize( 2, 2, x-4, y*2/3-4 );
if (m_text) m_text->SetSize( 2, y*2/3+2, x-4, y/3-4 ); if (m_text) m_text->SetSize( 2, y*2/3+2, x-4, y/3-4 );
} }
void MyPanel::OnPageChanging( wxNotebookEvent &event ) void MyPanel::OnPageChanging( wxBookCtrlEvent &event )
{ {
int selOld = event.GetOldSelection(); int selOld = event.GetOldSelection();
if ( selOld == 2 ) if ( selOld == 2 )
@@ -934,16 +934,16 @@ void MyPanel::OnPageChanging( wxNotebookEvent &event )
} }
} }
*m_text << _T("Notebook selection is being changed from ") << selOld *m_text << _T("Book selection is being changed from ") << selOld
<< _T(" to ") << event.GetSelection() << _T(" to ") << event.GetSelection()
<< _T(" (current page from notebook is ") << _T(" (current page from book is ")
<< m_notebook->GetSelection() << _T(")\n"); << m_book->GetSelection() << _T(")\n");
} }
void MyPanel::OnPageChanged( wxNotebookEvent &event ) void MyPanel::OnPageChanged( wxBookCtrlEvent &event )
{ {
*m_text << _T("Notebook selection is now ") << event.GetSelection() *m_text << _T("Book selection is now ") << event.GetSelection()
<< _T(" (from notebook: ") << m_notebook->GetSelection() << _T(" (from book: ") << m_book->GetSelection()
<< _T(")\n"); << _T(")\n");
} }
@@ -1418,13 +1418,13 @@ void MyPanel::OnUpdateShowProgress( wxUpdateUIEvent& event )
void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) ) void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) )
{ {
int max = m_spinbutton->GetValue(); int max = m_spinbutton->GetValue();
if ( max <= 0 ) if ( max <= 0 )
{ {
wxLogError(_T("You must set positive range!")); wxLogError(_T("You must set positive range!"));
return; return;
} }
wxProgressDialog dialog(_T("Progress dialog example"), wxProgressDialog dialog(_T("Progress dialog example"),
_T("An informative message"), _T("An informative message"),
max, // range max, // range
@@ -1503,7 +1503,7 @@ MyPanel::~MyPanel()
//wxLog::RemoveTraceMask(_T("focus")); //wxLog::RemoveTraceMask(_T("focus"));
delete wxLog::SetActiveTarget(m_logTargetOld); delete wxLog::SetActiveTarget(m_logTargetOld);
delete m_notebook->GetImageList(); delete m_book->GetImageList();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@@ -44,7 +44,7 @@ bool MyApp::OnInit()
return true; return true;
} }
wxPanel *CreateUserCreatedPage(wxBookCtrl *parent) wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent)
{ {
wxPanel *panel = new wxPanel(parent); wxPanel *panel = new wxPanel(parent);
@@ -54,7 +54,7 @@ wxPanel *CreateUserCreatedPage(wxBookCtrl *parent)
return panel; return panel;
} }
wxPanel *CreateRadioButtonsPage(wxBookCtrl *parent) wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent)
{ {
wxPanel *panel = new wxPanel(parent); wxPanel *panel = new wxPanel(parent);
@@ -79,7 +79,7 @@ wxPanel *CreateRadioButtonsPage(wxBookCtrl *parent)
return panel; return panel;
} }
wxPanel *CreateVetoPage(wxBookCtrl *parent) wxPanel *CreateVetoPage(wxBookCtrlBase *parent)
{ {
wxPanel *panel = new wxPanel(parent); wxPanel *panel = new wxPanel(parent);
@@ -89,7 +89,7 @@ wxPanel *CreateVetoPage(wxBookCtrl *parent)
return panel; return panel;
} }
wxPanel *CreateBigButtonPage(wxBookCtrl *parent) wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent)
{ {
wxPanel *panel = new wxPanel(parent); wxPanel *panel = new wxPanel(parent);
@@ -103,7 +103,7 @@ wxPanel *CreateBigButtonPage(wxBookCtrl *parent)
} }
wxPanel *CreateInsertPage(wxBookCtrl *parent) wxPanel *CreateInsertPage(wxBookCtrlBase *parent)
{ {
wxPanel *panel = new wxPanel(parent); wxPanel *panel = new wxPanel(parent);
@@ -114,7 +114,7 @@ wxPanel *CreateInsertPage(wxBookCtrl *parent)
return panel; return panel;
} }
int GetIconIndex(wxBookCtrl* bookCtrl) int GetIconIndex(wxBookCtrlBase* bookCtrl)
{ {
if (bookCtrl && bookCtrl->GetImageList()) if (bookCtrl && bookCtrl->GetImageList())
{ {
@@ -128,7 +128,7 @@ int GetIconIndex(wxBookCtrl* bookCtrl)
return -1; return -1;
} }
void CreateInitialPages(wxBookCtrl *parent) void CreateInitialPages(wxBookCtrlBase *parent)
{ {
// Create and add some panels to the notebook // Create and add some panels to the notebook
@@ -147,7 +147,7 @@ void CreateInitialPages(wxBookCtrl *parent)
parent->SetSelection(1); parent->SetSelection(1);
} }
wxPanel *CreatePage(wxBookCtrl *parent, const wxString&pageName) wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName)
{ {
if if
( (
@@ -413,7 +413,7 @@ void MyFrame::RecreateBooks()
ShowCurrentBook(); ShowCurrentBook();
} }
wxBookCtrl *MyFrame::GetCurrentBook() wxBookCtrlBase *MyFrame::GetCurrentBook()
{ {
switch (m_type) switch (m_type)
{ {
@@ -483,7 +483,7 @@ END_EVENT_TABLE()
void MyFrame::OnType(wxCommandEvent& event) void MyFrame::OnType(wxCommandEvent& event)
{ {
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
m_type = event.GetId(); m_type = event.GetId();
@@ -524,7 +524,7 @@ void MyFrame::OnAddPage(wxCommandEvent& WXUNUSED(event))
{ {
static unsigned s_pageAdded = 0; static unsigned s_pageAdded = 0;
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook ) if ( currBook )
{ {
@@ -543,7 +543,7 @@ void MyFrame::OnInsertPage(wxCommandEvent& WXUNUSED(event))
{ {
static unsigned s_pageIns = 0; static unsigned s_pageIns = 0;
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook ) if ( currBook )
{ {
@@ -559,7 +559,7 @@ void MyFrame::OnInsertPage(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnDeleteCurPage(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDeleteCurPage(wxCommandEvent& WXUNUSED(event))
{ {
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook ) if ( currBook )
{ {
@@ -574,7 +574,7 @@ void MyFrame::OnDeleteCurPage(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnDeleteLastPage(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDeleteLastPage(wxCommandEvent& WXUNUSED(event))
{ {
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook ) if ( currBook )
{ {
@@ -589,7 +589,7 @@ void MyFrame::OnDeleteLastPage(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event))
{ {
wxBookCtrl *currBook = GetCurrentBook(); wxBookCtrlBase *currBook = GetCurrentBook();
if ( currBook ) if ( currBook )
{ {
@@ -601,9 +601,9 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
{ {
static int s_nPages = wxNOT_FOUND; static int s_nPages = wxNOT_FOUND;
static int s_nSel = 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 nPages = currBook ? currBook->GetPageCount() : 0;
int nSel = currBook ? currBook->GetSelection() : wxNOT_FOUND; int nSel = currBook ? currBook->GetSelection() : wxNOT_FOUND;
@@ -643,7 +643,7 @@ void MyFrame::OnBook(wxBookEvent& event)
else if (eventType == wxEVT_PAGE_CHANGING) \ else if (eventType == wxEVT_PAGE_CHANGING) \
{ \ { \
int idx = event.GetOldSelection(); \ 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 ( idx != wxNOT_FOUND && book && book->GetPageText(idx) == VETO_PAGE_NAME ) \
{ \ { \
if \ if \

View File

@@ -60,7 +60,7 @@ public:
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
wxBookCtrl *GetCurrentBook(); wxBookCtrlBase *GetCurrentBook();
private: private:
wxLog *m_logTargetOld; wxLog *m_logTargetOld;

View File

@@ -77,7 +77,7 @@ enum
class ButtonWidgetsPage : public WidgetsPage class ButtonWidgetsPage : public WidgetsPage
{ {
public: public:
ButtonWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); ButtonWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~ButtonWidgetsPage(){}; virtual ~ButtonWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_button; } virtual wxControl *GetWidget() const { return m_button; }
@@ -139,9 +139,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button")); IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"));
ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook, ButtonWidgetsPage::ButtonWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(button_xpm)); imaglist->Add(wxBitmap(button_xpm));

View File

@@ -73,7 +73,7 @@ enum
class CheckBoxWidgetsPage : public WidgetsPage class CheckBoxWidgetsPage : public WidgetsPage
{ {
public: public:
CheckBoxWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); CheckBoxWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~CheckBoxWidgetsPage(){}; virtual ~CheckBoxWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_checkbox; } virtual wxControl *GetWidget() const { return m_checkbox; }
@@ -149,9 +149,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox")); IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"));
CheckBoxWidgetsPage::CheckBoxWidgetsPage(wxNotebook *notebook, CheckBoxWidgetsPage::CheckBoxWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(checkbox_xpm)); imaglist->Add(wxBitmap(checkbox_xpm));

View File

@@ -84,7 +84,7 @@ enum
class ComboboxWidgetsPage : public WidgetsPage class ComboboxWidgetsPage : public WidgetsPage
{ {
public: public:
ComboboxWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); ComboboxWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const { return m_combobox; } virtual wxControl *GetWidget() const { return m_combobox; }
@@ -190,9 +190,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox")); IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"));
ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook, ComboboxWidgetsPage::ComboboxWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
// init everything // init everything
m_chkSort = m_chkSort =

View File

@@ -71,7 +71,7 @@ enum
class GaugeWidgetsPage : public WidgetsPage class GaugeWidgetsPage : public WidgetsPage
{ {
public: public:
GaugeWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); GaugeWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~GaugeWidgetsPage(); virtual ~GaugeWidgetsPage();
virtual wxControl *GetWidget() const { return m_gauge; } virtual wxControl *GetWidget() const { return m_gauge; }
@@ -158,9 +158,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge")); IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"));
GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook, GaugeWidgetsPage::GaugeWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) :WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(gauge_xpm)); imaglist->Add(wxBitmap(gauge_xpm));

View File

@@ -76,7 +76,7 @@ enum
class ListboxWidgetsPage : public WidgetsPage class ListboxWidgetsPage : public WidgetsPage
{ {
public: public:
ListboxWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); ListboxWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const { return m_lbox; } virtual wxControl *GetWidget() const { return m_lbox; }
@@ -193,9 +193,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox")); IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox"));
ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook, ListboxWidgetsPage::ListboxWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(listbox_xpm)); imaglist->Add(wxBitmap(listbox_xpm));

View File

@@ -24,6 +24,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_NOTEBOOK
// for all others, include the necessary headers // for all others, include the necessary headers
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/app.h" #include "wx/app.h"
@@ -44,7 +46,6 @@
#include "wx/artprov.h" #include "wx/artprov.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/notebook.xpm" #include "icons/notebook.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -78,11 +79,6 @@ enum Orient
Orient_Max Orient_Max
}; };
// old versions of wxWidgets don't define this style
#ifndef wxNB_TOP
#define wxNB_TOP (0)
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// NotebookWidgetsPage // NotebookWidgetsPage
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -395,7 +391,7 @@ void NotebookWidgetsPage::CreateNotebook()
m_notebook->AddPage(CreateNewPage(), m_notebook->AddPage(CreateNewPage(),
old_note->GetPageText(n), old_note->GetPageText(n),
false, false,
m_chkImages->GetValue() ? m_chkImages->GetValue() ?
GetIconIndex() : -1); GetIconIndex() : -1);
} }
@@ -548,4 +544,4 @@ void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
event.Skip(); event.Skip();
} }
#endif #endif // wxUSE_NOTEBOOK

View File

@@ -24,6 +24,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_RADIOBOX
// for all others, include the necessary headers // for all others, include the necessary headers
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -39,7 +41,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/radiobox.xpm" #include "icons/radiobox.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -76,7 +78,7 @@ static const unsigned int DEFAULT_MAJOR_DIM = 3;
class RadioWidgetsPage : public WidgetsPage class RadioWidgetsPage : public WidgetsPage
{ {
public: public:
RadioWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); RadioWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~RadioWidgetsPage(){}; virtual ~RadioWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_radio; } virtual wxControl *GetWidget() const { return m_radio; }
@@ -154,9 +156,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio")); IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"));
RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook, RadioWidgetsPage::RadioWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(radio_xpm)); imaglist->Add(wxBitmap(radio_xpm));
@@ -455,4 +457,4 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event)
event.Enable(enable); event.Enable(enable);
} }
#endif #endif // wxUSE_RADIOBOX

View File

@@ -24,6 +24,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_SLIDER
// for all others, include the necessary headers // for all others, include the necessary headers
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -44,7 +46,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if wxUSE_SLIDER
#include "icons/slider.xpm" #include "icons/slider.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -87,7 +89,7 @@ enum
class SliderWidgetsPage : public WidgetsPage class SliderWidgetsPage : public WidgetsPage
{ {
public: public:
SliderWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); SliderWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~SliderWidgetsPage(){}; virtual ~SliderWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_slider; } virtual wxControl *GetWidget() const { return m_slider; }
@@ -197,9 +199,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider")); IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"));
SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook, SliderWidgetsPage::SliderWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(slider_xpm)); imaglist->Add(wxBitmap(slider_xpm));
@@ -600,5 +602,4 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event)
event.GetPosition()); event.GetPosition());
} }
#endif #endif // wxUSE_SLIDER
// wxUSE_SLIDER

View File

@@ -24,6 +24,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_SPINBTN
// for all others, include the necessary headers // for all others, include the necessary headers
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -42,7 +44,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if wxUSE_SPINBTN
#include "icons/spinbtn.xpm" #include "icons/spinbtn.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -71,7 +73,7 @@ enum
class SpinBtnWidgetsPage : public WidgetsPage class SpinBtnWidgetsPage : public WidgetsPage
{ {
public: public:
SpinBtnWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); SpinBtnWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~SpinBtnWidgetsPage(){}; virtual ~SpinBtnWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_spinbtn; } virtual wxControl *GetWidget() const { return m_spinbtn; }
@@ -164,9 +166,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin")); IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin"));
SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook, SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
m_chkVert = NULL; m_chkVert = NULL;
m_chkWrap = NULL; m_chkWrap = NULL;

View File

@@ -139,7 +139,7 @@ END_EVENT_TABLE()
class StaticWidgetsPage : public WidgetsPage class StaticWidgetsPage : public WidgetsPage
{ {
public: public:
StaticWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); StaticWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~StaticWidgetsPage(){}; virtual ~StaticWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_statText; } virtual wxControl *GetWidget() const { return m_statText; }
@@ -205,9 +205,9 @@ END_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static")); IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"));
StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, StaticWidgetsPage::StaticWidgetsPage(wxBookCtrl *book,
wxImageList *imaglist) wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(statbox_xpm)); imaglist->Add(wxBitmap(statbox_xpm));

View File

@@ -113,7 +113,7 @@ class TextWidgetsPage : public WidgetsPage
{ {
public: public:
// ctor(s) and dtor // ctor(s) and dtor
TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); TextWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
virtual ~TextWidgetsPage(){}; virtual ~TextWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_text; } virtual wxControl *GetWidget() const { return m_text; }
@@ -310,8 +310,8 @@ IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"));
// TextWidgetsPage creation // TextWidgetsPage creation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist) TextWidgetsPage::TextWidgetsPage(wxBookCtrl *book, wxImageList *imaglist)
: WidgetsPage(notebook) : WidgetsPage(book)
{ {
imaglist->Add(wxBitmap(text_xpm)); imaglist->Add(wxBitmap(text_xpm));

View File

@@ -39,7 +39,7 @@
#include "wx/textctrl.h" #include "wx/textctrl.h"
#endif #endif
#include "wx/notebook.h" #include "wx/bookctrl.h"
#include "wx/sizer.h" #include "wx/sizer.h"
#include "wx/colordlg.h" #include "wx/colordlg.h"
@@ -94,8 +94,8 @@ protected:
void OnSetBgCol(wxCommandEvent& event); void OnSetBgCol(wxCommandEvent& event);
#endif // wxUSE_MENUS #endif // wxUSE_MENUS
// initialize the notebook: add all pages to it // initialize the book: add all pages to it
void InitNotebook(); void InitBook();
private: private:
// the panel containing everything // the panel containing everything
@@ -109,8 +109,8 @@ private:
wxLog *m_logTarget; wxLog *m_logTarget;
#endif // wxUSE_LOG #endif // wxUSE_LOG
// the notebook containing the test pages // the book containing the test pages
wxNotebook *m_notebook; wxBookCtrl *m_book;
// and the image list for it // and the image list for it
wxImageList *m_imaglist; wxImageList *m_imaglist;
@@ -267,7 +267,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
m_lboxLog = (wxListBox *)NULL; m_lboxLog = (wxListBox *)NULL;
m_logTarget = (wxLog *)NULL; m_logTarget = (wxLog *)NULL;
#endif // wxUSE_LOG #endif // wxUSE_LOG
m_notebook = (wxNotebook *)NULL; m_book = (wxBookCtrl *)NULL;
m_imaglist = (wxImageList *)NULL; m_imaglist = (wxImageList *)NULL;
#if wxUSE_MENUS #if wxUSE_MENUS
@@ -288,12 +288,12 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
// we have 2 panes: notebook which pages demonstrating the controls in the // we have 2 panes: book which pages demonstrating the controls in the
// upper one and the log window with some buttons in the lower // upper one and the log window with some buttons in the lower
m_notebook = new wxNotebook(m_panel, wxID_ANY, wxDefaultPosition, m_book = new wxBookCtrl(m_panel, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN|wxBC_DEFAULT);
InitNotebook(); InitBook();
// the lower one only has the log listbox and a button to clear it // the lower one only has the log listbox and a button to clear it
#if wxUSE_LOG #if wxUSE_LOG
@@ -320,7 +320,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5); sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
// put everything together // put everything together
sizerTop->Add(m_notebook, 1, wxGROW | (wxALL & ~(wxTOP | wxBOTTOM)), 10); sizerTop->Add(m_book, 1, wxGROW | (wxALL & ~(wxTOP | wxBOTTOM)), 10);
sizerTop->Add(0, 5, 0, wxGROW); // spacer in between sizerTop->Add(0, 5, 0, wxGROW); // spacer in between
sizerTop->Add(sizerDown, 0, wxGROW | (wxALL & ~wxTOP), 10); sizerTop->Add(sizerDown, 0, wxGROW | (wxALL & ~wxTOP), 10);
@@ -338,19 +338,19 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
#endif #endif
} }
void WidgetsFrame::InitNotebook() void WidgetsFrame::InitBook()
{ {
m_imaglist = new wxImageList(32, 32); m_imaglist = new wxImageList(32, 32);
ArrayWidgetsPage pages; ArrayWidgetsPage pages;
wxArrayString labels; wxArrayString labels;
// we need to first create all pages and only then add them to the notebook // we need to first create all pages and only then add them to the book
// as we need the image list first // as we need the image list first
WidgetsPageInfo *info = WidgetsPage::ms_widgetPages; WidgetsPageInfo *info = WidgetsPage::ms_widgetPages;
while ( info ) while ( info )
{ {
WidgetsPage *page = (*info->GetCtor())(m_notebook, m_imaglist); WidgetsPage *page = (*info->GetCtor())(m_book, m_imaglist);
pages.Add(page); pages.Add(page);
labels.Add(info->GetLabel()); labels.Add(info->GetLabel());
@@ -358,18 +358,18 @@ void WidgetsFrame::InitNotebook()
info = info->GetNext(); info = info->GetNext();
} }
m_notebook->SetImageList(m_imaglist); m_book->SetImageList(m_imaglist);
// now do add them // now do add them
size_t count = pages.GetCount(); size_t count = pages.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_notebook->AddPage( m_book->AddPage(
pages[n], pages[n],
labels[n], labels[n],
false, // don't select false, // don't select
n // image id n // image id
); );
} }
} }
@@ -407,7 +407,7 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event))
m_colFg = col; m_colFg = col;
WidgetsPage *page = wxStaticCast(m_notebook->GetCurrentPage(), WidgetsPage); WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage);
page->GetWidget()->SetForegroundColour(m_colFg); page->GetWidget()->SetForegroundColour(m_colFg);
page->GetWidget()->Refresh(); page->GetWidget()->Refresh();
} }
@@ -420,7 +420,7 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
m_colBg = col; m_colBg = col;
WidgetsPage *page = wxStaticCast(m_notebook->GetCurrentPage(), WidgetsPage); WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage);
page->GetWidget()->SetBackgroundColour(m_colBg); page->GetWidget()->SetBackgroundColour(m_colBg);
page->GetWidget()->Refresh(); page->GetWidget()->Refresh();
} }
@@ -492,8 +492,8 @@ WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label)
// WidgetsPage // WidgetsPage
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
WidgetsPage::WidgetsPage(wxNotebook *notebook) WidgetsPage::WidgetsPage(wxBookCtrl *book)
: wxPanel(notebook, wxID_ANY, : wxPanel(book, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxNO_FULL_REPAINT_ON_RESIZE | wxNO_FULL_REPAINT_ON_RESIZE |
wxCLIP_CHILDREN | wxCLIP_CHILDREN |

View File

@@ -13,7 +13,7 @@
#define _WX_SAMPLE_WIDGETS_H_ #define _WX_SAMPLE_WIDGETS_H_
class WXDLLEXPORT wxCheckBox; class WXDLLEXPORT wxCheckBox;
class WXDLLEXPORT wxNotebook; class WXDLLEXPORT wxBookCtrl;
class WXDLLEXPORT wxSizer; class WXDLLEXPORT wxSizer;
class WXDLLEXPORT wxTextCtrl; class WXDLLEXPORT wxTextCtrl;
@@ -25,13 +25,13 @@ class WidgetsPageInfo;
#include "wx/imaglist.h" #include "wx/imaglist.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// WidgetsPage: a notebook page demonstrating some widget // WidgetsPage: a book page demonstrating some widget
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WidgetsPage : public wxPanel class WidgetsPage : public wxPanel
{ {
public: public:
WidgetsPage(wxNotebook *notebook); WidgetsPage(wxBookCtrl *book);
// return the control shown by this page // return the control shown by this page
virtual wxControl *GetWidget() const = 0; virtual wxControl *GetWidget() const = 0;
@@ -74,7 +74,7 @@ public:
class WidgetsPageInfo class WidgetsPageInfo
{ {
public: public:
typedef WidgetsPage *(*Constructor)(wxNotebook *notebook, typedef WidgetsPage *(*Constructor)(wxBookCtrl *book,
wxImageList *imaglist); wxImageList *imaglist);
// our ctor // our ctor
@@ -108,9 +108,9 @@ private:
// and this one must be inserted somewhere in the source file // and this one must be inserted somewhere in the source file
#define IMPLEMENT_WIDGETS_PAGE(classname, label) \ #define IMPLEMENT_WIDGETS_PAGE(classname, label) \
WidgetsPage *wxCtorFor##classname(wxNotebook *notebook, \ WidgetsPage *wxCtorFor##classname(wxBookCtrl *book, \
wxImageList *imaglist) \ wxImageList *imaglist) \
{ return new classname(notebook, imaglist); } \ { return new classname(book, imaglist); } \
WidgetsPageInfo classname:: \ WidgetsPageInfo classname:: \
ms_info##classname(wxCtorFor##classname, label) ms_info##classname(wxCtorFor##classname, label)

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: common/bookctrl.cpp // Name: common/bookctrl.cpp
// Purpose: wxBookCtrl implementation // Purpose: wxBookCtrlBase implementation
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
// Created: 19.08.03 // Created: 19.08.03
@@ -42,14 +42,14 @@
// constructors and destructors // constructors and destructors
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxBookCtrl::Init() void wxBookCtrlBase::Init()
{ {
m_imageList = NULL; m_imageList = NULL;
m_ownsImageList = false; m_ownsImageList = false;
} }
bool bool
wxBookCtrl::Create(wxWindow *parent, wxBookCtrlBase::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
@@ -68,7 +68,7 @@ wxBookCtrl::Create(wxWindow *parent,
); );
} }
wxBookCtrl::~wxBookCtrl() wxBookCtrlBase::~wxBookCtrlBase()
{ {
if ( m_ownsImageList ) if ( m_ownsImageList )
{ {
@@ -81,7 +81,7 @@ wxBookCtrl::~wxBookCtrl()
// image list // image list
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxBookCtrl::SetImageList(wxImageList *imageList) void wxBookCtrlBase::SetImageList(wxImageList *imageList)
{ {
if ( m_ownsImageList ) if ( m_ownsImageList )
{ {
@@ -94,7 +94,7 @@ void wxBookCtrl::SetImageList(wxImageList *imageList)
m_imageList = imageList; m_imageList = imageList;
} }
void wxBookCtrl::AssignImageList(wxImageList* imageList) void wxBookCtrlBase::AssignImageList(wxImageList* imageList)
{ {
SetImageList(imageList); SetImageList(imageList);
@@ -105,12 +105,12 @@ void wxBookCtrl::AssignImageList(wxImageList* imageList)
// geometry // geometry
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxBookCtrl::SetPageSize(const wxSize& size) void wxBookCtrlBase::SetPageSize(const wxSize& size)
{ {
SetClientSize(CalcSizeFromPage(size)); SetClientSize(CalcSizeFromPage(size));
} }
wxSize wxBookCtrl::DoGetBestSize() const wxSize wxBookCtrlBase::DoGetBestSize() const
{ {
wxSize bestSize; wxSize bestSize;
@@ -140,15 +140,15 @@ wxSize wxBookCtrl::DoGetBestSize() const
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool bool
wxBookCtrl::InsertPage(size_t nPage, wxBookCtrlBase::InsertPage(size_t nPage,
wxWindow *page, wxWindow *page,
const wxString& WXUNUSED(text), const wxString& WXUNUSED(text),
bool WXUNUSED(bSelect), bool WXUNUSED(bSelect),
int WXUNUSED(imageId)) int WXUNUSED(imageId))
{ {
wxCHECK_MSG( page, false, _T("NULL page in wxBookCtrl::InsertPage()") ); wxCHECK_MSG( page, false, _T("NULL page in wxBookCtrlBase::InsertPage()") );
wxCHECK_MSG( nPage <= m_pages.size(), false, wxCHECK_MSG( nPage <= m_pages.size(), false,
_T("invalid page index in wxBookCtrl::InsertPage()") ); _T("invalid page index in wxBookCtrlBase::InsertPage()") );
m_pages.Insert(page, nPage); m_pages.Insert(page, nPage);
InvalidateBestSize(); InvalidateBestSize();
@@ -156,7 +156,7 @@ wxBookCtrl::InsertPage(size_t nPage,
return true; return true;
} }
bool wxBookCtrl::DeletePage(size_t nPage) bool wxBookCtrlBase::DeletePage(size_t nPage)
{ {
wxWindow *page = DoRemovePage(nPage); wxWindow *page = DoRemovePage(nPage);
if ( !page ) if ( !page )
@@ -167,10 +167,10 @@ bool wxBookCtrl::DeletePage(size_t nPage)
return true; return true;
} }
wxWindow *wxBookCtrl::DoRemovePage(size_t nPage) wxWindow *wxBookCtrlBase::DoRemovePage(size_t nPage)
{ {
wxCHECK_MSG( nPage < m_pages.size(), NULL, wxCHECK_MSG( nPage < m_pages.size(), NULL,
_T("invalid page index in wxBookCtrl::DoRemovePage()") ); _T("invalid page index in wxBookCtrlBase::DoRemovePage()") );
wxWindow *pageRemoved = m_pages[nPage]; wxWindow *pageRemoved = m_pages[nPage];
m_pages.RemoveAt(nPage); m_pages.RemoveAt(nPage);
@@ -179,7 +179,7 @@ wxWindow *wxBookCtrl::DoRemovePage(size_t nPage)
return pageRemoved; return pageRemoved;
} }
int wxBookCtrl::GetNextPage(bool forward) const int wxBookCtrlBase::GetNextPage(bool forward) const
{ {
int nPage; int nPage;

View File

@@ -1655,7 +1655,7 @@ IMPLEMENT_CLASS(wxNotebookSizer, wxBookCtrlSizer)
#if wxUSE_BOOKCTRL #if wxUSE_BOOKCTRL
wxBookCtrlSizer::wxBookCtrlSizer(wxBookCtrl *bookctrl) wxBookCtrlSizer::wxBookCtrlSizer(wxBookCtrlBase *bookctrl)
: m_bookctrl(bookctrl) : m_bookctrl(bookctrl)
{ {
wxASSERT_MSG( bookctrl, wxT("wxBookCtrlSizer needs a control") ); wxASSERT_MSG( bookctrl, wxT("wxBookCtrlSizer needs a control") );

View File

@@ -64,7 +64,7 @@ const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType();
const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType(); const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType();
const int wxID_CHOICEBOOKCHOICE = wxNewId(); const int wxID_CHOICEBOOKCHOICE = wxNewId();
BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrl) BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase)
EVT_SIZE(wxChoicebook::OnSize) EVT_SIZE(wxChoicebook::OnSize)
EVT_CHOICE(wxID_CHOICEBOOKCHOICE, wxChoicebook::OnChoiceSelected) EVT_CHOICE(wxID_CHOICEBOOKCHOICE, wxChoicebook::OnChoiceSelected)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -276,7 +276,7 @@ void wxChoicebook::SetImageList(wxImageList *imageList)
{ {
// TODO: can be implemented in form of static bitmap near choice control // TODO: can be implemented in form of static bitmap near choice control
wxBookCtrl::SetImageList(imageList); wxBookCtrlBase::SetImageList(imageList);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -334,7 +334,7 @@ wxChoicebook::InsertPage(size_t n,
bool bSelect, bool bSelect,
int imageId) int imageId)
{ {
if ( !wxBookCtrl::InsertPage(n, page, text, bSelect, imageId) ) if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) )
return false; return false;
m_choice->Insert(text, n); m_choice->Insert(text, n);
@@ -369,7 +369,7 @@ wxChoicebook::InsertPage(size_t n,
wxWindow *wxChoicebook::DoRemovePage(size_t page) wxWindow *wxChoicebook::DoRemovePage(size_t page)
{ {
const int page_count = GetPageCount(); const int page_count = GetPageCount();
wxWindow *win = wxBookCtrl::DoRemovePage(page); wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
if ( win ) if ( win )
{ {
@@ -399,7 +399,7 @@ wxWindow *wxChoicebook::DoRemovePage(size_t page)
bool wxChoicebook::DeleteAllPages() bool wxChoicebook::DeleteAllPages()
{ {
m_choice->Clear(); m_choice->Clear();
return wxBookCtrl::DeleteAllPages(); return wxBookCtrlBase::DeleteAllPages();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -62,7 +62,7 @@ const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType();
const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType(); const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType();
const int wxID_LISTBOOKLISTVIEW = wxNewId(); const int wxID_LISTBOOKLISTVIEW = wxNewId();
BEGIN_EVENT_TABLE(wxListbook, wxBookCtrl) BEGIN_EVENT_TABLE(wxListbook, wxBookCtrlBase)
EVT_SIZE(wxListbook::OnSize) EVT_SIZE(wxListbook::OnSize)
EVT_LIST_ITEM_SELECTED(wxID_LISTBOOKLISTVIEW, wxListbook::OnListSelected) EVT_LIST_ITEM_SELECTED(wxID_LISTBOOKLISTVIEW, wxListbook::OnListSelected)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -334,7 +334,7 @@ void wxListbook::SetImageList(wxImageList *imageList)
{ {
m_list->SetImageList(imageList, wxIMAGE_LIST_NORMAL); m_list->SetImageList(imageList, wxIMAGE_LIST_NORMAL);
wxBookCtrl::SetImageList(imageList); wxBookCtrlBase::SetImageList(imageList);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -393,7 +393,7 @@ wxListbook::InsertPage(size_t n,
bool bSelect, bool bSelect,
int imageId) int imageId)
{ {
if ( !wxBookCtrl::InsertPage(n, page, text, bSelect, imageId) ) if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) )
return false; return false;
m_list->InsertItem(n, text, imageId); m_list->InsertItem(n, text, imageId);
@@ -429,7 +429,7 @@ wxListbook::InsertPage(size_t n,
wxWindow *wxListbook::DoRemovePage(size_t page) wxWindow *wxListbook::DoRemovePage(size_t page)
{ {
const int page_count = GetPageCount(); const int page_count = GetPageCount();
wxWindow *win = wxBookCtrl::DoRemovePage(page); wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
if ( win ) if ( win )
{ {
@@ -459,7 +459,7 @@ wxWindow *wxListbook::DoRemovePage(size_t page)
bool wxListbook::DeleteAllPages() bool wxListbook::DeleteAllPages()
{ {
m_list->DeleteAllItems(); m_list->DeleteAllItems();
return wxBookCtrl::DeleteAllPages(); return wxBookCtrlBase::DeleteAllPages();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------