| Version: 3.1.5

Public Types | Public Member Functions | List of all members
wxPGCellRenderer Class Referenceabstract
Class List by Category » wxPropertyGrid

`#include </home/Hamis/wxwidgets-3.1/wxWidgets3.1-3.1.5-1.i686/src/wxWidgets-3.1.5/interface/wx/propgrid/property.h>`

Inheritance diagram for wxPGCellRenderer:
[legend]

## Detailed Description

Base class for wxPropertyGrid cell renderers.

##

Library: wxPropertyGrid

<>< =''>:</>&;&;< =''>\ </></>

## Public Types
enum | { Selected , ChoicePopup , Control , Disabled , DontUseCellFgCol , DontUseCellBgCol , DontUseCellColours }
| More...

## 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). More...
virtual wxSize | GetImageSize (const wxPGProperty *property, int column, int item) const
| Returns size of the image in front of the editable area. More...
virtual void | DrawCaptionSelectionRect (wxDC &dc, int x, int y, int w, int h) const
| Paints property category selection rectangle. More...
void | DrawText (wxDC &dc, const wxRect &rect, int imageWidth, const wxString &text) const
| Utility to draw vertically centered text. More...
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. More...
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. More...
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. More...

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

Flags for Render(), PreDrawCell() and PostDrawCell().

Enumerator
Selected | We are painting selected item.
ChoicePopup | We are painting item in choice popup.
Control | We are rendering wxOwnerDrawnComboBox control or other owner drawn control, but that is only officially supported one ATM).
Disabled | We are painting a disable property.
DontUseCellFgCol | We are painting selected, disabled, or similar item that dictates fore- and background colours, overriding any cell values.
DontUseCellBgCol |
DontUseCellColours |

## Constructor & Destructor Documentation

## ◆ wxPGCellRenderer()

wxPGCellRenderer::wxPGCellRenderer | ( |  | ) |

## ◆ ~wxPGCellRenderer()

virtual wxPGCellRenderer::~wxPGCellRenderer | ( |  | ) |
| virtual

## 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

  dc | wxDC which was used to paint on.
  propGrid | Property grid to which the cell belongs.
  cell | Cell information.
  flags | Same as those passed to PreDrawCell(). See list of render flags.

## ◆ 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.

Parameters

  dc | wxDC to paint on.
  rect | Box reserved for drawing.
  cell | Cell information.
  flags | See list of render flags.

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).

Parameters

  dc | wxDC to paint on.
  rect | Box reserved for drawing.
  propertyGrid | Property grid in which property is displayed.
  property | Property to be rendered.
  column | Property cell column.
  item | Index of chosen item if combo popup is drawn, -1 otherwise.
  flags | See list of render flags.

Implemented in wxPGDefaultRenderer.