#if defined(__WXGTK20__)
// for testing
- // #define wxUSE_GENERICDATAVIEWCTRL 1
+ #define wxUSE_GENERICDATAVIEWCTRL 1
#elif defined(__WXMAC__)
#define wxUSE_GENERICDATAVIEWCTRL 1
#else
class WXDLLIMPEXP_ADV wxDataViewListModel;
class WXDLLIMPEXP_ADV wxDataViewCtrl;
class WXDLLIMPEXP_ADV wxDataViewColumn;
-class WXDLLIMPEXP_ADV wxDataViewCell;
+class WXDLLIMPEXP_ADV wxDataViewRenderer;
extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxDataViewCtrlNameStr[];
};
// ---------------------------------------------------------
-// wxDataViewCellBase
+// wxDataViewRendererBase
// ---------------------------------------------------------
enum wxDataViewCellMode
wxDATAVIEW_CELL_FOCUSED = 8
};
-class WXDLLIMPEXP_ADV wxDataViewCellBase: public wxObject
+class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject
{
public:
- wxDataViewCellBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
virtual bool SetValue( const wxVariant& WXUNUSED(value) ) { return true; }
virtual bool GetValue( wxVariant& WXUNUSED(value) ) { return true; }
wxDataViewColumn *m_owner;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCellBase)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
};
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
{
public:
- wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, unsigned int model_column,
+ wxDataViewColumnBase( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column,
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
virtual ~wxDataViewColumnBase();
virtual void SetTitle( const wxString &title );
virtual wxString GetTitle();
- wxDataViewCell* GetCell() { return m_cell; }
+ wxDataViewRenderer* GetRenderer() { return m_renderer; }
- unsigned int GetModelColumn() { return m_model_column; }
+ unsigned int GetModelColumn() { return m_model_column; }
void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; }
wxDataViewCtrl *GetOwner() { return m_owner; }
private:
wxDataViewCtrl *m_ctrl;
- wxDataViewCell *m_cell;
+ wxDataViewRenderer *m_renderer;
int m_model_column;
int m_flags;
wxString m_title;
class WXDLLIMPEXP_ADV wxDataViewHeaderWindow;
// ---------------------------------------------------------
-// wxDataViewCell
+// wxDataViewRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewCell: public wxDataViewCellBase
+class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase
{
public:
- wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
- virtual ~wxDataViewCell();
+ wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ virtual ~wxDataViewRenderer();
virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
virtual wxSize GetSize() = 0;
wxDC *m_dc;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
};
// ---------------------------------------------------------
-// wxDataViewCustomCell
+// wxDataViewCustomRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewCustomCell: public wxDataViewCell
+class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
{
public:
- wxDataViewCustomCell( const wxString &varianttype = wxT("string"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
};
// ---------------------------------------------------------
-// wxDataViewTextCell
+// wxDataViewTextRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewTextCell: public wxDataViewCustomCell
+class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewTextCell( const wxString &varianttype = wxT("string"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value );
wxString m_text;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
};
// ---------------------------------------------------------
-// wxDataViewBitmapCell
+// wxDataViewBitmapRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewBitmapCell: public wxDataViewCustomCell
+class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewBitmapCell( const wxString &varianttype = wxT("wxBitmap"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value );
wxBitmap m_bitmap;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
};
// ---------------------------------------------------------
-// wxDataViewToggleCell
+// wxDataViewToggleRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewToggleCell: public wxDataViewCustomCell
+class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewToggleCell( const wxString &varianttype = wxT("bool"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value );
bool m_toggle;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
};
// ---------------------------------------------------------
-// wxDataViewProgressCell
+// wxDataViewProgressRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewProgressCell: public wxDataViewCustomCell
+class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewProgressCell( const wxString &label = wxEmptyString,
- const wxString &varianttype = wxT("long"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
- virtual ~wxDataViewProgressCell();
+ wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
+ const wxString &varianttype = wxT("long"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ virtual ~wxDataViewProgressRenderer();
bool SetValue( const wxVariant &value );
int m_value;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
};
// ---------------------------------------------------------
-// wxDataViewDateCell
+// wxDataViewDateRenderer
// ---------------------------------------------------------
-class WXDLLIMPEXP_ADV wxDataViewDateCell: public wxDataViewCustomCell
+class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewDateCell( const wxString &varianttype = wxT("datetime"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE );
+ wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE );
bool SetValue( const wxVariant &value );
wxDateTime m_date;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
{
public:
- wxDataViewColumn( const wxString &title, wxDataViewCell *cell, unsigned int model_column,
+ wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column,
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
virtual ~wxDataViewColumn();
class WXDLLIMPEXP_CORE wxDataViewCtrl;
// ---------------------------------------------------------
-// wxDataViewCell
+// wxDataViewRenderer
// ---------------------------------------------------------
-class wxDataViewCell: public wxDataViewCellBase
+class wxDataViewRenderer: public wxDataViewRendererBase
{
public:
- wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
// implementation
void* GetGtkHandle() { return m_renderer; }
void* m_renderer;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
};
// ---------------------------------------------------------
-// wxDataViewTextCell
+// wxDataViewTextRenderer
// ---------------------------------------------------------
-class wxDataViewTextCell: public wxDataViewCell
+class wxDataViewTextRenderer: public wxDataViewRenderer
{
public:
- wxDataViewTextCell( const wxString &varianttype = wxT("string"),
+ wxDataViewTextRenderer( 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)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
};
// ---------------------------------------------------------
-// wxDataViewBitmapCell
+// wxDataViewBitmapRenderer
// ---------------------------------------------------------
-class wxDataViewBitmapCell: public wxDataViewCell
+class wxDataViewBitmapRenderer: public wxDataViewRenderer
{
public:
- wxDataViewBitmapCell( const wxString &varianttype = wxT("wxBitmap"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value );
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
};
// ---------------------------------------------------------
-// wxDataViewToggleCell
+// wxDataViewToggleRenderer
// ---------------------------------------------------------
-class wxDataViewToggleCell: public wxDataViewCell
+class wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
- wxDataViewToggleCell( const wxString &varianttype = wxT("bool"),
+ wxDataViewToggleRenderer( 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)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
};
// ---------------------------------------------------------
-// wxDataViewCustomCell
+// wxDataViewCustomRenderer
// ---------------------------------------------------------
-class wxDataViewCustomCell: public wxDataViewCell
+class wxDataViewCustomRenderer: public wxDataViewRenderer
{
public:
- wxDataViewCustomCell( const wxString &varianttype = wxT("string"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
- bool no_init = false );
- virtual ~wxDataViewCustomCell();
+ wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
+ bool no_init = false );
+ virtual ~wxDataViewCustomRenderer();
bool Init();
virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
wxDC *m_dc;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
};
// ---------------------------------------------------------
-// wxDataViewProgressCell
+// wxDataViewProgressRenderer
// ---------------------------------------------------------
-class wxDataViewProgressCell: public wxDataViewCustomCell
+class wxDataViewProgressRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewProgressCell( const wxString &label = wxEmptyString,
- const wxString &varianttype = wxT("long"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
- virtual ~wxDataViewProgressCell();
+ wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
+ const wxString &varianttype = wxT("long"),
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+ virtual ~wxDataViewProgressRenderer();
bool SetValue( const wxVariant &value );
int m_value;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
};
// ---------------------------------------------------------
-// wxDataViewDateCell
+// wxDataViewDateRenderer
// ---------------------------------------------------------
-class wxDataViewDateCell: public wxDataViewCustomCell
+class wxDataViewDateRenderer: public wxDataViewCustomRenderer
{
public:
- wxDataViewDateCell( const wxString &varianttype = wxT("datetime"),
+ wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE );
bool SetValue( const wxVariant &value );
wxDateTime m_date;
protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateCell)
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
// ---------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewColumn: public wxDataViewColumnBase
{
public:
- wxDataViewColumn( const wxString &title, wxDataViewCell *cell, unsigned int model_column,
+ wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column,
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
virtual ~wxDataViewColumn();
};
// -------------------------------------
-// MyCustomCell
+// MyCustomRenderer
// -------------------------------------
-class MyCustomCell: public wxDataViewCustomCell
+class MyCustomRenderer: public wxDataViewCustomRenderer
{
public:
- MyCustomCell() :
- wxDataViewCustomCell( wxT("string"), wxDATAVIEW_CELL_ACTIVATABLE )
+ MyCustomRenderer() :
+ wxDataViewCustomRenderer( wxT("string"), wxDATAVIEW_CELL_ACTIVATABLE )
{
m_colour = wxT("black");
}
dataview_left->AppendTextColumn( wxT("first"), 0 );
dataview_left->AppendTextColumn( wxT("second"), 1 );
- wxDataViewTextCell *text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 2 );
+ wxDataViewTextRenderer *text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
+ wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_renderer, 2 );
dataview_left->AppendColumn( column );
dataview_left->AppendToggleColumn( wxT("fourth"), 3 );
- MyCustomCell *custom_cell = new MyCustomCell;
- column = new wxDataViewColumn( wxT("custom"), custom_cell, 4 );
+ MyCustomRenderer *custom_renderer = new MyCustomRenderer;
+ column = new wxDataViewColumn( wxT("custom"), custom_renderer, 4 );
dataview_left->AppendColumn( column );
dataview_left->AppendProgressColumn( wxT("progress"), 5 );
dataview_right = new wxDataViewCtrl( panel, wxID_ANY );
dataview_right->AssociateModel( model );
- text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- column = new wxDataViewColumn( wxT("editable"), text_cell, 2 );
+ text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
+ column = new wxDataViewColumn( wxT("editable"), text_renderer, 2 );
dataview_right->AppendColumn( column );
dataview_right->AppendTextColumn( wxT("first"), 0 );
dataview_right->AppendTextColumn( wxT("second"), 1 );
- wxDataViewToggleCell *toggle_cell = new wxDataViewToggleCell( wxT("bool"), wxDATAVIEW_CELL_ACTIVATABLE );
- column = new wxDataViewColumn( wxT("bool"), toggle_cell, 3, 30 );
+ wxDataViewToggleRenderer *toggle_renderer = new wxDataViewToggleRenderer( wxT("bool"), wxDATAVIEW_CELL_ACTIVATABLE );
+ column = new wxDataViewColumn( wxT("bool"), toggle_renderer, 3, 30 );
dataview_right->AppendColumn( column );
dataview_right->AppendDateColumn( wxT("date"), 6 );
m_unsorted_model = new MyUnsortedTextModel;
dataview_left->AssociateModel( m_unsorted_model );
- wxDataViewTextCell *text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 0 );
+ wxDataViewTextRenderer *text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
+ wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_renderer, 0 );
dataview_left->AppendColumn( column );
dataview_left->AppendTextColumn( wxT("second"), 1 );
- dataview_left->AppendColumn( new wxDataViewColumn( wxT("icon"), new wxDataViewBitmapCell, 2, 25 ) );
- dataview_left->AppendColumn( new wxDataViewColumn( wxT("icon"), new wxDataViewBitmapCell, 3, 25 ) );
+ dataview_left->AppendColumn( new wxDataViewColumn( wxT("icon"), new wxDataViewBitmapRenderer, 2, 25 ) );
+ dataview_left->AppendColumn( new wxDataViewColumn( wxT("icon"), new wxDataViewBitmapRenderer, 3, 25 ) );
// Right wxDataViewCtrl using the sorting model
dataview_right = new wxDataViewCtrl( this, ID_SORTED );
wxDataViewSortedListModel *sorted_model =
new wxDataViewSortedListModel( m_unsorted_model );
dataview_right->AssociateModel( sorted_model );
- text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- column = new wxDataViewColumn( wxT("editable"), text_cell, 0, -1, wxDATAVIEW_COL_SORTABLE|wxDATAVIEW_COL_RESIZABLE );
+ text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
+ column = new wxDataViewColumn( wxT("editable"), text_renderer, 0, -1, wxDATAVIEW_COL_SORTABLE|wxDATAVIEW_COL_RESIZABLE );
dataview_right->AppendColumn( column );
dataview_right->AppendTextColumn( wxT("second"), 1 );
}
// ---------------------------------------------------------
-// wxDataViewCellBase
+// wxDataViewRendererBase
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewCellBase, wxObject)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewRendererBase, wxObject)
-wxDataViewCellBase::wxDataViewCellBase( const wxString &varianttype, wxDataViewCellMode mode )
+wxDataViewRendererBase::wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode )
{
m_variantType = varianttype;
m_mode = mode;
IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
wxDataViewColumnBase::wxDataViewColumnBase(const wxString& title,
- wxDataViewCell *cell,
+ wxDataViewRenderer *renderer,
unsigned int model_column,
int WXUNUSED(width),
int flags )
{
- m_cell = cell;
+ m_renderer = renderer;
m_model_column = model_column;
m_flags = flags;
m_title = title;
m_owner = NULL;
- m_cell->SetOwner( (wxDataViewColumn*) this );
+ m_renderer->SetOwner( (wxDataViewColumn*) this );
}
wxDataViewColumnBase::~wxDataViewColumnBase()
{
- if (m_cell)
- delete m_cell;
+ if (m_renderer)
+ delete m_renderer;
if (GetOwner())
{
bool wxDataViewCtrlBase::AppendTextColumn( const wxString &label, unsigned int model_column )
{
- return AppendColumn( new wxDataViewColumn( label, new wxDataViewTextCell(), model_column ) );
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewTextRenderer(), model_column ) );
}
bool wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, unsigned int model_column )
{
- return AppendColumn( new wxDataViewColumn( label, new wxDataViewToggleCell(), model_column, 30 ) );
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewToggleRenderer(), model_column, 30 ) );
}
bool wxDataViewCtrlBase::AppendProgressColumn( const wxString &label, unsigned int model_column )
{
- return AppendColumn( new wxDataViewColumn( label, new wxDataViewProgressCell(), model_column, 70 ) );
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewProgressRenderer(), model_column, 70 ) );
}
bool wxDataViewCtrlBase::AppendDateColumn( const wxString &label, unsigned int model_column )
{
- return AppendColumn( new wxDataViewColumn( label, new wxDataViewDateCell(), model_column ) );
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewDateRenderer(), model_column ) );
}
bool wxDataViewCtrlBase::AppendColumn( wxDataViewColumn *col )
};
// ---------------------------------------------------------
-// wxDataViewCell
+// wxDataViewRenderer
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewCell, wxDataViewCellBase)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer, wxDataViewRendererBase)
-wxDataViewCell::wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCellBase( varianttype, mode )
+wxDataViewRenderer::wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewRendererBase( varianttype, mode )
{
m_dc = NULL;
}
-wxDataViewCell::~wxDataViewCell()
+wxDataViewRenderer::~wxDataViewRenderer()
{
if (m_dc)
delete m_dc;
}
-wxDC *wxDataViewCell::GetDC()
+wxDC *wxDataViewRenderer::GetDC()
{
if (m_dc == NULL)
{
}
// ---------------------------------------------------------
-// wxDataViewCustomCell
+// wxDataViewCustomRenderer
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomCell, wxDataViewCell)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomRenderer, wxDataViewRenderer)
-wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype,
+wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype,
wxDataViewCellMode mode ) :
- wxDataViewCell( varianttype, mode )
+ wxDataViewRenderer( varianttype, mode )
{
}
// ---------------------------------------------------------
-// wxDataViewTextCell
+// wxDataViewTextRenderer
// ---------------------------------------------------------
-IMPLEMENT_CLASS(wxDataViewTextCell, wxDataViewCustomCell)
+IMPLEMENT_CLASS(wxDataViewTextRenderer, wxDataViewCustomRenderer)
-wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+wxDataViewTextRenderer::wxDataViewTextRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewCustomRenderer( varianttype, mode )
{
}
-bool wxDataViewTextCell::SetValue( const wxVariant &value )
+bool wxDataViewTextRenderer::SetValue( const wxVariant &value )
{
m_text = value.GetString();
return true;
}
-bool wxDataViewTextCell::GetValue( wxVariant& WXUNUSED(value) )
+bool wxDataViewTextRenderer::GetValue( wxVariant& WXUNUSED(value) )
{
return false;
}
-bool wxDataViewTextCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
+bool wxDataViewTextRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
dc->DrawText( m_text, cell.x, cell.y );
return true;
}
-wxSize wxDataViewTextCell::GetSize()
+wxSize wxDataViewTextRenderer::GetSize()
{
return wxSize(80,20);
}
// ---------------------------------------------------------
-// wxDataViewBitmapCell
+// wxDataViewBitmapRenderer
// ---------------------------------------------------------
-IMPLEMENT_CLASS(wxDataViewBitmapCell, wxDataViewCustomCell)
+IMPLEMENT_CLASS(wxDataViewBitmapRenderer, wxDataViewCustomRenderer)
-wxDataViewBitmapCell::wxDataViewBitmapCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewCustomRenderer( varianttype, mode )
{
}
-bool wxDataViewBitmapCell::SetValue( const wxVariant &value )
+bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
{
if (value.GetType() == wxT("wxBitmap"))
m_bitmap << value;
return true;
}
-bool wxDataViewBitmapCell::GetValue( wxVariant& WXUNUSED(value) )
+bool wxDataViewBitmapRenderer::GetValue( wxVariant& WXUNUSED(value) )
{
return false;
}
-bool wxDataViewBitmapCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
+bool wxDataViewBitmapRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
if (m_bitmap.Ok())
dc->DrawBitmap( m_bitmap, cell.x, cell.y );
return true;
}
-wxSize wxDataViewBitmapCell::GetSize()
+wxSize wxDataViewBitmapRenderer::GetSize()
{
if (m_bitmap.Ok())
return wxSize( m_bitmap.GetWidth(), m_bitmap.GetHeight() );
}
// ---------------------------------------------------------
-// wxDataViewToggleCell
+// wxDataViewToggleRenderer
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleCell, wxDataViewCustomCell)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleRenderer, wxDataViewCustomRenderer)
-wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype,
+wxDataViewToggleRenderer::wxDataViewToggleRenderer( const wxString &varianttype,
wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+ wxDataViewCustomRenderer( varianttype, mode )
{
m_toggle = false;
}
-bool wxDataViewToggleCell::SetValue( const wxVariant &value )
+bool wxDataViewToggleRenderer::SetValue( const wxVariant &value )
{
m_toggle = value.GetBool();
return true;
}
-bool wxDataViewToggleCell::GetValue( wxVariant &WXUNUSED(value) )
+bool wxDataViewToggleRenderer::GetValue( wxVariant &WXUNUSED(value) )
{
return false;
}
-bool wxDataViewToggleCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
+bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
// User wxRenderer here
return true;
}
-bool wxDataViewToggleCell::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row )
+bool wxDataViewToggleRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row )
{
bool value = !m_toggle;
wxVariant variant = value;
return true;
}
-wxSize wxDataViewToggleCell::GetSize()
+wxSize wxDataViewToggleRenderer::GetSize()
{
return wxSize(20,20);
}
// ---------------------------------------------------------
-// wxDataViewProgressCell
+// wxDataViewProgressRenderer
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressCell, wxDataViewCustomCell)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressRenderer, wxDataViewCustomRenderer)
-wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label,
+wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label,
const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+ wxDataViewCustomRenderer( varianttype, mode )
{
m_label = label;
m_value = 0;
}
-wxDataViewProgressCell::~wxDataViewProgressCell()
+wxDataViewProgressRenderer::~wxDataViewProgressRenderer()
{
}
-bool wxDataViewProgressCell::SetValue( const wxVariant &value )
+bool wxDataViewProgressRenderer::SetValue( const wxVariant &value )
{
m_value = (long) value;
return true;
}
-bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
+bool wxDataViewProgressRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
double pct = (double)m_value / 100.0;
wxRect bar = cell;
return true;
}
-wxSize wxDataViewProgressCell::GetSize()
+wxSize wxDataViewProgressRenderer::GetSize()
{
return wxSize(40,12);
}
// ---------------------------------------------------------
-// wxDataViewDateCell
+// wxDataViewDateRenderer
// ---------------------------------------------------------
-class wxDataViewDateCellPopupTransient: public wxPopupTransientWindow
+class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow
{
public:
- wxDataViewDateCellPopupTransient( wxWindow* parent, wxDateTime *value,
+ wxDataViewDateRendererPopupTransient( wxWindow* parent, wxDateTime *value,
wxDataViewListModel *model, unsigned int col, unsigned int row ) :
wxPopupTransientWindow( parent, wxBORDER_SIMPLE )
{
DECLARE_EVENT_TABLE()
};
-BEGIN_EVENT_TABLE(wxDataViewDateCellPopupTransient,wxPopupTransientWindow)
- EVT_CALENDAR( wxID_ANY, wxDataViewDateCellPopupTransient::OnCalendar )
+BEGIN_EVENT_TABLE(wxDataViewDateRendererPopupTransient,wxPopupTransientWindow)
+ EVT_CALENDAR( wxID_ANY, wxDataViewDateRendererPopupTransient::OnCalendar )
END_EVENT_TABLE()
-void wxDataViewDateCellPopupTransient::OnCalendar( wxCalendarEvent &event )
+void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
{
wxDateTime date = event.GetDate();
wxVariant value = date;
DismissAndNotify();
}
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateCell, wxDataViewCustomCell)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer)
-wxDataViewDateCell::wxDataViewDateCell( const wxString &varianttype,
+wxDataViewDateRenderer::wxDataViewDateRenderer( const wxString &varianttype,
wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+ wxDataViewCustomRenderer( varianttype, mode )
{
}
-bool wxDataViewDateCell::SetValue( const wxVariant &value )
+bool wxDataViewDateRenderer::SetValue( const wxVariant &value )
{
m_date = value.GetDateTime();
return true;
}
-bool wxDataViewDateCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
+bool wxDataViewDateRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
dc->SetFont( GetOwner()->GetOwner()->GetFont() );
wxString tmp = m_date.FormatDate();
return true;
}
-wxSize wxDataViewDateCell::GetSize()
+wxSize wxDataViewDateRenderer::GetSize()
{
wxDataViewCtrl* view = GetOwner()->GetOwner();
wxString tmp = m_date.FormatDate();
return wxSize(x,y+d);
}
-bool wxDataViewDateCell::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row )
+bool wxDataViewDateRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row )
{
wxVariant variant;
model->GetValue( variant, col, row );
wxDateTime value = variant.GetDateTime();
- wxDataViewDateCellPopupTransient *popup = new wxDataViewDateCellPopupTransient(
+ wxDataViewDateRendererPopupTransient *popup = new wxDataViewDateRendererPopupTransient(
GetOwner()->GetOwner()->GetParent(), &value, model, col, row );
wxPoint pos = wxGetMousePosition();
popup->Move( pos );
IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
-wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, unsigned int model_column,
+wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell, unsigned int model_column,
int width, int flags ) :
wxDataViewColumnBase( title, cell, model_column, width, flags )
{
for (i = 0; i < cols; i++)
{
wxDataViewColumn *col = GetOwner()->GetColumn( i );
- wxDataViewCell *cell = col->GetCell();
+ wxDataViewRenderer *cell = col->GetRenderer();
cell_rect.width = col->GetWidth();
for (item = item_start; item < item_start+item_count; item++)
}
if (!col)
return;
- wxDataViewCell *cell = col->GetCell();
+ wxDataViewRenderer *cell = col->GetRenderer();
unsigned int current = y / m_lineHeight;
}
//-----------------------------------------------------------------------------
-// define new GTK+ class wxGtkCellRenderer
+// define new GTK+ class wxGtkRendererRenderer
//-----------------------------------------------------------------------------
extern "C" {
GtkCellRenderer parent;
/*< private >*/
- wxDataViewCustomCell *cell;
+ wxDataViewCustomRenderer *cell;
guint32 last_click;
};
gint *height)
{
GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
- wxDataViewCustomCell *cell = wxrenderer->cell;
+ wxDataViewCustomRenderer *cell = wxrenderer->cell;
wxSize size = cell->GetSize();
{
GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
- wxDataViewCustomCell *cell = wxrenderer->cell;
+ wxDataViewCustomRenderer *cell = wxrenderer->cell;
GdkRectangle rect;
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
GtkCellRendererState flags )
{
GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
- wxDataViewCustomCell *cell = wxrenderer->cell;
+ wxDataViewCustomRenderer *cell = wxrenderer->cell;
GdkRectangle rect;
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
}
// ---------------------------------------------------------
-// wxDataViewCell
+// wxDataViewRenderer
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewCell, wxDataViewCellBase)
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer, wxDataViewRendererBase)
-wxDataViewCell::wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCellBase( varianttype, mode )
+wxDataViewRenderer::wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewRendererBase( varianttype, mode )
{
m_renderer = NULL;
}
// ---------------------------------------------------------
-// wxDataViewTextCell
+// wxDataViewTextRenderer
// ---------------------------------------------------------
extern "C" {
static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer,
gchar *arg1, gchar *arg2, gpointer user_data )
{
- wxDataViewTextCell *cell = (wxDataViewTextCell*) user_data;
+ wxDataViewTextRenderer *cell = (wxDataViewTextRenderer*) user_data;
wxString tmp = wxGTK_CONV_BACK( arg2 );
wxVariant value = tmp;
model->ValueChanged( model_col, model_row );
}
-IMPLEMENT_CLASS(wxDataViewTextCell, wxDataViewCell)
+IMPLEMENT_CLASS(wxDataViewTextRenderer, wxDataViewRenderer)
-wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCell( varianttype, mode )
+wxDataViewTextRenderer::wxDataViewTextRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewRenderer( varianttype, mode )
{
m_renderer = (void*) gtk_cell_renderer_text_new();
}
}
-bool wxDataViewTextCell::SetValue( const wxVariant &value )
+bool wxDataViewTextRenderer::SetValue( const wxVariant &value )
{
wxString tmp = value;
return true;
}
-bool wxDataViewTextCell::GetValue( wxVariant &value )
+bool wxDataViewTextRenderer::GetValue( wxVariant &value )
{
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
}
// ---------------------------------------------------------
-// wxDataViewBitmapCell
+// wxDataViewBitmapRenderer
// ---------------------------------------------------------
-IMPLEMENT_CLASS(wxDataViewBitmapCell, wxDataViewCell)
+IMPLEMENT_CLASS(wxDataViewBitmapRenderer, wxDataViewRenderer)
-wxDataViewBitmapCell::wxDataViewBitmapCell( const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCell( varianttype, mode )
+wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype, wxDataViewCellMode mode ) :
+ wxDataViewRenderer( varianttype, mode )
{
m_renderer = (void*) gtk_cell_renderer_pixbuf_new();
}
-bool wxDataViewBitmapCell::SetValue( const wxVariant &value )
+bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
{
if (value.GetType() == wxT("wxBitmap"))
{
return false;
}
-bool wxDataViewBitmapCell::GetValue( wxVariant &value )
+bool wxDataViewBitmapRenderer::GetValue( wxVariant &value )
{
return false;
}
// ---------------------------------------------------------
-// wxDataViewToggleCell
+// wxDataViewToggleRenderer
// ---------------------------------------------------------
extern "C" {
static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer,
gchar *path, gpointer user_data )
{
- wxDataViewToggleCell *cell = (wxDataViewToggleCell*) user_data;
+ wxDataViewToggleRenderer *cell = (wxDataViewToggleRenderer*) user_data;
// get old value
GValue gvalue = { 0, };
model->ValueChanged( model_col, model_row );
}
-IMPLEMENT_CLASS(wxDataViewToggleCell, wxDataViewCell)
+IMPLEMENT_CLASS(wxDataViewToggleRenderer, wxDataViewRenderer)
-wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype,
+wxDataViewToggleRenderer::wxDataViewToggleRenderer( const wxString &varianttype,
wxDataViewCellMode mode ) :
- wxDataViewCell( varianttype, mode )
+ wxDataViewRenderer( varianttype, mode )
{
m_renderer = (void*) gtk_cell_renderer_toggle_new();
}
}
-bool wxDataViewToggleCell::SetValue( const wxVariant &value )
+bool wxDataViewToggleRenderer::SetValue( const wxVariant &value )
{
bool tmp = value;
return true;
}
-bool wxDataViewToggleCell::GetValue( wxVariant &value )
+bool wxDataViewToggleRenderer::GetValue( wxVariant &value )
{
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_BOOLEAN );
}
// ---------------------------------------------------------
-// wxDataViewCustomCell
+// wxDataViewCustomRenderer
// ---------------------------------------------------------
class wxDataViewCtrlDC: public wxWindowDC
};
// ---------------------------------------------------------
-// wxDataViewCustomCell
+// wxDataViewCustomRenderer
// ---------------------------------------------------------
-IMPLEMENT_CLASS(wxDataViewCustomCell, wxDataViewCell)
+IMPLEMENT_CLASS(wxDataViewCustomRenderer, wxDataViewRenderer)
-wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype,
+wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype,
wxDataViewCellMode mode, bool no_init ) :
- wxDataViewCell( varianttype, mode )
+ wxDataViewRenderer( varianttype, mode )
{
m_dc = NULL;
Init();
}
-bool wxDataViewCustomCell::Init()
+bool wxDataViewCustomRenderer::Init()
{
GtkWxCellRenderer *renderer = (GtkWxCellRenderer *) gtk_wx_cell_renderer_new();
renderer->cell = this;
return true;
}
-wxDataViewCustomCell::~wxDataViewCustomCell()
+wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
{
if (m_dc)
delete m_dc;
}
-wxDC *wxDataViewCustomCell::GetDC()
+wxDC *wxDataViewCustomRenderer::GetDC()
{
if (m_dc == NULL)
{
}
// ---------------------------------------------------------
-// wxDataViewProgressCell
+// wxDataViewProgressRenderer
// ---------------------------------------------------------
-IMPLEMENT_CLASS(wxDataViewProgressCell, wxDataViewCustomCell)
+IMPLEMENT_CLASS(wxDataViewProgressRenderer, wxDataViewCustomRenderer)
-wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label,
+wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label,
const wxString &varianttype, wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode, true )
+ wxDataViewCustomRenderer( varianttype, mode, true )
{
m_label = label;
m_value = 0;
#endif
{
// Use custom cell code
- wxDataViewCustomCell::Init();
+ wxDataViewCustomRenderer::Init();
}
}
-wxDataViewProgressCell::~wxDataViewProgressCell()
+wxDataViewProgressRenderer::~wxDataViewProgressRenderer()
{
}
-bool wxDataViewProgressCell::SetValue( const wxVariant &value )
+bool wxDataViewProgressRenderer::SetValue( const wxVariant &value )
{
#ifdef __WXGTK26__
if (!gtk_check_version(2,6,0))
return true;
}
-bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int state )
+bool wxDataViewProgressRenderer::Render( wxRect cell, wxDC *dc, int state )
{
double pct = (double)m_value / 100.0;
wxRect bar = cell;
return true;
}
-wxSize wxDataViewProgressCell::GetSize()
+wxSize wxDataViewProgressRenderer::GetSize()
{
return wxSize(40,12);
}
// ---------------------------------------------------------
-// wxDataViewDateCell
+// wxDataViewDateRenderer
// ---------------------------------------------------------
-class wxDataViewDateCellPopupTransient: public wxPopupTransientWindow
+class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow
{
public:
- wxDataViewDateCellPopupTransient( wxWindow* parent, wxDateTime *value,
+ wxDataViewDateRendererPopupTransient( wxWindow* parent, wxDateTime *value,
wxDataViewListModel *model, unsigned int col, unsigned int row ) :
wxPopupTransientWindow( parent, wxBORDER_SIMPLE )
{
DECLARE_EVENT_TABLE()
};
-BEGIN_EVENT_TABLE(wxDataViewDateCellPopupTransient,wxPopupTransientWindow)
- EVT_CALENDAR( -1, wxDataViewDateCellPopupTransient::OnCalendar )
+BEGIN_EVENT_TABLE(wxDataViewDateRendererPopupTransient,wxPopupTransientWindow)
+ EVT_CALENDAR( -1, wxDataViewDateRendererPopupTransient::OnCalendar )
END_EVENT_TABLE()
-void wxDataViewDateCellPopupTransient::OnCalendar( wxCalendarEvent &event )
+void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
{
wxDateTime date = event.GetDate();
wxVariant value = date;
DismissAndNotify();
}
-IMPLEMENT_CLASS(wxDataViewDateCell, wxDataViewCustomCell)
+IMPLEMENT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer)
-wxDataViewDateCell::wxDataViewDateCell( const wxString &varianttype,
+wxDataViewDateRenderer::wxDataViewDateRenderer( const wxString &varianttype,
wxDataViewCellMode mode ) :
- wxDataViewCustomCell( varianttype, mode )
+ wxDataViewCustomRenderer( varianttype, mode )
{
}
-bool wxDataViewDateCell::SetValue( const wxVariant &value )
+bool wxDataViewDateRenderer::SetValue( const wxVariant &value )
{
m_date = value.GetDateTime();
return true;
}
-bool wxDataViewDateCell::Render( wxRect cell, wxDC *dc, int state )
+bool wxDataViewDateRenderer::Render( wxRect cell, wxDC *dc, int state )
{
dc->SetFont( GetOwner()->GetOwner()->GetFont() );
wxString tmp = m_date.FormatDate();
return true;
}
-wxSize wxDataViewDateCell::GetSize()
+wxSize wxDataViewDateRenderer::GetSize()
{
wxDataViewCtrl* view = GetOwner()->GetOwner();
wxString tmp = m_date.FormatDate();
return wxSize(x,y+d);
}
-bool wxDataViewDateCell::Activate( wxRect cell, wxDataViewListModel *model, unsigned int col, unsigned int row )
+bool wxDataViewDateRenderer::Activate( wxRect cell, wxDataViewListModel *model, unsigned int col, unsigned int row )
{
wxVariant variant;
model->GetValue( variant, col, row );
wxDateTime value = variant.GetDateTime();
- wxDataViewDateCellPopupTransient *popup = new wxDataViewDateCellPopupTransient(
+ wxDataViewDateRendererPopupTransient *popup = new wxDataViewDateRendererPopupTransient(
GetOwner()->GetOwner()->GetParent(), &value, model, col, row );
wxPoint pos = wxGetMousePosition();
popup->Move( pos );
g_return_if_fail (GTK_IS_WX_LIST_STORE (model));
GtkWxListStore *list_store = (GtkWxListStore *) model;
- wxDataViewCell *cell = (wxDataViewCell*) data;
+ wxDataViewRenderer *cell = (wxDataViewRenderer*) data;
unsigned int model_row = (unsigned int) iter->user_data;
IMPLEMENT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
-wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, unsigned int model_column,
+wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell, unsigned int model_column,
int width, int flags ) :
wxDataViewColumnBase( title, cell, model_column, width, flags )
{