1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/dvrenderer.h
3 // Purpose: wxDataViewRenderer for generic wxDataViewCtrl implementation
4 // Author: Robert Roebling, Vadim Zeitlin
5 // Created: 2009-11-07 (extracted from wx/generic/dataview.h)
7 // Copyright: (c) 2006 Robert Roebling
8 // (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_DVRENDERER_H_
13 #define _WX_GENERIC_DVRENDERER_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_ADV wxDataViewRenderer
: public wxDataViewCustomRendererBase
22 wxDataViewRenderer( const wxString
&varianttype
,
23 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
24 int align
= wxDVR_DEFAULT_ALIGNMENT
);
25 virtual ~wxDataViewRenderer();
27 virtual wxDC
*GetDC();
29 virtual void SetAlignment( int align
);
30 virtual int GetAlignment() const;
32 virtual void EnableEllipsize(wxEllipsizeMode mode
= wxELLIPSIZE_MIDDLE
)
33 { m_ellipsizeMode
= mode
; }
34 virtual wxEllipsizeMode
GetEllipsizeMode() const
35 { return m_ellipsizeMode
; }
37 virtual void SetMode( wxDataViewCellMode mode
)
39 virtual wxDataViewCellMode
GetMode() const
44 // This callback is used by generic implementation of wxDVC itself. It's
45 // different from the corresponding ActivateCell() method which should only
46 // be overridable for the custom renderers while the generic implementation
47 // uses this one for all of them, including the standard ones.
49 virtual bool WXActivateCell(const wxRect
& WXUNUSED(cell
),
50 wxDataViewModel
*WXUNUSED(model
),
51 const wxDataViewItem
& WXUNUSED(item
),
52 unsigned int WXUNUSED(col
),
53 const wxMouseEvent
* WXUNUSED(mouseEvent
))
58 wxDataViewCellMode m_mode
;
60 wxEllipsizeMode m_ellipsizeMode
;
64 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer
)
67 #endif // _WX_GENERIC_DVRENDERER_H_