.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.propgrid.PGCellRenderer:
==========================================================================================================================================
|phoenix_title| **wx.propgrid.PGCellRenderer**
==========================================================================================================================================
Base class for :ref:`wx.propgrid.PropertyGrid` cell renderers.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
PGCellRenderer:
|
|sub_classes| Known Subclasses
==============================
:ref:`wx.propgrid.PGDefaultRenderer`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.propgrid.PGCellRenderer.__init__`
:meth:`~wx.propgrid.PGCellRenderer.DrawCaptionSelectionRect` Paints property category selection rectangle.
:meth:`~wx.propgrid.PGCellRenderer.DrawEditorValue` Utility to draw editor's value, or vertically aligned text if editor is ``None``.
:meth:`~wx.propgrid.PGCellRenderer.DrawText` Utility to draw vertically centered text.
:meth:`~wx.propgrid.PGCellRenderer.GetImageSize` Returns size of the image in front of the editable area.
:meth:`~wx.propgrid.PGCellRenderer.PostDrawCell` Utility to be called after drawing is done, to revert whatever changes :meth:`~PGCellRenderer.PreDrawCell` did.
:meth:`~wx.propgrid.PGCellRenderer.PreDrawCell` Utility to render cell bitmap and set text colour plus bg brush colour.
:meth:`~wx.propgrid.PGCellRenderer.Render` Returns ``True`` if rendered something in the foreground (text or bitmap).
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.propgrid.PGCellRenderer(RefCounter)
**Possible constructors**::
PGCellRenderer() -> None
Base class for PropertyGrid cell renderers.
.. method:: __init__(self)
:rtype: `None`
.. method:: DrawCaptionSelectionRect(self, dc : DC, x : int, y : int, w : int, h : int)
Paints property category selection rectangle.
:param `dc`:
:type `dc`: wx.DC
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `w`:
:type `w`: int
:param `h`:
:type `h`: int
:rtype: `None`
.. method:: DrawEditorValue(self, dc : DC, rect : Rect, xOffset : int, text : str, property : PGProperty, editor : PGEditor)
Utility to draw editor's value, or vertically aligned text if editor is ``None``.
:param `dc`:
:type `dc`: wx.DC
:param `rect`:
:type `rect`: wx.Rect
:param `xOffset`:
:type `xOffset`: int
:param `text`:
:type `text`: string
:param `property`:
:type `property`: wx.propgrid.PGProperty
:param `editor`:
:type `editor`: wx.propgrid.PGEditor
:rtype: `None`
.. method:: DrawText(self, dc : DC, rect : Rect, imageWidth : int, text : str)
Utility to draw vertically centered text.
:param `dc`:
:type `dc`: wx.DC
:param `rect`:
:type `rect`: wx.Rect
:param `imageWidth`:
:type `imageWidth`: int
:param `text`:
:type `text`: string
:rtype: `None`
.. method:: GetImageSize(self, property : PGProperty, column : int, item : int)
Returns size of the image in front of the editable area.
:param `property`:
:type `property`: wx.propgrid.PGProperty
:param `column`:
:type `column`: int
:param `item`:
:type `item`: int
:rtype: `Size`
.. note::
If property is ``None``, then this call is for a custom value. In that case the item is index to :ref:`wx.propgrid.PropertyGrid`'s custom values.
.. method:: PostDrawCell(self, dc : DC, propGrid : PropertyGrid, cell : PGCell, flags : int)
Utility to be called after drawing is done, to revert whatever changes :meth:`PreDrawCell` did.
:param `dc`: :ref:`wx.DC` which was used to paint on.
:type `dc`: wx.DC
:param `propGrid`: Property grid to which the cell belongs.
:type `propGrid`: wx.propgrid.PropertyGrid
:param `cell`: Cell information.
:type `cell`: wx.propgrid.PGCell
:param `flags`: Same as those passed to :meth:`PreDrawCell` . See :ref:`list of render flags `.
:type `flags`: int
:rtype: `None`
.. method:: PreDrawCell(self, dc : DC, rect : Rect, propGrid : PropertyGrid, cell : PGCell, flags : int)
Utility to render cell bitmap and set text colour plus bg brush colour.
:param `dc`: :ref:`wx.DC` to paint on.
:type `dc`: wx.DC
:param `rect`: Box reserved for drawing.
:type `rect`: wx.Rect
:param `propGrid`: Property grid to which the cell belongs.
:type `propGrid`: wx.propgrid.PropertyGrid
:param `cell`: Cell information.
:type `cell`: wx.propgrid.PGCell
:param `flags`: See :ref:`list of render flags `.
:type `flags`: int
:rtype: `int`
:returns:
Returns image width, which, for instance, can be passed to :meth:`DrawText` .
.. method:: Render(self, dc : DC, rect : Rect, propertyGrid : PropertyGrid, property : PGProperty, column : int, item : int, flags : int)
Returns ``True`` if rendered something in the foreground (text or bitmap).
:param `dc`: :ref:`wx.DC` to paint on.
:type `dc`: wx.DC
:param `rect`: Box reserved for drawing.
:type `rect`: wx.Rect
:param `propertyGrid`: Property grid in which property is displayed.
:type `propertyGrid`: wx.propgrid.PropertyGrid
:param `property`: Property to be rendered.
:type `property`: wx.propgrid.PGProperty
:param `column`: Property cell column.
:type `column`: int
:param `item`: Index of chosen item if combo popup is drawn, -1 otherwise.
:type `item`: int
:param `flags`: See :ref:`list of render flags `.
:type `flags`: int
:rtype: `bool`