wx/gtk/frame.h \
wx/gtk/gauge.h \
wx/gtk/gnome/gprint.h \
+ wx/gtk/gnome/gvfs.h \
wx/gtk/listbox.h \
wx/gtk/mdi.h \
wx/gtk/menu.h \
wx/dcbuffer.h \
wx/generic/calctrl.h \
wx/generic/datectrl.h \
+ wx/generic/dataview.h \
wx/generic/grid.h \
wx/generic/gridctrl.h \
wx/generic/gridsel.h \
wx/dcbuffer.h \
wx/generic/calctrl.h \
wx/generic/datectrl.h \
+ wx/generic/dataview.h \
wx/generic/grid.h \
wx/generic/gridctrl.h \
wx/generic/gridsel.h \
monodll_frame.o \
monodll_gauge.o \
monodll_gprint.o \
+ monodll_gvfs.o \
monodll_listbox.o \
monodll_mdi.o \
monodll_menu.o \
COND_WXUNIV_0___ADVANCED_SRC_OBJECTS = \
monodll_datavcmn.o \
monodll_calctrl.o \
+ monodll_datavgen.o \
monodll_datectlg.o \
monodll_grid.o \
monodll_gridctrl.o \
COND_WXUNIV_1___ADVANCED_SRC_OBJECTS = \
monodll_datavcmn.o \
monodll_calctrl.o \
+ monodll_datavgen.o \
monodll_datectlg.o \
monodll_grid.o \
monodll_gridctrl.o \
monolib_frame.o \
monolib_gauge.o \
monolib_gprint.o \
+ monolib_gvfs.o \
monolib_listbox.o \
monolib_mdi.o \
monolib_menu.o \
COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_1 = \
monolib_datavcmn.o \
monolib_calctrl.o \
+ monolib_datavgen.o \
monolib_datectlg.o \
monolib_grid.o \
monolib_gridctrl.o \
COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_1 = \
monolib_datavcmn.o \
monolib_calctrl.o \
+ monolib_datavgen.o \
monolib_datectlg.o \
monolib_grid.o \
monolib_gridctrl.o \
coredll_frame.o \
coredll_gauge.o \
coredll_gprint.o \
+ coredll_gvfs.o \
coredll_listbox.o \
coredll_mdi.o \
coredll_menu.o \
corelib_frame.o \
corelib_gauge.o \
corelib_gprint.o \
+ corelib_gvfs.o \
corelib_listbox.o \
corelib_mdi.o \
corelib_menu.o \
COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_2 = \
advdll_datavcmn.o \
advdll_calctrl.o \
+ advdll_datavgen.o \
advdll_datectlg.o \
advdll_grid.o \
advdll_gridctrl.o \
COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_2 = \
advdll_datavcmn.o \
advdll_calctrl.o \
+ advdll_datavgen.o \
advdll_datectlg.o \
advdll_grid.o \
advdll_gridctrl.o \
COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_3 = \
advlib_datavcmn.o \
advlib_calctrl.o \
+ advlib_datavgen.o \
advlib_datectlg.o \
advlib_grid.o \
advlib_gridctrl.o \
COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_3 = \
advlib_datavcmn.o \
advlib_calctrl.o \
+ advlib_datavgen.o \
advlib_datectlg.o \
advlib_grid.o \
advlib_gridctrl.o \
monodll_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gprint.cpp
+monodll_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(MONODLL_ODEP)
+ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
+
monodll_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(MONODLL_ODEP)
$(CCC) -c -o $@ $(MONODLL_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
@COND_USE_GUI_1@monodll_calctrl.o: $(srcdir)/src/generic/calctrl.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/calctrl.cpp
+@COND_USE_GUI_1@monodll_datavgen.o: $(srcdir)/src/generic/datavgen.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/datavgen.cpp
+
@COND_USE_GUI_1@monodll_datectlg.o: $(srcdir)/src/generic/datectlg.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/datectlg.cpp
monolib_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gprint.cpp
+monolib_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(MONOLIB_ODEP)
+ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
+
monolib_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(MONOLIB_ODEP)
$(CCC) -c -o $@ $(MONOLIB_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
@COND_USE_GUI_1@monolib_calctrl.o: $(srcdir)/src/generic/calctrl.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/calctrl.cpp
+@COND_USE_GUI_1@monolib_datavgen.o: $(srcdir)/src/generic/datavgen.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/datavgen.cpp
+
@COND_USE_GUI_1@monolib_datectlg.o: $(srcdir)/src/generic/datectlg.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/datectlg.cpp
coredll_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gprint.cpp
+coredll_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(COREDLL_ODEP)
+ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
+
coredll_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(COREDLL_ODEP)
$(CCC) -c -o $@ $(COREDLL_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
corelib_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gprint.cpp
+corelib_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(CORELIB_ODEP)
+ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
+
corelib_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(CORELIB_ODEP)
$(CCC) -c -o $@ $(CORELIB_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
advdll_calctrl.o: $(srcdir)/src/generic/calctrl.cpp $(ADVDLL_ODEP)
$(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/calctrl.cpp
+advdll_datavgen.o: $(srcdir)/src/generic/datavgen.cpp $(ADVDLL_ODEP)
+ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/datavgen.cpp
+
advdll_datectlg.o: $(srcdir)/src/generic/datectlg.cpp $(ADVDLL_ODEP)
$(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/datectlg.cpp
advlib_calctrl.o: $(srcdir)/src/generic/calctrl.cpp $(ADVLIB_ODEP)
$(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/calctrl.cpp
+advlib_datavgen.o: $(srcdir)/src/generic/datavgen.cpp $(ADVLIB_ODEP)
+ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/datavgen.cpp
+
advlib_datectlg.o: $(srcdir)/src/generic/datectlg.cpp $(ADVLIB_ODEP)
$(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/datectlg.cpp
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/generic/dataview.h
+// Purpose: wxDataViewCtrl generic implementation header
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __GENERICDATAVIEWCTRLH__
+#define __GENERICDATAVIEWCTRLH__
+
+#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/list.h"
+#include "wx/control.h"
+
+// ---------------------------------------------------------
+// classes
+// ---------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxDataViewCtrl;
+
+// ---------------------------------------------------------
+// wxDataViewCell
+// ---------------------------------------------------------
+
+class wxDataViewCell: public wxDataViewCellBase
+{
+public:
+ wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewTextCell
+// ---------------------------------------------------------
+
+class wxDataViewTextCell: public wxDataViewCell
+{
+public:
+ wxDataViewTextCell( const wxString &varianttype = wxT("string"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+ bool SetValue( const wxVariant &value );
+ bool GetValue( wxVariant &value );
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewToggleCell
+// ---------------------------------------------------------
+
+class wxDataViewToggleCell: public wxDataViewCell
+{
+public:
+ wxDataViewToggleCell( const wxString &varianttype = wxT("bool"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+ bool SetValue( const wxVariant &value );
+ bool GetValue( wxVariant &value );
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewCustomCell
+// ---------------------------------------------------------
+
+class wxDataViewCustomCell: public wxDataViewCell
+{
+public:
+ wxDataViewCustomCell( const wxString &varianttype = wxT("string"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT )
+ ~wxDataViewCustomCell();
+ bool Init();
+
+ virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
+ virtual wxSize GetSize() = 0;
+
+ virtual bool Activate( wxRect cell,
+ wxDataViewListModel *model, size_t col, size_t row )
+ { return false; }
+
+ virtual bool LeftClick( wxPoint cursor, wxRect cell,
+ wxDataViewListModel *model, size_t col, size_t row )
+ { return false; }
+ virtual bool RightClick( wxPoint cursor, wxRect cell,
+ wxDataViewListModel *model, size_t col, size_t row )
+ { return false; }
+ virtual bool StartDrag( wxPoint cursor, wxRect cell,
+ wxDataViewListModel *model, size_t col, size_t row )
+ { return false; }
+
+ // Create DC on request
+ virtual wxDC *GetDC();
+
+private:
+ wxDC *m_dc;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewProgressCell
+// ---------------------------------------------------------
+
+class wxDataViewProgressCell: public wxDataViewCustomCell
+{
+public:
+ wxDataViewProgressCell( const wxString &label = wxEmptyString,
+ const wxString &varianttype = wxT("long"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ ~wxDataViewProgressCell();
+
+ bool SetValue( const wxVariant &value );
+
+ virtual bool Render( wxRect cell, wxDC *dc, int state );
+ virtual wxSize GetSize();
+
+private:
+ wxString m_label;
+ int m_value;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewDateCell
+// ---------------------------------------------------------
+
+class wxDataViewDateCell: public wxDataViewCustomCell
+{
+public:
+ wxDataViewDateCell( const wxString &varianttype = wxT("datetime"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE );
+
+ bool SetValue( const wxVariant &value );
+
+ virtual bool Render( wxRect cell, wxDC *dc, int state );
+ virtual wxSize GetSize();
+ virtual bool Activate( wxRect cell,
+ wxDataViewListModel *model, size_t col, size_t row );
+
+private:
+ wxDateTime m_date;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateCell)
+};
+
+// ---------------------------------------------------------
+// wxDataViewColumn
+// ---------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxDataViewColumn: public wxDataViewColumnBase
+{
+public:
+ wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
+ virtual ~wxDataViewColumn();
+
+ virtual void SetTitle( const wxString &title );
+
+private:
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn)
+};
+
+// ---------------------------------------------------------
+// wxDataViewCtrl
+// ---------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxDataViewCtrl: public wxDataViewCtrlBase,
+ public wxScrollHelperNative
+{
+public:
+ wxDataViewCtrl() : wxScrollHelperNative(this)
+ {
+ Init();
+ }
+
+ wxDataViewCtrl( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator ) :
+ wxScrollHelperNative(this)
+ {
+ Create(parent, id, pos, size, style, validator );
+ }
+
+ virtual ~wxDataViewCtrl();
+
+ void Init();
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator );
+
+ virtual bool AssociateModel( wxDataViewListModel *model );
+ virtual bool AppendColumn( wxDataViewColumn *col );
+
+private:
+ wxDataViewListModelNotifier *m_notifier;
+ wxWindow *m_clientArea;
+ wxWindow *m_headerArea;
+
+private:
+ virtual void ScrollWindow( int dx, int dy, const wxRect *rect );
+
+ // we need to return a special WM_GETDLGCODE value to process just the
+ // arrows but let the other navigation characters through
+#ifdef __WXMSW__
+ virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+#endif // __WXMSW__
+
+ WX_FORWARD_TO_SCROLL_HELPER()
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
+ DECLARE_NO_COPY_CLASS(wxDataViewCtrl)
+};
+
+
+#endif // __GENERICDATAVIEWCTRLH__
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: datavgen.cpp
+// Purpose: wxDataViewCtrl generic implementation
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/defs.h"
+
+#if wxUSE_DATAVIEWCTRL
+
+#include "wx/dataview.h"
+
+#ifdef wxUSE_GENERICDATAVIEWCTRL
+
+#include "wx/stockitem.h"
+#include "wx/dcclient.h"
+#include "wx/calctrl.h"
+#include "wx/popupwin.h"
+#include "wx/sizer.h"
+#include "wx/log.h"
+#include "wx/renderer.h"
+
+#ifdef __WXMSW__
+ #include <windows.h> // for DLGC_WANTARROWS
+ #include "wx/msw/winundef.h"
+#endif
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxDataViewCtrl;
+
+// ---------------------------------------------------------
+// wxGenericDataViewListModelNotifier
+// ---------------------------------------------------------
+
+class wxGenericDataViewListModelNotifier: public wxDataViewListModelNotifier
+{
+public:
+ wxGenericDataViewListModelNotifier( wxDataViewListModel *wx_model );
+
+ virtual bool RowAppended();
+ virtual bool RowPrepended();
+ virtual bool RowInserted( size_t before );
+ virtual bool RowDeleted( size_t row );
+ virtual bool RowChanged( size_t row );
+ virtual bool ValueChanged( size_t col, size_t row );
+ virtual bool RowsReordered( size_t *new_order );
+ virtual bool Cleared();
+
+ wxDataViewListModel *m_wx_model;
+};
+
+// ---------------------------------------------------------
+// wxGenericDataViewListModelNotifier
+// ---------------------------------------------------------
+
+wxGenericDataViewListModelNotifier::wxGenericDataViewListModelNotifier(
+ wxDataViewListModel *wx_model )
+{
+ m_wx_model = wx_model;
+}
+
+bool wxGenericDataViewListModelNotifier::RowAppended()
+{
+ size_t pos = m_wx_model->GetNumberOfRows()-1;
+
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::RowPrepended()
+{
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::RowInserted( size_t before )
+{
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::RowDeleted( size_t row )
+{
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::RowChanged( size_t row )
+{
+ return true;
+}
+
+bool wxGenericDataViewListModelNotifier::ValueChanged( size_t model_col, size_t model_row )
+{
+ wxNode *node = GetOwner()->m_viewingColumns.GetFirst();
+ while (node)
+ {
+ wxDataViewViewingColumn* viewing_column = (wxDataViewViewingColumn*) node->GetData();
+ if (viewing_column->m_modelColumn == model_col)
+ {
+
+ }
+
+ node = node->GetNext();
+ }
+
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::RowsReordered( size_t *new_order )
+{
+ wxNode *node = GetOwner()->m_viewingColumns.GetFirst();
+ while (node)
+ {
+ wxDataViewViewingColumn* viewing_column = (wxDataViewViewingColumn*) node->GetData();
+
+ node = node->GetNext();
+ }
+
+ return false;
+}
+
+bool wxGenericDataViewListModelNotifier::Cleared()
+{
+ return false;
+}
+
+// ---------------------------------------------------------
+// wxDataViewCell
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewCell, wxDataViewCellBase)
+
+wxDataViewCell::wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewCellBase( varianttype, mode )
+{
+}
+
+// ---------------------------------------------------------
+// wxDataViewTextCell
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewTextCell, wxDataViewCell)
+
+wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewCell( varianttype, mode )
+{
+}
+
+bool wxDataViewTextCell::SetValue( const wxVariant &value )
+{
+ return false;
+}
+
+bool wxDataViewTextCell::GetValue( wxVariant &value )
+{
+ return false;
+}
+
+// ---------------------------------------------------------
+// wxDataViewToggleCell
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleCell, wxDataViewCell)
+
+wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype,
+ wxDataViewCellMode mode ) :
+ wxDataViewCell( varianttype, mode )
+{
+}
+
+bool wxDataViewToggleCell::SetValue( const wxVariant &value )
+{
+ return false;
+}
+
+bool wxDataViewToggleCell::GetValue( wxVariant &value )
+{
+ return false;
+}
+
+// ---------------------------------------------------------
+// wxDataViewCustomCell
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomCell, wxDataViewCell)
+
+wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype,
+ wxDataViewCellMode mode ) :
+ wxDataViewCell( varianttype, mode )
+{
+ m_dc = NULL;
+
+ Init();
+}
+
+bool wxDataViewCustomCell::Init()
+{
+ return false;
+}
+
+wxDataViewCustomCell::~wxDataViewCustomCell()
+{
+ if (m_dc)
+ delete m_dc;
+}
+
+wxDC *wxDataViewCustomCell::GetDC()
+{
+ if (m_dc == NULL)
+ {
+ if (GetOwner() == NULL)
+ return NULL;
+ if (GetOwner()->GetOwner() == NULL)
+ return NULL;
+ m_dc = new wxClientDC( GetOwner()->GetOwner() );
+ }
+
+ return m_dc;
+}
+
+// ---------------------------------------------------------
+// wxDataViewProgressCell
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressCell, wxDataViewCustomCell)
+
+wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label,
+ const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewCustomCell( varianttype, mode )
+{
+ m_label = label;
+ m_value = 0;
+}
+
+wxDataViewProgressCell::~wxDataViewProgressCell()
+{
+}
+
+bool wxDataViewProgressCell::SetValue( const wxVariant &value )
+{
+ m_value = (long) value;
+
+ if (m_value < 0) m_value = 0;
+ if (m_value > 100) m_value = 100;
+
+ return true;
+}
+
+bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int state )
+{
+ double pct = (double)m_value / 100.0;
+ wxRect bar = cell;
+ bar.width = (int)(cell.width * pct);
+ dc->SetPen( *wxTRANSPARENT_PEN );
+ dc->SetBrush( *wxBLUE_BRUSH );
+ dc->DrawRectangle( bar );
+
+ dc->SetBrush( *wxTRANSPARENT_BRUSH );
+ dc->SetPen( *wxBLACK_PEN );
+ dc->DrawRectangle( cell );
+
+ return true;
+}
+
+wxSize wxDataViewProgressCell::GetSize()
+{
+ return wxSize(40,12);
+}
+
+// ---------------------------------------------------------
+// wxDataViewDateCell
+// ---------------------------------------------------------
+
+class wxDataViewDateCellPopupTransient: public wxPopupTransientWindow
+{
+public:
+ wxDataViewDateCellPopupTransient( wxWindow* parent, wxDateTime *value,
+ wxDataViewListModel *model, size_t col, size_t row ) :
+ wxPopupTransientWindow( parent, wxBORDER_SIMPLE )
+ {
+ m_model = model;
+ m_col = col;
+ m_row = row;
+ m_cal = new wxCalendarCtrl( this, -1, *value );
+ wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
+ sizer->Add( m_cal, 1, wxGROW );
+ SetSizer( sizer );
+ sizer->Fit( this );
+ }
+
+ virtual void OnDismiss()
+ {
+ }
+
+ void OnCalendar( wxCalendarEvent &event );
+
+ wxCalendarCtrl *m_cal;
+ wxDataViewListModel *m_model;
+ size_t m_col;
+ size_t m_row;
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+BEGIN_EVENT_TABLE(wxDataViewDateCellPopupTransient,wxPopupTransientWindow)
+ EVT_CALENDAR( -1, wxDataViewDateCellPopupTransient::OnCalendar )
+END_EVENT_TABLE()
+
+void wxDataViewDateCellPopupTransient::OnCalendar( wxCalendarEvent &event )
+{
+ wxDateTime date = event.GetDate();
+ wxVariant value = date;
+ m_model->SetValue( value, m_col, m_row );
+ m_model->ValueChanged( m_col, m_row );
+ DismissAndNotify();
+}
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateCell, wxDataViewCustomCell)
+
+wxDataViewDateCell::wxDataViewDateCell( const wxString &varianttype,
+ wxDataViewCellMode mode ) :
+ wxDataViewCustomCell( varianttype, mode )
+{
+}
+
+bool wxDataViewDateCell::SetValue( const wxVariant &value )
+{
+ m_date = value.GetDateTime();
+
+ return true;
+}
+
+bool wxDataViewDateCell::Render( wxRect cell, wxDC *dc, int state )
+{
+ dc->SetFont( GetOwner()->GetOwner()->GetFont() );
+ wxString tmp = m_date.FormatDate();
+ dc->DrawText( tmp, cell.x, cell.y );
+
+ return true;
+}
+
+wxSize wxDataViewDateCell::GetSize()
+{
+ wxDataViewCtrl* view = GetOwner()->GetOwner();
+ wxString tmp = m_date.FormatDate();
+ wxCoord x,y,d;
+ view->GetTextExtent( tmp, &x, &y, &d );
+ return wxSize(x,y+d);
+}
+
+bool wxDataViewDateCell::Activate( wxRect cell, wxDataViewListModel *model, size_t col, size_t row )
+{
+ wxVariant variant;
+ model->GetValue( variant, col, row );
+ wxDateTime value = variant.GetDateTime();
+
+ wxDataViewDateCellPopupTransient *popup = new wxDataViewDateCellPopupTransient(
+ GetOwner()->GetOwner()->GetParent(), &value, model, col, row );
+ wxPoint pos = wxGetMousePosition();
+ popup->Move( pos );
+ popup->Layout();
+ popup->Popup( popup->m_cal );
+
+ return true;
+}
+
+// ---------------------------------------------------------
+// wxDataViewColumn
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
+
+wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell,
+ size_t model_column, int flags ) :
+ wxDataViewColumnBase( title, cell, model_column, flags )
+{
+}
+
+wxDataViewColumn::~wxDataViewColumn()
+{
+}
+
+void wxDataViewColumn::SetTitle( const wxString &title )
+{
+ wxDataViewColumnBase::SetTitle( title );
+
+}
+
+//-----------------------------------------------------------------------------
+// wxDataViewHeaderWindow
+//-----------------------------------------------------------------------------
+
+class wxDataViewHeaderWindow: public wxWindow
+{
+public:
+ wxDataViewHeaderWindow( wxDataViewCtrl *parent,
+ wxWindowID id,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ const wxString &name = wxT("wxdataviewctrlheaderwindow") );
+ ~wxDataViewHeaderWindow();
+
+ void SetOwner( wxDataViewCtrl* owner ) { m_owner = owner; }
+ wxDataViewCtrl *GetOwner() { return m_owner; }
+
+ void OnPaint( wxPaintEvent &event );
+ void OnMouse( wxMouseEvent &event );
+ void OnSetFocus( wxFocusEvent &event );
+
+private:
+ wxDataViewCtrl *m_owner;
+ wxCursor *m_resizeCursor;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxDataViewHeaderWindow)
+ DECLARE_EVENT_TABLE()
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxDataViewHeaderWindow, wxWindow)
+
+BEGIN_EVENT_TABLE(wxDataViewHeaderWindow,wxWindow)
+ EVT_PAINT (wxDataViewHeaderWindow::OnPaint)
+ EVT_MOUSE_EVENTS (wxDataViewHeaderWindow::OnMouse)
+ EVT_SET_FOCUS (wxDataViewHeaderWindow::OnSetFocus)
+END_EVENT_TABLE()
+
+wxDataViewHeaderWindow::wxDataViewHeaderWindow( wxDataViewCtrl *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size, const wxString &name ) :
+ wxWindow( parent, id, pos, size, 0, name )
+{
+ SetOwner( parent );
+
+ m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE );
+
+ wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
+ SetOwnForegroundColour( attr.colFg );
+ SetOwnBackgroundColour( attr.colBg );
+ if (!m_hasFont)
+ SetOwnFont( attr.font );
+}
+
+wxDataViewHeaderWindow::~wxDataViewHeaderWindow()
+{
+ delete m_resizeCursor;
+}
+
+void wxDataViewHeaderWindow::OnPaint( wxPaintEvent &event )
+{
+ wxPaintDC dc;
+ PrepareDC( dc );
+
+ int xpix;
+ m_owner->GetScrollPixelsPerUnit( &xpix, NULL );
+
+ int x;
+ m_owner->GetViewStart( &x, NULL );
+
+ // account for the horz scrollbar offset
+ dc.SetDeviceOrigin( -x * xpix, 0 );
+
+ dc.SetFont( GetFont() );
+
+ dc.DrawText( wxT("This is the header..", 5, 5 );
+}
+
+void wxDataViewHeaderWindow::OnMouse( wxMouseEvent &event )
+{
+}
+
+void wxDataViewHeaderWindow::OnSetFocus( wxFocusEvent &event )
+{
+ event.Skip();
+}
+
+//-----------------------------------------------------------------------------
+// wxDataViewMainWindow
+//-----------------------------------------------------------------------------
+
+class wxDataViewMainWindow: public wxWindow
+{
+public:
+ wxDataViewMainWindow( wxDataViewCtrl *parent,
+ wxWindowID id,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ const wxString &name = wxT("wxdataviewctrlmainwindow") );
+ ~wxDataViewMainWindow();
+
+ void SetOwner( wxDataViewCtrl* owner ) { m_owner = owner; }
+ wxDataViewCtrl *GetOwner() { return m_owner; }
+
+ void OnPaint( wxPaintEvent &event );
+ void OnMouse( wxMouseEvent &event );
+ void OnSetFocus( wxFocusEvent &event );
+
+private:
+ wxDataViewCtrl *m_owner;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxDataViewMainWindow)
+ DECLARE_EVENT_TABLE()
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxDataViewMainWindow, wxWindow)
+
+BEGIN_EVENT_TABLE(wxDataViewMainWindow,wxWindow)
+ EVT_PAINT (wxDataViewMainWindow::OnPaint)
+ EVT_MOUSE_EVENTS (wxDataViewMainWindow::OnMouse)
+ EVT_SET_FOCUS (wxDataViewMainWindow::OnSetFocus)
+END_EVENT_TABLE()
+
+wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size, const wxString &name ) :
+ wxWindow( parent, id, pos, size, 0, name )
+{
+ SetOwner( parent );
+}
+
+wxDataViewMainWindow::~wxDataViewMainWindow()
+{
+}
+
+void wxDataViewMainWindow::OnPaint( wxPaintEvent &event )
+{
+ wxPaintDC dc( this );
+
+ PrepareDC( dc );
+
+ int dev_x, dev_y;
+ CalcScrolledPosition( 0, 0, &dev_x, &dev_y );
+
+ dc.SetFont( GetFont() );
+
+ dc.DrawText( wxT("main window"), 5, 5 );
+}
+
+void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
+{
+ event.Skip();
+}
+
+void wxDataViewMainWindow::OnSetFocus( wxFocusEvent &event )
+{
+ event.Skip();
+}
+
+//-----------------------------------------------------------------------------
+// wxDataViewCtrl
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl, wxDataViewCtrlBase)
+
+wxDataViewCtrl::~wxDataViewCtrl()
+{
+ if (m_notifier)
+ GetModel()->RemoveNotifier( m_notifier );
+}
+
+void wxDataViewCtrl::Init()
+{
+ m_notifier = NULL;
+}
+
+bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos, const wxSize& size,
+ long style, const wxValidator& validator )
+{
+ Init();
+
+#ifdef __WXMAC__
+ MacSetClipChildren( true ) ;
+#endif
+
+ m_clientArea = new wxDataViewMainWindow( this, -1 );
+ m_headerArea = new wxDataViewHeaderWindow( this, -1, wxDefaultPosition, wxSize(-1,25) );
+
+ SetTargetWindow( m_clientArea );
+
+ wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
+ sizer->Add( m_headerArea, 0, wxGROW );
+ sizer->Add( m_clientArea, 1, wxGROW );
+ SetSizer( sizer );
+
+ return true;
+}
+
+#ifdef __WXMSW__
+WXLRESULT wxDataViewCtrl::MSWWindowProc(WXUINT nMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam)
+{
+ WXLRESULT rc = wxPanel::MSWWindowProc(nMsg, wParam, lParam);
+
+#ifndef __WXWINCE__
+ // we need to process arrows ourselves for scrolling
+ if ( nMsg == WM_GETDLGCODE )
+ {
+ rc |= DLGC_WANTARROWS;
+ }
+#endif
+
+ return rc;
+}
+#endif
+
+void wxDataViewCtrl::ScrollWindow( int dx, int dy, const wxRect *rect )
+{
+ wxDataViewCtrlBase::ScrollWindow( dx, dy, rect );
+ m_headerArea->ScrollWindow( dx, 0, rect );
+}
+
+bool wxDataViewCtrl::AssociateModel( wxDataViewListModel *model )
+{
+ if (!wxDataViewCtrlBase::AssociateModel( model ))
+ return false;
+
+ m_notifier = new wxGenericDataViewListModelNotifier( model );
+
+ model->AddNotifier( m_notifier );
+
+ return true;
+}
+
+bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
+{
+ if (!wxDataViewCtrlBase::AppendColumn(col))
+ return false;
+
+ return true;
+}
+
+#endif
+ // !wxUSE_GENERICDATAVIEWCTRL
+
+#endif
+ // wxUSE_DATAVIEWCTRL
+