Allow relaxing the check for variant type in wxDataViewRenderer
Instead of checking for the exact variant type match, call the new IsCompatibleVariantType() virtual function, which still does the same check by default, but can be overridden to allow other types as well if they're accepted by the renderer. This will be soon used to allow accepting both wxBitmap (which must still be accepted for compatibility) and wxBitmapBundle (which is the simplest way to support high DPI) in wxDataViewBitmapRenderer at once.
This commit is contained in:
@@ -2064,6 +2064,19 @@ public:
|
||||
*/
|
||||
wxString GetVariantType() const;
|
||||
|
||||
/**
|
||||
Check if the given variant type is compatible with the type expected by
|
||||
this renderer.
|
||||
|
||||
The base class implementation just compares @a variantType with the
|
||||
value returned by GetVariantType(), but this function can be overridden
|
||||
to accept other types that can be converted to the type needed by the
|
||||
renderer.
|
||||
|
||||
@since 3.1.7
|
||||
*/
|
||||
virtual bool IsCompatibleVariantType(const wxString& variantType) const;
|
||||
|
||||
/**
|
||||
Sets the alignment of the renderer's content.
|
||||
The default value of @c wxDVR_DEFAULT_ALIGNMENT indicates that the content
|
||||
|
||||
Reference in New Issue
Block a user