]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datavgen.cpp
add -mno-cygwin detection: we should treat cygwin as Windows, not Unix, when it's...
[wxWidgets.git] / src / generic / datavgen.cpp
index 20b847e4c7d38646a75a7870253a11650a28e503..771dab7a474a134ba1116c31b775d4cac50796be 100644 (file)
     #include "wx/dcclient.h"
     #include "wx/timer.h"
     #include "wx/settings.h"
+    #include "wx/msgdlg.h"
 #endif
 
 #include "wx/stockitem.h"
 #include "wx/calctrl.h"
 #include "wx/popupwin.h"
 #include "wx/renderer.h"
+#include "wx/dcbuffer.h"
 #include "wx/icon.h"
 
 //-----------------------------------------------------------------------------
@@ -493,6 +495,8 @@ wxSize wxDataViewProgressRenderer::GetSize()
 // wxDataViewDateRenderer
 // ---------------------------------------------------------
 
+#if wxUSE_CALENDARCTRL
+
 class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow
 {
 public:
@@ -539,6 +543,8 @@ void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
     DismissAndNotify();
 }
 
+#endif // wxUSE_CALENDARCTRL
+
 IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer)
 
 wxDataViewDateRenderer::wxDataViewDateRenderer( const wxString &varianttype,
@@ -578,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;
 }
 
@@ -612,6 +621,34 @@ wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *
         m_width = 30;
 }
 
+void wxDataViewColumn::SetAlignment( wxAlignment WXUNUSED(align) )
+{
+    // TODO
+}
+
+void wxDataViewColumn::SetSortable( bool WXUNUSED(sortable) )
+{
+    // TODO
+}
+
+bool wxDataViewColumn::GetSortable()
+{
+    // TODO
+    return false;
+}
+
+void wxDataViewColumn::SetSortOrder( bool WXUNUSED(ascending) )
+{
+    // TODO
+}
+
+bool wxDataViewColumn::IsSortOrderAscending()
+{
+    // TODO
+    return true;
+}
+
+
 wxDataViewColumn::~wxDataViewColumn()
 {
 }
@@ -622,6 +659,12 @@ void wxDataViewColumn::SetTitle( const wxString &title )
 
 }
 
+void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap )
+{
+    wxDataViewColumnBase::SetBitmap( bitmap );
+
+}
+
 int wxDataViewColumn::GetWidth()
 {
     return m_width;
@@ -648,6 +691,7 @@ wxDataViewHeaderWindow::wxDataViewHeaderWindow( wxDataViewCtrl *parent, wxWindow
     m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE );
 
     wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
+    SetBackgroundStyle( wxBG_STYLE_CUSTOM );
     SetOwnForegroundColour( attr.colFg );
     SetOwnBackgroundColour( attr.colBg );
     if (!m_hasFont)
@@ -664,7 +708,10 @@ void wxDataViewHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
     int w, h;
     GetClientSize( &w, &h );
 
-    wxPaintDC dc( this );
+    wxAutoBufferedPaintDC dc( this );
+
+    dc.SetBackground(GetBackgroundColour());
+    dc.Clear();
 
     int xpix;
     m_owner->GetScrollPixelsPerUnit( &xpix, NULL );
@@ -919,6 +966,7 @@ wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID i
 
     m_hasFocus = false;
 
+    SetBackgroundStyle( wxBG_STYLE_CUSTOM );
     SetBackgroundColour( *wxWHITE );
 
     UpdateDisplay();
@@ -1060,7 +1108,10 @@ void wxDataViewMainWindow::ScrollWindow( int dx, int dy, const wxRect *rect )
 
 void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
-    wxPaintDC dc( this );
+    wxAutoBufferedPaintDC dc( this );
+
+    dc.SetBackground(GetBackgroundColour());
+    dc.Clear();
 
     GetOwner()->PrepareDC( dc );