The wxPython version of this method accepts a Python list of wxPoint
objects.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
*/
void DrawLines(int n, wxPoint points[], wxCoord xoffset = 0,
wxCoord yoffset = 0);
The wxPython version of this method accepts a Python list of wxPoint
objects.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ The wxPerl version of this method accepts
+ as its first parameter a reference to an array
+ of wxPoint objects.
+ @endWxPerlOnly
*/
void DrawLines(const wxPointList* points,
wxCoord xoffset = 0, wxCoord yoffset = 0);
The current pen is used for drawing the outline, and the current brush
for filling the shape. Using a transparent brush suppresses filling.
+
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
*/
void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0,
wxCoord yoffset = 0,
The wxPython version of this method accepts a Python list of wxPoint
objects.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ The wxPerl version of this method accepts
+ as its first parameter a reference to an array
+ of wxPoint objects.
+ @endWxPerlOnly
*/
void DrawPolygon(const wxPointList* points,
wxCoord xoffset = 0, wxCoord yoffset = 0,
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
/**
- Draws the text rotated by @a angle degrees.
+ Draws the text rotated by @a angle degrees
+ (positive angles are counterclockwise; the full angle is 360 degrees).
@note Under Win9x only TrueType fonts can be drawn by this function. In
particular, a font different from @c wxNORMAL_FONT should be used
The wxPython version of this method accepts a Python list of wxPoint
objects.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
*/
void DrawSpline(int n, wxPoint points[]);
/**
@overload
+
+
+ @beginWxPerlOnly
+ The wxPerl version of this method accepts
+ as its first parameter a reference to an array
+ of wxPoint objects.
+ @endWxPerlOnly
*/
void DrawSpline(const wxPointList* points);
/**
@overload
+
+
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
*/
void DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord x3, wxCoord y3);
/**
Sets the clipping region for this device context to the intersection of
the given region described by the parameters of this method and the
- previously set clipping region. You should call DestroyClippingRegion()
- if you want to set the clipping region exactly to the region specified.
+ previously set clipping region.
The clipping region is an area to which drawing is restricted. Possible
uses for the clipping region are for clipping text or for speeding up
window redraws when only a known area of the screen is damaged.
+ Notice that you need to call DestroyClippingRegion() if you want to set
+ the clipping region exactly to the region specified.
+
+ Also note that if the clipping region is empty, any previously set
+ clipping region is destroyed, i.e. it is equivalent to calling
+ DestroyClippingRegion(), and not to clipping out all drawing on the DC
+ as might be expected.
+
@see DestroyClippingRegion(), wxRegion
*/
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
@note This function works with both single-line and multi-line strings.
+ @beginWxPerlOnly
+ In wxPerl this method is implemented as
+ GetMultiLineTextExtent(string, font = undef) returning a
+ 3-element list (width, height, line_height)
+ @endWxPerlOnly
+
@see wxFont, SetFont(), GetPartialTextExtents(), GetTextExtent()
*/
void GetMultiLineTextExtent(const wxString& string, wxCoord* w,
@note This function works with both single-line and multi-line strings.
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
+
@see wxFont, SetFont(), GetPartialTextExtents(), GetTextExtent()
*/
wxSize GetMultiLineTextExtent(const wxString& string) const;
of integers.
@endWxPythonOnly
+ @beginWxPerlOnly
+ In wxPerl this method only takes the @a text parameter and
+ returns the widths as a list of integers.
+ @endWxPerlOnly
+
@see GetMultiLineTextExtent(), GetTextExtent()
*/
bool GetPartialTextExtents(const wxString& text,
Returns a 4-tuple, (width, height, descent, externalLeading).
@endWxPythonOnly
+ @beginWxPerlOnly
+ In wxPerl this method is implemented as GetTextExtent(string,
+ font = undef) returning a 4-element list (width, height,
+ descent, externalLeading)
+ @endWxPerlOnly
+
@see wxFont, SetFont(), GetPartialTextExtents(),
GetMultiLineTextExtent()
*/
/**
@overload
+
+
+ @beginWxPerlOnly
+ Not supported by wxPerl.
+ @endWxPerlOnly
*/
wxSize GetTextExtent(const wxString& string) const;
int GetBackgroundMode() const;
/**
- Gets the current font. Notice that even although each device context
- object has some default font after creation, this method would return a
- ::wxNullFont initially and only after calling SetFont() a valid font is
- returned.
+ Gets the current font.
+
+ Notice that even although each device context object has some default font
+ after creation, this method would return a ::wxNullFont initially and only
+ after calling SetFont() a valid font is returned.
*/
const wxFont& GetFont() const;
const wxColour& GetTextForeground() const;
/**
- @a mode may be one of wxSOLID and wxTRANSPARENT. This setting
- determines whether text will be drawn with a background colour or not.
+ @a mode may be one of @c wxSOLID and @c wxTRANSPARENT.
+
+ This setting determines whether text will be drawn with a background
+ colour or not.
*/
void SetBackgroundMode(int mode);
/**
- Sets the current font for the DC. It must be a valid font, in
- particular you should not pass wxNullFont to this method.
+ Sets the current font for the DC.
+
+ If the argument is ::wxNullFont (or another invalid font; see wxFont::IsOk),
+ the current font is selected out of the device context (leaving wxDC without
+ any valid font), allowing the current font to be destroyed safely.
@see wxFont
*/
void SetTextForeground(const wxColour& colour);
/**
- Sets the current layout direction for the device context. @a dir may be
- either @c wxLayout_Default, @c wxLayout_LeftToRight or
- @c wxLayout_RightToLeft.
+ Sets the current layout direction for the device context.
+
+ @param dir
+ May be either @c wxLayout_Default, @c wxLayout_LeftToRight or
+ @c wxLayout_RightToLeft.
@see GetLayoutDirection()
*/
/**
Sets the current brush for the DC.
- If the argument is wxNullBrush, the current brush is selected out of
- the device context (leaving wxDC without any valid brush), allowing the
- current brush to be destroyed safely.
+ If the argument is ::wxNullBrush (or another invalid brush; see wxBrush::IsOk),
+ the current brush is selected out of the device context (leaving wxDC without
+ any valid brush), allowing the current brush to be destroyed safely.
@see wxBrush, wxMemoryDC (for the interpretation of colours when
drawing into a monochrome bitmap)
void SetBrush(const wxBrush& brush);
/**
- Sets the current pen for the DC. If the argument is wxNullPen, the
- current pen is selected out of the device context (leaving wxDC without
- any valid pen), allowing the current brush to be destroyed safely.
+ Sets the current pen for the DC.
+
+ If the argument is ::wxNullPen (or another invalid pen; see wxPen::IsOk),
+ the current pen is selected out of the device context (leaving wxDC without any
+ valid pen), allowing the current pen to be destroyed safely.
@see wxMemoryDC for the interpretation of colours when drawing into a
monochrome bitmap.
//@}
+ /**
+ Copy attributes from another DC.
+
+ The copied attributes currently are:
+ - Font
+ - Text foreground and background colours
+ - Background brush
+ - Layout direction
+
+ @param dc
+ A valid (i.e. its IsOk() must return @true) source device context.
+ */
+ void CopyAttributes(const wxDC& dc);
/**
Returns the depth (number of bits/pixel) of this DC.
- GetSize() - Returns a wxSize.
- GetSizeWH() - Returns a 2-tuple (width, height).
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ In wxPerl there are two methods instead of a single overloaded
+ method:
+ - GetSize(): returns a Wx::Size object.
+ - GetSizeWH(): returns a 2-element list (width, height).
+ @endWxPerlOnly
*/
void GetSize(wxCoord* width, wxCoord* height) const;
/**
Gets the current user scale factor.
+ @beginWxPerlOnly
+ In wxPerl this method takes no arguments and return a two
+ element array (x, y).
+ @endWxPerlOnly
+
@see SetUserScale()
*/
void GetUserScale(double* x, double* y) const;
class wxDCTextColourChanger
{
public:
+ /**
+ Trivial constructor not changing anything.
+
+ This constructor is useful if you don't know beforehand if the colour
+ needs to be changed or not. It simply creates the object which won't do
+ anything in its destructor unless Set() is called -- in which case it
+ would reset the previous colour.
+ */
+ wxDCTextColourChanger(wxDC& dc);
+
/**
Sets @a col on the given @a dc, storing the old one.
*/
wxDCTextColourChanger(wxDC& dc, const wxColour& col);
+ /**
+ Set the colour to use.
+
+ This method is meant to be called once only and only on the objects
+ created with the constructor overload not taking wxColour argument and
+ has the same effect as the other constructor, i.e. sets the colour to
+ the given @a col and ensures that the old value is restored when this
+ object is destroyed.
+ */
+ void Set(const wxColour& col);
+
/**
Restores the colour originally selected in the DC passed to the ctor.
*/
class wxDCFontChanger
{
public:
+ /**
+ Trivial constructor not changing anything.
+
+ This constructor is useful if you don't know beforehand if the font
+ needs to be changed or not. It simply creates the object which won't do
+ anything in its destructor unless Set() is called -- in which case it
+ would reset the previous font.
+
+ @since 2.9.1
+ */
+ wxDCFontChanger(wxDC& dc);
+
/**
Sets @a font on the given @a dc, storing the old one.
wxDCFontChanger(wxDC& dc, const wxFont& font);
/**
- Restores the colour originally selected in the DC passed to the ctor.
+ Set the font to use.
+
+ This method is meant to be called once only and only on the objects
+ created with the constructor overload not taking wxColour argument and
+ has the same effect as the other constructor, i.e. sets the font to
+ the given @a font and ensures that the old value is restored when this
+ object is destroyed.
+ */
+ void Set(const wxFont& font);
+
+ /**
+ Restores the font originally selected in the DC passed to the ctor.
*/
~wxDCFontChanger();
};