From b0a877ec9382b5fb9f2c736c1a8233318e74201f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 21 Aug 2003 06:33:51 +0000 Subject: [PATCH] support for RTTI git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/calctrl.cpp | 13 +++++++++++ src/generic/dirctrlg.cpp | 24 ++++++++++++++------ src/generic/grid.cpp | 48 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 7 deletions(-) diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index 8a4b397da2..6bda109104 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -104,7 +104,20 @@ BEGIN_EVENT_TABLE(wxYearSpinCtrl, wxSpinCtrl) EVT_SPINCTRL(-1, wxYearSpinCtrl::OnYearChange) END_EVENT_TABLE() +#if wxUSE_EXTENDED_RTTI +IMPLEMENT_DYNAMIC_CLASS_XTI(wxCalendarCtrl, wxControl,"wx/calctrl.h") + +WX_BEGIN_PROPERTIES_TABLE(wxCalendarCtrl) + WX_PROPERTY( Date,wxDateTime, SetDate , GetDate, ) +WX_END_PROPERTIES_TABLE() + +WX_BEGIN_HANDLERS_TABLE(wxCalendarCtrl) +WX_END_HANDLERS_TABLE() + +WX_CONSTRUCTOR_6( wxCalendarCtrl , wxWindow* , Parent , wxWindowID , Id , wxDateTime , Date , wxPoint , Position , wxSize , Size , long , WindowStyle ) +#else IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl) +#endif IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxCommandEvent) // ---------------------------------------------------------------------------- diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 45e2d8f4ce..c017d9f6d7 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -428,14 +428,24 @@ bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const // wxGenericDirCtrl //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrl, wxControl) -/* -TODO PROPERTIES - defaultfolder string - filter string - (long) defaultfilter) -*/ +#if wxUSE_EXTENDED_RTTI +IMPLEMENT_DYNAMIC_CLASS_XTI(wxGenericDirCtrl, wxControl,"wx/dirctrl.h") + +WX_BEGIN_PROPERTIES_TABLE(wxGenericDirCtrl) + WX_PROPERTY( DefaultPath , wxString , SetDefaultPath , GetDefaultPath , ) + WX_PROPERTY( Filter , wxString , SetFilter , GetFilter , ) + WX_PROPERTY( DefaultFilter , int , SetFilterIndex, GetFilterIndex, ) +WX_END_PROPERTIES_TABLE() + +WX_BEGIN_HANDLERS_TABLE(wxGenericDirCtrl) +WX_END_HANDLERS_TABLE() + +WX_CONSTRUCTOR_8( wxGenericDirCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , DefaultPath , + wxPoint , Position , wxSize , Size , long , WindowStyle , wxString , Filter , int , DefaultFilter ) +#else +IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrl, wxControl) +#endif BEGIN_EVENT_TABLE(wxGenericDirCtrl, wxControl) EVT_TREE_ITEM_EXPANDING (-1, wxGenericDirCtrl::OnExpandItem) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 8cdd9eecb8..a02049efd3 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3759,7 +3759,23 @@ static int CoordToRowOrCol(int coord, int defaultDist, int minDist, m_rowBottoms, m_numRows, TRUE) ///////////////////////////////////////////////////////////////////// +#if wxUSE_EXTENDED_RTTI +IMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow,"wx/grid.h") + +WX_BEGIN_PROPERTIES_TABLE(wxGrid) +WX_END_PROPERTIES_TABLE() + +WX_BEGIN_HANDLERS_TABLE(wxGrid) +WX_END_HANDLERS_TABLE() + +WX_CONSTRUCTOR_5( wxGrid , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) + +/* + TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo) +*/ +#else IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow ) +#endif BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) EVT_PAINT( wxGrid::OnPaint ) @@ -3769,6 +3785,16 @@ BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) EVT_ERASE_BACKGROUND( wxGrid::OnEraseBackground ) END_EVENT_TABLE() +wxGrid::wxGrid() +{ + // in order to make sure that a size event is not + // trigerred in a unfinished state + m_cornerLabelWin = NULL ; + m_rowLabelWin = NULL ; + m_colLabelWin = NULL ; + m_gridWin = NULL ; +} + wxGrid::wxGrid( wxWindow *parent, wxWindowID id, const wxPoint& pos, @@ -3782,6 +3808,23 @@ wxGrid::wxGrid( wxWindow *parent, Create(); } +bool wxGrid::Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, const wxSize& size, + long style, const wxString& name) +{ + if (!wxScrolledWindow::Create(parent, id, pos, size, + style | wxWANTS_CHARS , name)) + return FALSE; + + m_colMinWidths =GRID_HASH_SIZE ; + m_rowMinHeights = GRID_HASH_SIZE ; + + Create() ; + + + return TRUE; +} + wxGrid::~wxGrid() { @@ -4191,6 +4234,11 @@ void wxGrid::CalcDimensions() void wxGrid::CalcWindowSizes() { + // escape if the window is has not been fully created yet + + if ( m_cornerLabelWin == NULL ) + return ; + int cw, ch; GetClientSize( &cw, &ch );