Renamed wxDataViewCell to wxDataViewRenderer since the

class just renders the cell, it doesn't represent one.
    Maybe wxDataViewCellRenderer would be best...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-10-03 15:24:03 +00:00
parent c6dfeb4192
commit baa9ebc473
7 changed files with 248 additions and 248 deletions

View File

@@ -24,7 +24,7 @@
#if defined(__WXGTK20__)
// for testing
// #define wxUSE_GENERICDATAVIEWCTRL 1
#define wxUSE_GENERICDATAVIEWCTRL 1
#elif defined(__WXMAC__)
#define wxUSE_GENERICDATAVIEWCTRL 1
#else
@@ -43,7 +43,7 @@ class WXDLLIMPEXP_ADV wxDataViewModel;
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[];
@@ -200,7 +200,7 @@ protected:
};
// ---------------------------------------------------------
// wxDataViewCellBase
// wxDataViewRendererBase
// ---------------------------------------------------------
enum wxDataViewCellMode
@@ -218,10 +218,10 @@ enum wxDataViewCellRenderState
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; }
@@ -239,7 +239,7 @@ protected:
wxDataViewColumn *m_owner;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCellBase)
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
};
// ---------------------------------------------------------
@@ -256,16 +256,16 @@ enum wxDataViewColumnFlags
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; }
@@ -274,7 +274,7 @@ public:
private:
wxDataViewCtrl *m_ctrl;
wxDataViewCell *m_cell;
wxDataViewRenderer *m_renderer;
int m_model_column;
int m_flags;
wxString m_title;

View File

@@ -26,14 +26,14 @@ class WXDLLIMPEXP_ADV wxDataViewMainWindow;
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;
@@ -70,32 +70,32 @@ private:
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 );
@@ -107,18 +107,18 @@ private:
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 );
@@ -131,18 +131,18 @@ private:
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 );
@@ -155,20 +155,20 @@ private:
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 );
@@ -180,18 +180,18 @@ private:
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 );
@@ -204,7 +204,7 @@ private:
wxDateTime m_date;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateCell)
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
// ---------------------------------------------------------
@@ -214,7 +214,7 @@ protected:
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();

View File

@@ -22,13 +22,13 @@
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; }
@@ -38,71 +38,71 @@ protected:
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"),
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(wxDataViewBitmapRenderer)
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
class wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
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(wxDataViewBitmapCell)
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
};
// ---------------------------------------------------------
// wxDataViewToggleCell
// wxDataViewCustomRenderer
// ---------------------------------------------------------
class wxDataViewToggleCell: public wxDataViewCell
class wxDataViewCustomRenderer: public wxDataViewRenderer
{
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,
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;
@@ -129,20 +129,20 @@ private:
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 );
@@ -154,17 +154,17 @@ private:
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 );
@@ -178,7 +178,7 @@ private:
wxDateTime m_date;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateCell)
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
// ---------------------------------------------------------
@@ -188,7 +188,7 @@ protected:
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();

View File

@@ -133,14 +133,14 @@ public:
};
// -------------------------------------
// 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");
}
@@ -401,14 +401,14 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
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 );
@@ -419,13 +419,13 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
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 );
@@ -494,12 +494,12 @@ MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int
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 );
@@ -507,8 +507,8 @@ MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int
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 );

View File

@@ -676,12 +676,12 @@ bool wxDataViewSortedListModel::Cleared()
}
// ---------------------------------------------------------
// 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;
@@ -694,23 +694,23 @@ wxDataViewCellBase::wxDataViewCellBase( const wxString &varianttype, wxDataViewC
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())
{
@@ -758,22 +758,22 @@ wxDataViewListModel* wxDataViewCtrlBase::GetModel()
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 )

View File

@@ -252,24 +252,24 @@ public:
};
// ---------------------------------------------------------
// 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)
{
@@ -284,64 +284,64 @@ wxDC *wxDataViewCell::GetDC()
}
// ---------------------------------------------------------
// 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;
@@ -351,12 +351,12 @@ bool wxDataViewBitmapCell::SetValue( const wxVariant &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 );
@@ -366,7 +366,7 @@ bool wxDataViewBitmapCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
return true;
}
wxSize wxDataViewBitmapCell::GetSize()
wxSize wxDataViewBitmapRenderer::GetSize()
{
if (m_bitmap.Ok())
return wxSize( m_bitmap.GetWidth(), m_bitmap.GetHeight() );
@@ -377,31 +377,31 @@ wxSize wxDataViewBitmapCell::GetSize()
}
// ---------------------------------------------------------
// 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
@@ -426,7 +426,7 @@ bool wxDataViewToggleCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
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;
@@ -435,30 +435,30 @@ bool wxDataViewToggleCell::Activate( wxRect WXUNUSED(cell), wxDataViewListModel
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;
@@ -468,7 +468,7 @@ bool wxDataViewProgressCell::SetValue( const wxVariant &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;
@@ -484,19 +484,19 @@ bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state)
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 )
{
@@ -526,11 +526,11 @@ private:
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;
@@ -539,22 +539,22 @@ void wxDataViewDateCellPopupTransient::OnCalendar( wxCalendarEvent &event )
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();
@@ -563,7 +563,7 @@ bool wxDataViewDateCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
return true;
}
wxSize wxDataViewDateCell::GetSize()
wxSize wxDataViewDateRenderer::GetSize()
{
wxDataViewCtrl* view = GetOwner()->GetOwner();
wxString tmp = m_date.FormatDate();
@@ -572,13 +572,13 @@ wxSize wxDataViewDateCell::GetSize()
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 );
@@ -594,7 +594,7 @@ bool wxDataViewDateCell::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *m
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 )
{
@@ -1115,7 +1115,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
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++)
@@ -1475,7 +1475,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
}
if (!col)
return;
wxDataViewCell *cell = col->GetCell();
wxDataViewRenderer *cell = col->GetRenderer();
unsigned int current = y / m_lineHeight;

View File

@@ -429,7 +429,7 @@ wxgtk_list_store_iter_parent (GtkTreeModel *tree_model,
}
//-----------------------------------------------------------------------------
// define new GTK+ class wxGtkCellRenderer
// define new GTK+ class wxGtkRendererRenderer
//-----------------------------------------------------------------------------
extern "C" {
@@ -451,7 +451,7 @@ struct _GtkWxCellRenderer
GtkCellRenderer parent;
/*< private >*/
wxDataViewCustomCell *cell;
wxDataViewCustomRenderer *cell;
guint32 last_click;
};
@@ -569,7 +569,7 @@ gtk_wx_cell_renderer_get_size (GtkCellRenderer *renderer,
gint *height)
{
GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
wxDataViewCustomCell *cell = wxrenderer->cell;
wxDataViewCustomRenderer *cell = wxrenderer->cell;
wxSize size = cell->GetSize();
@@ -615,7 +615,7 @@ gtk_wx_cell_renderer_render (GtkCellRenderer *renderer,
{
GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
wxDataViewCustomCell *cell = wxrenderer->cell;
wxDataViewCustomRenderer *cell = wxrenderer->cell;
GdkRectangle rect;
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
@@ -666,7 +666,7 @@ gtk_wx_cell_renderer_activate(
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,
@@ -879,19 +879,19 @@ bool wxGtkDataViewListModelNotifier::Cleared()
}
// ---------------------------------------------------------
// 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" {
@@ -902,7 +902,7 @@ static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer,
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;
@@ -921,10 +921,10 @@ static void wxGtkTextRendererEditedCallback( GtkCellRendererText *renderer,
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();
@@ -940,7 +940,7 @@ wxDataViewTextCell::wxDataViewTextCell( const wxString &varianttype, wxDataViewC
}
}
bool wxDataViewTextCell::SetValue( const wxVariant &value )
bool wxDataViewTextRenderer::SetValue( const wxVariant &value )
{
wxString tmp = value;
@@ -953,7 +953,7 @@ bool wxDataViewTextCell::SetValue( const wxVariant &value )
return true;
}
bool wxDataViewTextCell::GetValue( wxVariant &value )
bool wxDataViewTextRenderer::GetValue( wxVariant &value )
{
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
@@ -967,18 +967,18 @@ bool wxDataViewTextCell::GetValue( wxVariant &value )
}
// ---------------------------------------------------------
// 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"))
{
@@ -1019,13 +1019,13 @@ bool wxDataViewBitmapCell::SetValue( const wxVariant &value )
return false;
}
bool wxDataViewBitmapCell::GetValue( wxVariant &value )
bool wxDataViewBitmapRenderer::GetValue( wxVariant &value )
{
return false;
}
// ---------------------------------------------------------
// wxDataViewToggleCell
// wxDataViewToggleRenderer
// ---------------------------------------------------------
extern "C" {
@@ -1036,7 +1036,7 @@ static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer,
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, };
@@ -1063,11 +1063,11 @@ static void wxGtkToggleRendererToggledCallback( GtkCellRendererToggle *renderer,
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();
@@ -1093,7 +1093,7 @@ wxDataViewToggleCell::wxDataViewToggleCell( const wxString &varianttype,
}
}
bool wxDataViewToggleCell::SetValue( const wxVariant &value )
bool wxDataViewToggleRenderer::SetValue( const wxVariant &value )
{
bool tmp = value;
@@ -1106,7 +1106,7 @@ bool wxDataViewToggleCell::SetValue( const wxVariant &value )
return true;
}
bool wxDataViewToggleCell::GetValue( wxVariant &value )
bool wxDataViewToggleRenderer::GetValue( wxVariant &value )
{
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_BOOLEAN );
@@ -1120,7 +1120,7 @@ bool wxDataViewToggleCell::GetValue( wxVariant &value )
}
// ---------------------------------------------------------
// wxDataViewCustomCell
// wxDataViewCustomRenderer
// ---------------------------------------------------------
class wxDataViewCtrlDC: public wxWindowDC
@@ -1145,14 +1145,14 @@ public:
};
// ---------------------------------------------------------
// 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;
@@ -1162,7 +1162,7 @@ wxDataViewCustomCell::wxDataViewCustomCell( const wxString &varianttype,
Init();
}
bool wxDataViewCustomCell::Init()
bool wxDataViewCustomRenderer::Init()
{
GtkWxCellRenderer *renderer = (GtkWxCellRenderer *) gtk_wx_cell_renderer_new();
renderer->cell = this;
@@ -1181,13 +1181,13 @@ bool wxDataViewCustomCell::Init()
return true;
}
wxDataViewCustomCell::~wxDataViewCustomCell()
wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
{
if (m_dc)
delete m_dc;
}
wxDC *wxDataViewCustomCell::GetDC()
wxDC *wxDataViewCustomRenderer::GetDC()
{
if (m_dc == NULL)
{
@@ -1202,14 +1202,14 @@ wxDC *wxDataViewCustomCell::GetDC()
}
// ---------------------------------------------------------
// 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;
@@ -1229,15 +1229,15 @@ wxDataViewProgressCell::wxDataViewProgressCell( const wxString &label,
#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))
@@ -1261,7 +1261,7 @@ bool wxDataViewProgressCell::SetValue( const wxVariant &value )
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;
@@ -1277,19 +1277,19 @@ bool wxDataViewProgressCell::Render( wxRect cell, wxDC *dc, int state )
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 )
{
@@ -1318,11 +1318,11 @@ private:
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;
@@ -1331,22 +1331,22 @@ void wxDataViewDateCellPopupTransient::OnCalendar( wxCalendarEvent &event )
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();
@@ -1355,7 +1355,7 @@ bool wxDataViewDateCell::Render( wxRect cell, wxDC *dc, int state )
return true;
}
wxSize wxDataViewDateCell::GetSize()
wxSize wxDataViewDateRenderer::GetSize()
{
wxDataViewCtrl* view = GetOwner()->GetOwner();
wxString tmp = m_date.FormatDate();
@@ -1364,13 +1364,13 @@ wxSize wxDataViewDateCell::GetSize()
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 );
@@ -1402,7 +1402,7 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column,
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;
@@ -1419,7 +1419,7 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column,
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 )
{