+#if wxUSE_CHOICEBOOK
+ if (GetSheetStyle() & wxPROPSHEET_CHOICEBOOK)
+ bookCtrl = new wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+#endif
+#if wxUSE_TOOLBOOK
+#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON
+ if (GetSheetStyle() & wxPROPSHEET_BUTTONTOOLBOOK)
+ bookCtrl = new wxToolbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style|wxTBK_BUTTONBAR );
+ else
+#endif
+ if ((GetSheetStyle() & wxPROPSHEET_TOOLBOOK) || (GetSheetStyle() & wxPROPSHEET_BUTTONTOOLBOOK))
+ bookCtrl = new wxToolbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+#endif
+#if wxUSE_LISTBOOK
+ if (GetSheetStyle() & wxPROPSHEET_LISTBOOK)
+ bookCtrl = new wxListbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+#endif
+#if wxUSE_TREEBOOK
+ if (GetSheetStyle() & wxPROPSHEET_TREEBOOK)
+ bookCtrl = new wxTreebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+#endif
+ if (!bookCtrl)
+ bookCtrl = new wxBookCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+
+ if (GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT)
+ bookCtrl->SetFitToCurrentPage(true);
+
+ return bookCtrl;