Package wx :: Class RendererNative

[frames | no frames]

## Type RendererNative

    object --+
             |
            RendererNative

One of the design principles of wxWidgets is to use the native widgets on every platform in order to be as close as possible to the native look and feel on every platform. However there are still cases when some generic widgets are needed for various reasons, but it can sometimes take a lot of messy work to make them conform to the native LnF.

The wx.RendererNative class is a collection of functions that have platform-specific implementations for drawing certain parts of genereic controls in ways that are as close to the native look as possible.

Note that each drawing function restores the `wx.DC` attributes if it changes them, so it is safe to assume that the same pen, brush and colours that were active before the call to this function are still in effect after it.

Method Summary
| `__init__(self)`
| ``DrawCheckBox`(self, win, dc, rect, flags)` Draw a check button.
| ``DrawComboBoxDropButton`(self, win, dc, rect, flags)` Draw a button like the one used by `wx.ComboBox` to show a drop down window.
| ``DrawDropArrow`(self, win, dc, rect, flags)` Draw a drop down arrow that is suitable for use outside a combo box.
int | ``DrawHeaderButton`(self, win, dc, rect, flags, sortArrow, params)` Draw a header control button (such as what is used by `wx.ListCtrl` in report mode.) The optimal size of the label (text and icons) is returned.
int | ``DrawHeaderButtonContents`(self, win, dc, rect, flags, sortArrow, params)` Draw the contents of a header control button, (label, sort arrows, etc.) Normally this is only called by `DrawHeaderButton`.
| ``DrawItemSelectionRect`(self, win, dc, rect, flags)` Draw rectangle indicating that an item in e.g.
| ``DrawPushButton`(self, win, dc, rect, flags)` Draw a blank button.
| ``DrawSplitterBorder`(self, win, dc, rect, flags)` Draw the border for a sash window: this border must be such that the sash drawn by `DrawSplitterSash` blends into it well.
| ``DrawSplitterSash`(self, win, dc, size, position, orient, flags)` Draw a sash.
| ``DrawTreeItemButton`(self, win, dc, rect, flags)` Draw the expanded/collapsed icon for a tree control item.
RendererNative | ``Get`()` Return the currently used renderer (Static method)
RendererNative | ``GetDefault`()` Return the default (native) implementation for this platform -- this is also the one used by default but this may be changed by calling `wx.RendererNative.Set` in which case the return value of this method may be different from the return value of `wx.RendererNative.Get`. (Static method)
RendererNative | ``GetGeneric`()` Return the generic implementation of the renderer. (Static method)
int | ``GetHeaderButtonHeight`(self, win)` Returns the default height of a header button, either a fixed platform height if available, or a generic height based on the window's font.
SplitterRenderParams | ``GetSplitterParams`(self, win)` Get the splitter parameters, see `wx.SplitterRenderParams`.
RendererVersion | ``GetVersion`(self)` Returns the version of the renderer.
RendererNative | ``Set`(renderer)` Set the renderer to use, passing None reverts to using the default renderer. (Static method)

Property Summary
| `SplitterParams`: See `GetSplitterParams`
| `thisown`: The membership flag
| `Version`: See `GetVersion`

Instance Method Details

### DrawCheckBox(self, win, dc, rect, flags=0)

Draw a check button. Flags may use wx.CONTROL_CHECKED, wx.CONTROL_UNDETERMINED and wx.CONTROL_CURRENT.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawComboBoxDropButton(self, win, dc, rect, flags=0)

Draw a button like the one used by `wx.ComboBox` to show a drop down window. The usual appearance is a downwards pointing arrow.

The `flags` parameter may have the `wx.CONTROL_PRESSED` or `wx.CONTROL_CURRENT` bits set.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawDropArrow(self, win, dc, rect, flags=0)

Draw a drop down arrow that is suitable for use outside a combo box. Arrow will have a transparent background.

`rect` is not entirely filled by the arrow. Instead, you should use bounding rectangle of a drop down button which arrow matches the size you need. `flags` may have the `wx.CONTROL_PRESSED` or `wx.CONTROL_CURRENT` bit set.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawHeaderButton(self, win, dc, rect, flags=0, sortArrow=HDR_SORT_ICON_NONE, params=None)

Draw a header control button (such as what is used by `wx.ListCtrl` in report mode.) The optimal size of the label (text and icons) is returned.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

    `sortArrow`
    (type=int)

    `params`
    (type=HeaderButtonParams)

  Returns:
    int

### DrawHeaderButtonContents(self, win, dc, rect, flags=0, sortArrow=HDR_SORT_ICON_NONE, params=None)

Draw the contents of a header control button, (label, sort arrows, etc.) Normally this is only called by `DrawHeaderButton`.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

    `sortArrow`
    (type=int)

    `params`
    (type=HeaderButtonParams)

  Returns:
    int

### DrawItemSelectionRect(self, win, dc, rect, flags=0)

Draw rectangle indicating that an item in e.g. a list control has been selected or focused

The flags parameter may be:

> wx.CONTROL_SELECTED | item is selected, e.g. draw background
> wx.CONTROL_CURRENT | item is the current item, e.g. dotted border
> wx.CONTROL_FOCUSED | the whole control has focus, e.g. blue background vs. grey otherwise

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawPushButton(self, win, dc, rect, flags=0)

Draw a blank button. Flags may be wx.CONTROL_PRESSED, wx.CONTROL_CURRENT and wx.CONTROL_ISDEFAULT

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawSplitterBorder(self, win, dc, rect, flags=0)

Draw the border for a sash window: this border must be such that the sash drawn by `DrawSplitterSash` blends into it well.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### DrawSplitterSash(self, win, dc, size, position, orient, flags=0)

Draw a sash. The orient parameter defines whether the sash should be vertical or horizontal and how the position should be interpreted.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `size`
    (type=Size)

    `position`
    (type=int)

    `orient`
    (type=int)

    `flags`
    (type=int)

### DrawTreeItemButton(self, win, dc, rect, flags=0)

Draw the expanded/collapsed icon for a tree control item.

  Parameters:
    `win`
    (type=Window)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

    `flags`
    (type=int)

### GetHeaderButtonHeight(self, win)

Returns the default height of a header button, either a fixed platform height if available, or a generic height based on the window's font.

  Parameters:
    `win`
    (type=Window)

  Returns:
    int

### GetSplitterParams(self, win)

Get the splitter parameters, see `wx.SplitterRenderParams`.

  Parameters:
    `win`
    (type=Window)

  Returns:
    SplitterRenderParams

### GetVersion(self)

Returns the version of the renderer. Will be used for ensuring compatibility of dynamically loaded renderers.

  Returns:
    RendererVersion

Static Method Details

### Get()

Return the currently used renderer

  Returns:
    RendererNative

### GetDefault()

Return the default (native) implementation for this platform -- this is also the one used by default but this may be changed by calling `wx.RendererNative.Set` in which case the return value of this method may be different from the return value of `wx.RendererNative.Get`.

  Returns:
    RendererNative

### GetGeneric()

Return the generic implementation of the renderer. Under some platforms, this is the default renderer implementation, others have platform-specific default renderer which can be retrieved by calling `wx.RendererNative.GetDefault`.

  Returns:
    RendererNative

### Set(renderer)

Set the renderer to use, passing None reverts to using the default renderer. Returns the previous renderer used with Set or None.

  Parameters:
    `renderer`
    (type=RendererNative)

  Returns:
    RendererNative

Property Details

### SplitterParams

See `GetSplitterParams`

  Get Method:
    `GetSplitterParams`(self, win)

### thisown

The membership flag

### Version

See `GetVersion`

  Get Method:
    `GetVersion`(self)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:10 2007 | http://epydoc.sf.net