~wxDC();
- DocDeclStr(
- virtual void , BeginDrawing(),
- "Allows for optimization of drawing code on platforms that need it. On
-other platforms this is just an empty function and is harmless. To
-take advantage of this postential optimization simply enclose each
-group of calls to the drawing primitives within calls to
-`BeginDrawing` and `EndDrawing`.", "");
-
- DocDeclStr(
- virtual void , EndDrawing(),
- "Ends the group of drawing primitives started with `BeginDrawing`, and
-invokes whatever optimization is available for this DC type on the
-current platform.", "");
+ %pythoncode {
+ %# These have been deprecated in wxWidgets. Since they never
+ %# really did anything to begin with, just make them be NOPs.
+ def BeginDrawing(self): pass
+ def EndDrawing(self): pass
+ }
-
+
// TODO virtual void DrawObject(wxDrawObject* drawobject);
find colour borders if the pixels do not match the colour
exactly. However the function will still return true.", "");
bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE);
- %name(FloodFillPoint) bool FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE);
+ %Rename(FloodFillPoint, bool, FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE));
+
+ // fill the area specified by rect with a radial gradient, starting from
+ // initialColour in the centre of the cercle and fading to destColour.
+
+ DocDeclStr(
+ void , GradientFillConcentric(const wxRect& rect,
+ const wxColour& initialColour,
+ const wxColour& destColour,
+ const wxPoint& circleCenter),
+ "Fill the area specified by rect with a radial gradient, starting from
+initialColour in the center of the circle and fading to destColour on
+the outside of the circle. The circleCenter argument is the relative
+coordinants of the center of the circle in the specified rect.
+
+Note: Currently this function is very slow, don't use it for real-time
+drawing.", "");
+
+ DocDeclStr(
+ void , GradientFillLinear(const wxRect& rect,
+ const wxColour& initialColour,
+ const wxColour& destColour,
+ wxDirection nDirection = wxEAST),
+ "Fill the area specified by rect with a linear gradient, starting from
+initialColour and eventually fading to destColour. The nDirection
+parameter specifies the direction of the colour change, default is to
+use initialColour on the left part of the rectangle and destColour on
+the right side.", "");
+
+
DocStr(
GetPixel,
the line and is not drawn by this function (this is consistent with
the behaviour of many other toolkits).", "");
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
- %name(DrawLinePoint) void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
+ %Rename(DrawLinePoint, void, DrawLine(const wxPoint& pt1, const wxPoint& pt2));
DocStr(
horizontal line the height and width of the window, centred on the
given point.", "");
void CrossHair(wxCoord x, wxCoord y);
- %name(CrossHairPoint) void CrossHair(const wxPoint& pt);
+ %Rename(CrossHairPoint, void, CrossHair(const wxPoint& pt));
DocStr(
The arc is drawn in an anticlockwise direction from the start point to
the end point.", "");
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc);
- %name(DrawArcPoint) void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& center);
+ %Rename(DrawArcPoint, void, DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& center));
DocStr(
DrawCheckMark,
"Draws a check mark inside the given rectangle.", "");
void DrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- %name(DrawCheckMarkRect) void DrawCheckMark(const wxRect& rect);
+ %Rename(DrawCheckMarkRect, void, DrawCheckMark(const wxRect& rect));
DocStr(
DrawEllipticArc,
circle). Positive values mean counter-clockwise motion. If start is
equal to end, a complete ellipse will be drawn.", "");
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double start, double end);
- %name(DrawEllipticArcPointSize) void DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double start, double end);
+ %Rename(DrawEllipticArcPointSize, void, DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double start, double end));
DocStr(
DrawPoint,
"Draws a point using the current pen.", "");
void DrawPoint(wxCoord x, wxCoord y);
- %name(DrawPointPoint) void DrawPoint(const wxPoint& pt);
+ %Rename(DrawPointPoint, void, DrawPoint(const wxPoint& pt));
DocStr(
size. The current pen is used for the outline and the current brush
for filling the shape.", "");
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- %name(DrawRectangleRect)void DrawRectangle(const wxRect& rect);
- %name(DrawRectanglePointSize) void DrawRectangle(const wxPoint& pt, const wxSize& sz);
+ %Rename(DrawRectangleRect,void, DrawRectangle(const wxRect& rect));
+ %Rename(DrawRectanglePointSize, void, DrawRectangle(const wxPoint& pt, const wxSize& sz));
DocStr(
the rectangle, and also avoids the strange effects X produces when the
corners are too big for the rectangle.", "");
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius);
- %name(DrawRoundedRectangleRect) void DrawRoundedRectangle(const wxRect& r, double radius);
- %name(DrawRoundedRectanglePointSize) void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius);
+ %Rename(DrawRoundedRectangleRect, void, DrawRoundedRectangle(const wxRect& r, double radius));
+ %Rename(DrawRoundedRectanglePointSize, void, DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius));
DocStr(
:see: `DrawEllipse`");
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
- %name(DrawCirclePoint) void DrawCircle(const wxPoint& pt, wxCoord radius);
+ %Rename(DrawCirclePoint, void, DrawCircle(const wxPoint& pt, wxCoord radius));
DocStr(
:see: `DrawCircle`");
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- %name(DrawEllipseRect) void DrawEllipse(const wxRect& rect);
- %name(DrawEllipsePointSize) void DrawEllipse(const wxPoint& pt, const wxSize& sz);
+ %Rename(DrawEllipseRect, void, DrawEllipse(const wxRect& rect));
+ %Rename(DrawEllipsePointSize, void, DrawEllipse(const wxPoint& pt, const wxSize& sz));
DocStr(
PostScript). This can be the simplest way of drawing bitmaps on a
window.", "");
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
- %name(DrawIconPoint) void DrawIcon(const wxIcon& icon, const wxPoint& pt);
+ %Rename(DrawIconPoint, void, DrawIcon(const wxIcon& icon, const wxPoint& pt));
DocStr(
:see: `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`");
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false);
- %name(DrawBitmapPoint) void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = false);
+ %Rename(DrawBitmapPoint, void, DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = false));
DocStr(
:see: `DrawRotatedText`");
void DrawText(const wxString& text, wxCoord x, wxCoord y);
- %name(DrawTextPoint) void DrawText(const wxString& text, const wxPoint& pt);
+ %Rename(DrawTextPoint, void, DrawText(const wxString& text, const wxPoint& pt));
DocStr(
:see: `DrawText`");
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
- %name(DrawRotatedTextPoint) void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle);
+ %Rename(DrawRotatedTextPoint, void, DrawRotatedText(const wxString& text, const wxPoint& pt, double angle));
DocDeclStr(
:see: `DestroyClippingRegion`, `wx.Region`");
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
- %name(SetClippingRegionPointSize) void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
- %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);
- %name(SetClippingRect) void SetClippingRegion(const wxRect& rect);
+ %Rename(SetClippingRegionPointSize, void, SetClippingRegion(const wxPoint& pt, const wxSize& sz));
+ %Rename(SetClippingRegionAsRegion, void, SetClippingRegion(const wxRegion& region));
+ %Rename(SetClippingRect, void, SetClippingRegion(const wxRect& rect));
*text*. The generic version simply builds a running total of the widths
of each character using GetTextExtent, however if the various
platforms have a native API function that is faster or more accurate
-than the generic implementaiton then it will be used instead.", "");
+than the generic implementation then it will be used instead.", "");
wxArrayInt GetPartialTextExtents(const wxString& text) {
wxArrayInt widths;
self->GetPartialTextExtents(text, widths);
DocDeclStr(
virtual wxSize , GetPPI() const,
- "Resolution in Pixels per inch", "");
+ "Resolution in pixels per inch", "");
DocDeclStr(
#include <wx/dcbuffer.h>
%}
+enum {
+ wxBUFFER_VIRTUAL_AREA,
+ wxBUFFER_CLIENT_AREA
+};
MustHaveApp(wxBufferedDC);
public:
%pythonAppend wxBufferedDC
"self.__dc = args[0] # save a ref so the other dc will not be deleted before self";
+
%nokwargs wxBufferedDC;
DocStr(
as the bitmap doesn't have to be recreated each time but it
also requires more memory as the bitmap is never freed. The
bitmap should have appropriate size, anything drawn outside of
- its bounds is clipped.
-");
- wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
- wxBufferedDC( wxDC *dc, const wxSize &area );
-
+ its bounds is clipped. If wx.NullBitmap is used then a new
+ buffer will be allocated that is the same size as the dc.
-
-// // TODO: Keep this one too?
-// %pythonAppend wxBufferedDC( wxDC *dc, const wxSize &area )
-// "val.__dc = args[0] # save a ref so the other dc will not be deleted before self";
-// %name(BufferedDCInternalBuffer) wxBufferedDC( wxDC *dc, const wxSize &area );
+ :param style: The style parameter indicates whether the supplied buffer is
+ intended to cover the entire virtual size of a `wx.ScrolledWindow` or
+ if it only covers the client area. Acceptable values are
+ ``wx.BUFFER_VIRTUAL_AREA`` and ``wx.BUFFER_CLIENT_AREA``.
+
+");
+ wxBufferedDC( wxDC* dc,
+ const wxBitmap& buffer=wxNullBitmap,
+ int style = wxBUFFER_CLIENT_AREA );
+ wxBufferedDC( wxDC* dc,
+ const wxSize& area,
+ int style = wxBUFFER_CLIENT_AREA );
-
- // The buffer is blit to the real DC when the BufferedDC is destroyed.
DocCtorStr(
~wxBufferedDC(),
"Copies everything drawn on the DC so far to the underlying DC
associated with this object, if any.", "");
-
+
DocDeclStr(
void , UnMask(),
"Blits the buffer to the dc, and detaches the dc from the buffer (so it
dc = wx.BufferedPaintDC(self, self.buffer)
+
+
", "");
class wxBufferedPaintDC : public wxBufferedDC
public:
DocCtorStr(
- wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap ),
+ wxBufferedPaintDC( wxWindow *window,
+ const wxBitmap &buffer = wxNullBitmap,
+ int style = wxBUFFER_CLIENT_AREA),
"Create a buffered paint DC. As with `wx.BufferedDC`, you may either
provide the bitmap to be used for buffering or let this object create
one internally (in the latter case, the size of the client part of the
class wxPrinterDC : public wxDC {
public:
wxPrinterDC(const wxPrintData& printData);
-// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
-// const wxString& device,
-// const wxString& output,
-// bool interactive = true,
-// int orientation = wxPORTRAIT);
};
#else
wxPrinterDC(const wxPrintData&)
{ wxPyRaiseNotImplemented(); }
-// wxPrinterDC(const wxString&, const wxString&, const wxString&, bool, int)
-// { wxPyRaiseNotImplemented(); }
};
%}
class wxPrinterDC : public wxDC {
public:
wxPrinterDC(const wxPrintData& printData);
-// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
-// const wxString& device,
-// const wxString& output,
-// bool interactive = true,
-// int orientation = wxPORTRAIT);
};
#endif