Add GetDefaultType() to all standard wxDataViewRenderer-derived classes.
This makes it possible to refer to the associated wxVariant types without hard coding the string constants, i.e. instead of writing "string" (error prone as typos are not detected) it is now possible to write wxDataViewTextRenderer:: GetDefaultType(). This will also make it simpler to write generic (in C++ templates sense) code using renderers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,7 +25,9 @@
|
||||
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewTextRenderer( const wxString &varianttype = "string",
|
||||
static wxString GetDefaultType() { return wxS("string"); }
|
||||
|
||||
wxDataViewTextRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
@@ -68,7 +70,9 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewBitmapRenderer( const wxString &varianttype = "wxBitmap",
|
||||
static wxString GetDefaultType() { return wxS("wxBitmap"); }
|
||||
|
||||
wxDataViewBitmapRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
@@ -86,7 +90,9 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewToggleRenderer( const wxString &varianttype = "bool",
|
||||
static wxString GetDefaultType() { return wxS("bool"); }
|
||||
|
||||
wxDataViewToggleRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
@@ -104,7 +110,9 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewCustomRendererBase
|
||||
{
|
||||
public:
|
||||
wxDataViewCustomRenderer( const wxString &varianttype = "string",
|
||||
static wxString GetDefaultType() { return wxS("string"); }
|
||||
|
||||
wxDataViewCustomRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT,
|
||||
bool no_init = false );
|
||||
@@ -166,8 +174,10 @@ private:
|
||||
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewCustomRenderer
|
||||
{
|
||||
public:
|
||||
static wxString GetDefaultType() { return wxS("long"); }
|
||||
|
||||
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
|
||||
const wxString &varianttype = "long",
|
||||
const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
virtual ~wxDataViewProgressRenderer();
|
||||
@@ -201,7 +211,9 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewTextRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewIconTextRenderer( const wxString &varianttype = "wxDataViewIconText",
|
||||
static wxString GetDefaultType() { return wxS("wxDataViewIconText"); }
|
||||
|
||||
wxDataViewIconTextRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
virtual ~wxDataViewIconTextRenderer();
|
||||
|
Reference in New Issue
Block a user