]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/dvrenderer.h
Rename web library to webview.
[wxWidgets.git] / include / wx / generic / dvrenderer.h
CommitLineData
6eec70b9
VZ
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)
b1153ed6 6// RCS-ID: $Id$
6eec70b9
VZ
7// Copyright: (c) 2006 Robert Roebling
8// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_DVRENDERER_H_
13#define _WX_GENERIC_DVRENDERER_H_
14
15// ----------------------------------------------------------------------------
16// wxDataViewRenderer
17// ----------------------------------------------------------------------------
18
19class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewCustomRendererBase
20{
21public:
22 wxDataViewRenderer( const wxString &varianttype,
23 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
24 int align = wxDVR_DEFAULT_ALIGNMENT );
25 virtual ~wxDataViewRenderer();
26
6eec70b9
VZ
27 virtual wxDC *GetDC();
28
6eec70b9
VZ
29 virtual void SetAlignment( int align );
30 virtual int GetAlignment() const;
31
32 virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE)
33 { m_ellipsizeMode = mode; }
34 virtual wxEllipsizeMode GetEllipsizeMode() const
35 { return m_ellipsizeMode; }
36
37 virtual void SetMode( wxDataViewCellMode mode )
38 { m_mode = mode; }
39 virtual wxDataViewCellMode GetMode() const
40 { return m_mode; }
41
42 // implementation
6eec70b9 43
dbc3aec1
VS
44 // These callbacks are used by generic implementation of wxDVC itself.
45 // They're different from the corresponding Activate/LeftClick() methods
46 // which should only be overridable for the custom renderers while the
47 // generic implementation uses these ones for all of them, including the
48 // standard ones.
49
548fa9c1 50 virtual bool WXOnActivate(const wxRect& WXUNUSED(cell),
dbc3aec1
VS
51 wxDataViewModel *WXUNUSED(model),
52 const wxDataViewItem & WXUNUSED(item),
62186006 53 unsigned int WXUNUSED(col))
dbc3aec1
VS
54 { return false; }
55
548fa9c1
VS
56 virtual bool WXOnLeftClick(const wxPoint& WXUNUSED(cursor),
57 const wxRect& WXUNUSED(cell),
dbc3aec1
VS
58 wxDataViewModel *WXUNUSED(model),
59 const wxDataViewItem & WXUNUSED(item),
60 unsigned int WXUNUSED(col) )
61 { return false; }
62186006 62
6eec70b9
VZ
63private:
64 int m_align;
65 wxDataViewCellMode m_mode;
66
67 wxEllipsizeMode m_ellipsizeMode;
68
69 wxDC *m_dc;
70
71 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
72};
73
74#endif // _WX_GENERIC_DVRENDERER_H_
75