END_EVENT_TABLE()
#if wxUSE_EXTENDED_RTTI
+WX_DEFINE_FLAGS( wxNotebookStyle )
+
+wxBEGIN_FLAGS( wxNotebookStyle )
+ // new style border flags, we put them first to
+ // use them for streaming out
+ wxFLAGS_MEMBER(wxBORDER_SIMPLE)
+ wxFLAGS_MEMBER(wxBORDER_SUNKEN)
+ wxFLAGS_MEMBER(wxBORDER_DOUBLE)
+ wxFLAGS_MEMBER(wxBORDER_RAISED)
+ wxFLAGS_MEMBER(wxBORDER_STATIC)
+ wxFLAGS_MEMBER(wxBORDER_NONE)
+
+ // old style border flags
+ wxFLAGS_MEMBER(wxSIMPLE_BORDER)
+ wxFLAGS_MEMBER(wxSUNKEN_BORDER)
+ wxFLAGS_MEMBER(wxDOUBLE_BORDER)
+ wxFLAGS_MEMBER(wxRAISED_BORDER)
+ wxFLAGS_MEMBER(wxSTATIC_BORDER)
+ wxFLAGS_MEMBER(wxNO_BORDER)
+
+ // standard window styles
+ wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
+ wxFLAGS_MEMBER(wxCLIP_CHILDREN)
+ wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
+ wxFLAGS_MEMBER(wxWANTS_CHARS)
+ wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)
+ wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
+ wxFLAGS_MEMBER(wxVSCROLL)
+ wxFLAGS_MEMBER(wxHSCROLL)
+
+ wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
+ wxFLAGS_MEMBER(wxNB_LEFT)
+ wxFLAGS_MEMBER(wxNB_RIGHT)
+ wxFLAGS_MEMBER(wxNB_BOTTOM)
+
+wxEND_FLAGS( wxNotebookStyle )
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 ;
-}
+wxCOLLECTION_TYPE_INFO( wxNotebookPageInfo * , wxNotebookPageInfoList ) ;
template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theList, wxxVariantArray &value)
{
- wxListCollectionToVariantArray( theList , value ) ;
+ wxListCollectionToVariantArray<wxNotebookPageInfoList::compatibility_iterator>( theList , value ) ;
}
-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()
+wxBEGIN_PROPERTIES_TABLE(wxNotebook)
+ wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxNotebookEvent )
+ wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxNotebookEvent )
+
+ wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+wxEND_PROPERTIES_TABLE()
-WX_BEGIN_HANDLERS_TABLE(wxNotebook)
-WX_END_HANDLERS_TABLE()
+wxBEGIN_HANDLERS_TABLE(wxNotebook)
+wxEND_HANDLERS_TABLE()
-WX_CONSTRUCTOR_4( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size )
+wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
-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()
+wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo)
+ wxREADONLY_PROPERTY( Page , wxNotebookPage* , GetPage , , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxREADONLY_PROPERTY( Text , wxString , GetText , wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxREADONLY_PROPERTY( Selected , bool , GetSelected , false, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+ wxREADONLY_PROPERTY( ImageId , int , GetImageId , -1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+wxEND_PROPERTIES_TABLE()
-WX_BEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
-WX_END_HANDLERS_TABLE()
+wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
+wxEND_HANDLERS_TABLE()
-WX_CONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId )
+wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId )
#else
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
{
wxNotebookPageInfoList* list = const_cast< wxNotebookPageInfoList* >( &m_pageInfos ) ;
WX_CLEAR_LIST( wxNotebookPageInfoList , *list ) ;
- for( int i = 0 ; i < GetPageCount() ; ++i )
+ for( size_t i = 0 ; i < GetPageCount() ; ++i )
{
wxNotebookPageInfo *info = new wxNotebookPageInfo() ;
- info->Create( const_cast<wxNotebook*>(this)->GetPage(i) , GetPageText(i) , GetSelection() == i , GetPageImage(i) ) ;
+ info->Create( const_cast<wxNotebook*>(this)->GetPage(i) , GetPageText(i) , GetSelection() == int(i) , GetPageImage(i) ) ;
list->Append( info ) ;
}
return m_pageInfos ;
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
- if ( nPage != m_nSelection )
+ if ( int(nPage) != m_nSelection )
{
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
event.SetSelection(nPage);
{
// change the selected page if it was deleted or became invalid
int selNew;
- if ( m_nSelection == GetPageCount() )
+ if ( m_nSelection == int(GetPageCount()) )
{
// last page deleted, make the new last page the new selection
selNew = m_nSelection - 1;
}
- else if ( nPage <= m_nSelection )
+ else if ( int(nPage) <= m_nSelection )
{
// we must show another page, even if it has the same index
selNew = m_nSelection;
// if the inserted page is before the selected one, we must update the
// index of the selected page
- if ( nPage <= m_nSelection )
+ if ( int(nPage) <= m_nSelection )
{
// one extra page added
m_nSelection++;