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)
6 // Copyright: (c) 2006 Robert Roebling
7 // (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_DVRENDERER_H_
12 #define _WX_GENERIC_DVRENDERER_H_
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_ADV wxDataViewRenderer
: public wxDataViewCustomRendererBase
21 wxDataViewRenderer( const wxString
&varianttype
,
22 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
23 int align
= wxDVR_DEFAULT_ALIGNMENT
);
24 virtual ~wxDataViewRenderer();
26 virtual wxDC
*GetDC();
28 virtual void SetAlignment( int align
);
29 virtual int GetAlignment() const;
31 virtual void EnableEllipsize(wxEllipsizeMode mode
= wxELLIPSIZE_MIDDLE
)
32 { m_ellipsizeMode
= mode
; }
33 virtual wxEllipsizeMode
GetEllipsizeMode() const
34 { return m_ellipsizeMode
; }
36 virtual void SetMode( wxDataViewCellMode mode
)
38 virtual wxDataViewCellMode
GetMode() const
43 // This callback is used by generic implementation of wxDVC itself. It's
44 // different from the corresponding ActivateCell() method which should only
45 // be overridable for the custom renderers while the generic implementation
46 // uses this one for all of them, including the standard ones.
48 virtual bool WXActivateCell(const wxRect
& WXUNUSED(cell
),
49 wxDataViewModel
*WXUNUSED(model
),
50 const wxDataViewItem
& WXUNUSED(item
),
51 unsigned int WXUNUSED(col
),
52 const wxMouseEvent
* WXUNUSED(mouseEvent
))
57 wxDataViewCellMode m_mode
;
59 wxEllipsizeMode m_ellipsizeMode
;
63 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer
)
66 #endif // _WX_GENERIC_DVRENDERER_H_