]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
ODBC library is built when wxUSE_GUI=0, too
[wxWidgets.git] / src / msw / notebook.cpp
index cb9d37a5736c46c47bb176ea1256a360fc5c3f0b..ea3334de804e324c4dcbda26079a3b060c875005 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "notebook.h"
 #endif
 
 #include "wx/panel.h"
 #endif
 
-/*
-       notebookpage
-               object
-               object_ref
-               label
-               selected
-               style
-               usenotebooksizer
-*/
-
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
 // event table
 // ----------------------------------------------------------------------------
 
+#include <wx/listimpl.cpp>
+
+WX_DEFINE_LIST( wxNotebookPageInfoList ) ;
+
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
 
@@ -123,9 +117,27 @@ BEGIN_EVENT_TABLE(wxNotebook, wxControl)
 END_EVENT_TABLE()
 
 #if wxUSE_EXTENDED_RTTI
+
 IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxControl,"wx/notebook.h")
+IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebookPageInfo, wxObject , "wx/notebook.h" )
+
+template<> const wxTypeInfo* wxGetTypeInfo( wxNotebookPageInfoList * )
+{
+    static wxCollectionTypeInfo s_typeInfo( (wxTypeInfo*) wxGetTypeInfo( (wxNotebookPageInfo **) NULL) ) ;
+    return &s_typeInfo ;
+}
 
 WX_BEGIN_PROPERTIES_TABLE(wxNotebook)
+    WX_PROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos )
+/*
+       notebookpage
+               object
+               object_ref
+               label
+               selected
+               style
+               usenotebooksizer
+*/
 WX_END_PROPERTIES_TABLE()
 
 WX_BEGIN_HANDLERS_TABLE(wxNotebook)
@@ -133,8 +145,22 @@ WX_END_HANDLERS_TABLE()
 
 WX_CONSTRUCTOR_4( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) 
 
+
+WX_BEGIN_PROPERTIES_TABLE(wxNotebookPageInfo)
+    WX_READONLY_PROPERTY( Page , wxNotebookPage* , GetPage , )
+    WX_READONLY_PROPERTY( Text , wxString , GetText , wxEmptyString )
+    WX_READONLY_PROPERTY( Selected , bool , GetSelected , false )
+    WX_READONLY_PROPERTY( ImageId , int , GetImageId , -1 )
+WX_END_PROPERTIES_TABLE()
+
+WX_BEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
+WX_END_HANDLERS_TABLE()
+
+WX_CONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId ) 
+
 #else
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject )
 #endif
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
@@ -146,6 +172,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 // wxNotebook construction
 // ----------------------------------------------------------------------------
 
+const wxNotebookPageInfoList& wxNotebook::GetPageInfos() const
+{
+    wxNotebookPageInfoList* list = const_cast< wxNotebookPageInfoList* >( &m_pageInfos ) ;
+    WX_CLEAR_LIST( wxNotebookPageInfoList , *list ) ;
+    for( int i = 0 ; i < GetPageCount() ; ++i )
+    {
+        wxNotebookPageInfo *info = new wxNotebookPageInfo() ;
+        info->Create( const_cast<wxNotebook*>(this)->GetPage(i) , GetPageText(i) , GetSelection() == i , GetPageImage(i) ) ;
+        list->Append( info ) ;
+    }
+    return m_pageInfos ;
+}
+
 // common part of all ctors
 void wxNotebook::Init()
 {