From 1f6420d83ad1f42a78813da64b04a15c5f2a9b2c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 7 Jan 2011 22:31:26 +0000 Subject: [PATCH] common rtti in nbkbase.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/notebook.mm | 2 +- src/common/nbkbase.cpp | 46 +++++++++++----------- src/generic/notebook.cpp | 2 - src/gtk/notebook.cpp | 2 - src/gtk1/notebook.cpp | 2 - src/msw/notebook.cpp | 6 --- src/os2/notebook.cpp | 2 - src/osx/notebook_osx.cpp | 2 - src/palmos/notebook.cpp | 83 ---------------------------------------- src/univ/notebook.cpp | 2 - 10 files changed, 24 insertions(+), 125 deletions(-) diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index 1b1fd296fd..78c3d9d7ce 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -127,7 +127,7 @@ WX_IMPLEMENT_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem) // ======================================================================== // wxNotebook // ======================================================================== -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) + BEGIN_EVENT_TABLE(wxNotebook, wxNotebookBase) END_EVENT_TABLE() WX_IMPLEMENT_COCOA_OWNER(wxNotebook,NSTabView,NSView,NSView) diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index f191f9adfd..d3e76ba250 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -40,15 +40,11 @@ extern WXDLLEXPORT_DATA(const char) wxNotebookNameStr[] = "notebook"; wxDEFINE_EVENT( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxBookCtrlEvent ); wxDEFINE_EVENT( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxBookCtrlEvent ); -#if wxUSE_EXTENDED_RTTI - // ---------------------------------------------------------------------------- // XTI // ---------------------------------------------------------------------------- #include "wx/listimpl.cpp" -WX_DEFINE_LIST( wxNotebookPageInfoList ) - wxDEFINE_FLAGS( wxNotebookStyle ) wxBEGIN_FLAGS( wxNotebookStyle ) // new style border flags, we put them first to @@ -88,7 +84,10 @@ wxFLAGS_MEMBER(wxNB_NOPAGETHEME) wxFLAGS_MEMBER(wxNB_FLAT) wxEND_FLAGS( wxNotebookStyle ) -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxControl, "wx/notebook.h") +#if wxUSE_EXTENDED_RTTI + +WX_DEFINE_LIST( wxNotebookPageInfoList ) + wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebookPageInfo, wxObject, "wx/notebook.h" ) wxCOLLECTION_TYPE_INFO( wxNotebookPageInfo *, wxNotebookPageInfoList ); @@ -99,23 +98,6 @@ template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theLis wxListCollectionToAnyList( theList, value ); } -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, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxNotebook) - -wxCONSTRUCTOR_5( wxNotebook, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size, long, WindowStyle) - wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo) wxREADONLY_PROPERTY( Page, wxNotebookPage*, GetPage, wxEMPTY_PARAMETER_VALUE, \ 0 /*flags*/, wxT("Helpstring"), wxT("group")) @@ -132,7 +114,7 @@ wxEMPTY_HANDLERS_TABLE(wxNotebookPageInfo) wxCONSTRUCTOR_4( wxNotebookPageInfo, wxNotebookPage*, Page, \ wxString, Text, bool, Selected, int, ImageId ) -WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) +// WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) // XTI accessors: void wxNotebookBase::AddPageInfo( wxNotebookPageInfo* info ) @@ -156,6 +138,24 @@ const wxNotebookPageInfoList& wxNotebookBase::GetPageInfos() const #endif +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxControl, "wx/notebook.h") +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, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxNotebook) + +wxCONSTRUCTOR_5( wxNotebook, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size, long, WindowStyle) + // ---------------------------------------------------------------------------- // geometry // ---------------------------------------------------------------------------- diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index 194f3ad628..560ea1000f 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -58,8 +58,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) - // ============================================================================ // implementation // ============================================================================ diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 9d15dc42bd..1185f59526 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -126,8 +126,6 @@ void wxNotebook::AddChildGTK(wxWindowGTK* child) // wxNotebook //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxBookCtrlBase) - BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) END_EVENT_TABLE() diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 780ef4d3db..420c567af6 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -280,8 +280,6 @@ static void wxInsertChildInNotebook( wxNotebook* parent, wxWindow* child ) // wxNotebook //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxBookCtrlBase) - BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) END_EVENT_TABLE() diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index dad5dda20f..ea0df3addf 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -127,12 +127,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) #endif // USE_NOTEBOOK_ANTIFLICKER END_EVENT_TABLE() -#if wxUSE_EXTENDED_RTTI - -#else -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) -#endif - // ============================================================================ // implementation // ============================================================================ diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index f0a88c0c6a..299b848a96 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -60,8 +60,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) - // ============================================================================ // implementation // ============================================================================ diff --git a/src/osx/notebook_osx.cpp b/src/osx/notebook_osx.cpp index fb58c48509..7c65da4656 100644 --- a/src/osx/notebook_osx.cpp +++ b/src/osx/notebook_osx.cpp @@ -38,8 +38,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) - bool wxNotebook::Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, diff --git a/src/palmos/notebook.cpp b/src/palmos/notebook.cpp index 05b0697c51..42b9aecee0 100644 --- a/src/palmos/notebook.cpp +++ b/src/palmos/notebook.cpp @@ -34,10 +34,6 @@ // event table // ---------------------------------------------------------------------------- -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST( wxNotebookPageInfoList ) - BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange) @@ -46,85 +42,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) 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(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxNB_FIXEDWIDTH) - wxFLAGS_MEMBER(wxBK_LEFT) - wxFLAGS_MEMBER(wxBK_RIGHT) - wxFLAGS_MEMBER(wxBK_BOTTOM) - -wxEND_FLAGS( wxNotebookStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxBookCtrlBase,"wx/notebook.h") -IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebookPageInfo, wxObject , "wx/notebook.h" ) - -wxCOLLECTION_TYPE_INFO( wxNotebookPageInfo * , wxNotebookPageInfoList ) ; - -template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theList, wxxVariantArray &value) -{ - wxListCollectionToVariantArray( theList , value ) ; -} - -wxBEGIN_PROPERTIES_TABLE(wxNotebook) - wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxBookCtrlEvent ) - wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxBookCtrlEvent ) - - wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxNotebook) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle) - - -wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo) - wxREADONLY_PROPERTY( Page , wxNotebookPage* , GetPage , EMPTY_MACROVALUE , 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() - -wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId ) - -#else -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject ) -#endif - // ============================================================================ // implementation // ============================================================================ diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 5a1d6c87df..0bd4942765 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -105,8 +105,6 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) - // ---------------------------------------------------------------------------- // wxNotebook creation // ---------------------------------------------------------------------------- -- 2.45.2