Version: 3.0.5
Loading...
Searching...
No Matches
wxPGCellRenderer Class Referenceabstract

#include <wx/propgrid/property.h>

+ Inheritance diagram for wxPGCellRenderer:

Detailed Description

Base class for wxPropertyGrid cell renderers.

Public Types

enum  {
  Selected = 0x00010000 ,
  ChoicePopup = 0x00020000 ,
  Control = 0x00040000 ,
  Disabled = 0x00080000 ,
  DontUseCellFgCol = 0x00100000 ,
  DontUseCellBgCol = 0x00200000 ,
  DontUseCellColours
}
 

Public Member Functions

 wxPGCellRenderer ()
 
virtual ~wxPGCellRenderer ()
 
virtual bool Render (wxDC &dc, const wxRect &rect, const wxPropertyGrid *propertyGrid, wxPGProperty *property, int column, int item, int flags) const =0
 Returns true if rendered something in the foreground (text or bitmap.
 
virtual wxSize GetImageSize (const wxPGProperty *property, int column, int item) const
 Returns size of the image in front of the editable area.
 
virtual void DrawCaptionSelectionRect (wxDC &dc, int x, int y, int w, int h) const
 Paints property category selection rectangle.
 
void DrawText (wxDC &dc, const wxRect &rect, int imageWidth, const wxString &text) const
 Utility to draw vertically centered text.
 
void DrawEditorValue (wxDC &dc, const wxRect &rect, int xOffset, const wxString &text, wxPGProperty *property, const wxPGEditor *editor) const
 Utility to draw editor's value, or vertically aligned text if editor is NULL.
 
int PreDrawCell (wxDC &dc, const wxRect &rect, const wxPGCell &cell, int flags) const
 Utility to render cell bitmap and set text colour plus bg brush colour.
 
void PostDrawCell (wxDC &dc, const wxPropertyGrid *propGrid, const wxPGCell &cell, int flags) const
 Utility to be called after drawing is done, to revert whatever changes PreDrawCell() did.
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Selected 
ChoicePopup 
Control 
Disabled 
DontUseCellFgCol 
DontUseCellBgCol 
DontUseCellColours 

Constructor & Destructor Documentation

◆ wxPGCellRenderer()

wxPGCellRenderer::wxPGCellRenderer ( )
inline

◆ ~wxPGCellRenderer()

virtual wxPGCellRenderer::~wxPGCellRenderer ( )
inlinevirtual

Member Function Documentation

◆ DrawCaptionSelectionRect()

virtual void wxPGCellRenderer::DrawCaptionSelectionRect ( wxDC dc,
int  x,
int  y,
int  w,
int  h 
) const
virtual

Paints property category selection rectangle.

◆ DrawEditorValue()

void wxPGCellRenderer::DrawEditorValue ( wxDC dc,
const wxRect rect,
int  xOffset,
const wxString text,
wxPGProperty property,
const wxPGEditor editor 
) const

Utility to draw editor's value, or vertically aligned text if editor is NULL.

◆ DrawText()

void wxPGCellRenderer::DrawText ( wxDC dc,
const wxRect rect,
int  imageWidth,
const wxString text 
) const

Utility to draw vertically centered text.

◆ GetImageSize()

virtual wxSize wxPGCellRenderer::GetImageSize ( const wxPGProperty property,
int  column,
int  item 
) const
virtual

Returns size of the image in front of the editable area.

Remarks
If property is NULL, then this call is for a custom value. In that case the item is index to wxPropertyGrid's custom values.

Reimplemented in wxPGDefaultRenderer.

◆ PostDrawCell()

void wxPGCellRenderer::PostDrawCell ( wxDC dc,
const wxPropertyGrid *  propGrid,
const wxPGCell cell,
int  flags 
) const

Utility to be called after drawing is done, to revert whatever changes PreDrawCell() did.

Parameters
flagsSame as those passed to PreDrawCell().

◆ PreDrawCell()

int wxPGCellRenderer::PreDrawCell ( wxDC dc,
const wxRect rect,
const wxPGCell cell,
int  flags 
) const

Utility to render cell bitmap and set text colour plus bg brush colour.

Returns
Returns image width, which, for instance, can be passed to DrawText.

◆ Render()

virtual bool wxPGCellRenderer::Render ( wxDC dc,
const wxRect rect,
const wxPropertyGrid *  propertyGrid,
wxPGProperty property,
int  column,
int  item,
int  flags 
) const
pure virtual

Returns true if rendered something in the foreground (text or bitmap.

Implemented in wxPGDefaultRenderer.