From 53d09d55580712c7ce30cd24716c9a82a89da2c1 Mon Sep 17 00:00:00 2001
From: =?utf8?q?W=C5=82odzimierz=20Skiba?= <abx@abx.art.pl>
Date: Thu, 10 Mar 2005 19:34:58 +0000
Subject: [PATCH] Use initial book from available controls. Select it in menu
 correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 samples/notebook/notebook.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp
index 8f4127ef39..c9b5d4a699 100644
--- a/samples/notebook/notebook.cpp
+++ b/samples/notebook/notebook.cpp
@@ -188,7 +188,16 @@ 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;
@@ -205,6 +214,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"));
-- 
2.47.2