X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d0ca2928ba442c8873263672ff7f9541be0c3f0..e6cac2dff47940d9c2dc4362c903309573652e14:/src/generic/datavgen.cpp?ds=sidebyside diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 771dab7a47..f1bcc09c3c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -495,7 +495,9 @@ wxSize wxDataViewProgressRenderer::GetSize() // wxDataViewDateRenderer // --------------------------------------------------------- -#if wxUSE_CALENDARCTRL +#define wxUSE_DATE_RENDERER_POPUP (wxUSE_CALENDARCTRL && wxUSE_POPUPWIN) + +#if wxUSE_DATE_RENDERER_POPUP class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow { @@ -543,7 +545,7 @@ void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event ) DismissAndNotify(); } -#endif // wxUSE_CALENDARCTRL +#endif // wxUSE_DATE_RENDERER_POPUP IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer) @@ -584,16 +586,16 @@ bool wxDataViewDateRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListMode model->GetValue( variant, col, row ); wxDateTime value = variant.GetDateTime(); -#if wxUSE_CALENDARCTRL +#if wxUSE_DATE_RENDERER_POPUP 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 +#else // !wxUSE_DATE_RENDERER_POPUP wxMessageBox(value.Format()); -#endif +#endif // wxUSE_DATE_RENDERER_POPUP/!wxUSE_DATE_RENDERER_POPUP return true; } @@ -1196,7 +1198,11 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) item_rect.width = size.x; item_rect.height= size.y; - cell->Render( item_rect, &dc, 0 ); + + int state = 0; + if (item == m_currentRow) + state |= wxDATAVIEW_CELL_SELECTED; + cell->Render( item_rect, &dc, state ); } cell_rect.x += cell_rect.width;