2009-11-10 12:40:58 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/generic/dvrenderer.h
|
|
|
|
// Purpose: wxDataViewRenderer for generic wxDataViewCtrl implementation
|
|
|
|
// Author: Robert Roebling, Vadim Zeitlin
|
|
|
|
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
|
|
|
|
// Copyright: (c) 2006 Robert Roebling
|
|
|
|
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GENERIC_DVRENDERER_H_
|
|
|
|
#define _WX_GENERIC_DVRENDERER_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDataViewRenderer
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewCustomRendererBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxDataViewRenderer( const wxString &varianttype,
|
|
|
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
|
|
|
int align = wxDVR_DEFAULT_ALIGNMENT );
|
|
|
|
virtual ~wxDataViewRenderer();
|
|
|
|
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual wxDC *GetDC() wxOVERRIDE;
|
2009-11-10 12:40:58 -05:00
|
|
|
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual void SetAlignment( int align ) wxOVERRIDE;
|
|
|
|
virtual int GetAlignment() const wxOVERRIDE;
|
2009-11-10 12:40:58 -05:00
|
|
|
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE) wxOVERRIDE
|
2009-11-10 12:40:58 -05:00
|
|
|
{ m_ellipsizeMode = mode; }
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual wxEllipsizeMode GetEllipsizeMode() const wxOVERRIDE
|
2009-11-10 12:40:58 -05:00
|
|
|
{ return m_ellipsizeMode; }
|
|
|
|
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual void SetMode( wxDataViewCellMode mode ) wxOVERRIDE
|
2009-11-10 12:40:58 -05:00
|
|
|
{ m_mode = mode; }
|
2016-09-25 16:21:28 -04:00
|
|
|
virtual wxDataViewCellMode GetMode() const wxOVERRIDE
|
2009-11-10 12:40:58 -05:00
|
|
|
{ return m_mode; }
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
2011-10-19 12:20:17 -04:00
|
|
|
// This callback is used by generic implementation of wxDVC itself. It's
|
|
|
|
// different from the corresponding ActivateCell() method which should only
|
|
|
|
// be overridable for the custom renderers while the generic implementation
|
|
|
|
// uses this one for all of them, including the standard ones.
|
|
|
|
|
|
|
|
virtual bool WXActivateCell(const wxRect& WXUNUSED(cell),
|
|
|
|
wxDataViewModel *WXUNUSED(model),
|
|
|
|
const wxDataViewItem & WXUNUSED(item),
|
|
|
|
unsigned int WXUNUSED(col),
|
|
|
|
const wxMouseEvent* WXUNUSED(mouseEvent))
|
2011-02-28 16:23:04 -05:00
|
|
|
{ return false; }
|
2010-06-20 13:43:30 -04:00
|
|
|
|
2016-11-21 12:07:32 -05:00
|
|
|
void SetState(int state) { m_state = state; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool IsHighlighted() const wxOVERRIDE
|
|
|
|
{ return m_state & wxDATAVIEW_CELL_SELECTED; }
|
|
|
|
|
2009-11-10 12:40:58 -05:00
|
|
|
private:
|
|
|
|
int m_align;
|
|
|
|
wxDataViewCellMode m_mode;
|
|
|
|
|
|
|
|
wxEllipsizeMode m_ellipsizeMode;
|
|
|
|
|
|
|
|
wxDC *m_dc;
|
|
|
|
|
2016-11-21 12:07:32 -05:00
|
|
|
int m_state;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer);
|
2009-11-10 12:40:58 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GENERIC_DVRENDERER_H_
|
|
|
|
|