Allow building without calendar.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1c4e8f384d
commit
8d0ca2928b
@ -29,6 +29,7 @@
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stockitem.h"
|
||||
@ -494,6 +495,8 @@ wxSize wxDataViewProgressRenderer::GetSize()
|
||||
// wxDataViewDateRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
#if wxUSE_CALENDARCTRL
|
||||
|
||||
class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow
|
||||
{
|
||||
public:
|
||||
@ -540,6 +543,8 @@ void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
|
||||
DismissAndNotify();
|
||||
}
|
||||
|
||||
#endif // wxUSE_CALENDARCTRL
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer)
|
||||
|
||||
wxDataViewDateRenderer::wxDataViewDateRenderer( const wxString &varianttype,
|
||||
@ -579,13 +584,16 @@ bool wxDataViewDateRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListMode
|
||||
model->GetValue( variant, col, row );
|
||||
wxDateTime value = variant.GetDateTime();
|
||||
|
||||
#if wxUSE_CALENDARCTRL
|
||||
wxDataViewDateRendererPopupTransient *popup = new wxDataViewDateRendererPopupTransient(
|
||||
GetOwner()->GetOwner()->GetParent(), &value, model, col, row );
|
||||
wxPoint pos = wxGetMousePosition();
|
||||
popup->Move( pos );
|
||||
popup->Layout();
|
||||
popup->Popup( popup->m_cal );
|
||||
|
||||
#else
|
||||
wxMessageBox(value.Format());
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user