wxCoord xoffset = 0, wxCoord yoffset = 0,
int fillStyle = wxODDEVEN_RULE);
+ // TODO: Figure out a good typemap for this...
+ // Convert the first 3 args from a sequence of sequences?
+// void DrawPolyPolygon(int n, int count[], wxPoint points[],
+// wxCoord xoffset = 0, wxCoord yoffset = 0,
+// int fillStyle = wxODDEVEN_RULE);
+
// this version puts both optional bitmap and the text into the given
// rectangle and aligns is as specified by alignment parameter; it also
// will emphasize the character with the given index if it is != -1 and
"Get the width, height, decent and leading of the text using the current or specified font.\n"
"Works for single as well as multi-line strings.");
+
+ %extend {
+ wxArrayInt GetPartialTextExtents(const wxString& text) {
+ wxArrayInt widths;
+ self->GetPartialTextExtents(text, widths);
+ return widths;
+ }
+ }
+
// size and resolution
// -------------------
//---------------------------------------------------------------------------
%newgroup
+
+%{
+#include <wx/dcbuffer.h>
+%}
+
+
class wxBufferedDC : public wxMemoryDC
{
public:
- %pythonAppend wxBufferedDC( wxDC *dc, const wxBitmap &buffer )
+ %pythonAppend wxBufferedDC
"self._dc = args[0] # save a ref so the other dc will not be deleted before self";
- %pythonAppend wxBufferedDC( wxDC *dc, const wxSize &area )
- "val._dc = args[0] # save a ref so the other dc will not be deleted before self";
+ %nokwargs wxBufferedDC;
+
// Construct a wxBufferedDC using a user supplied buffer.
wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
- // Construct a wxBufferedDC with an internal buffer of 'area'
- // (where area is usually something like the size of the window
- // being buffered)
+ // Construct a wxBufferedDC with an internal buffer of 'area'
+ // (where area is usually something like the size of the window
+ // being buffered)
+ wxBufferedDC( wxDC *dc, const wxSize &area );
+
+
+ // 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 );
- // Blits the buffer to the dc, and detaches the dc from
- // the buffer. Usually called in the dtor or by the dtor
- // of derived classes if the BufferedDC must blit before
- // the derived class (which may own the dc it's blitting
- // to) is destroyed.
+
+ // The buffer is blit to the real DC when the BufferedDC is destroyed.
+ ~wxBufferedDC();
+
+
+ // Blits the buffer to the dc, and detaches the dc from
+ // the buffer. Usually called in the dtor or by the dtor
+ // of derived classes if the BufferedDC must blit before
+ // the derived class (which may own the dc it's blitting
+ // to) is destroyed.
void UnMask();
};
+
+
+// Creates a double buffered wxPaintDC, optionally allowing the
+// user to specify their own buffer to use.
class wxBufferedPaintDC : public wxBufferedDC
{
public:
+
+ // If no bitmap is supplied by the user, a temporary one will be created.
wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap );
+
};
%newgroup
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXMAC__)
%{
#include <wx/metafile.h>
int GetWidth();
int GetHeight();
+#ifdef __WXMSW__
const wxString& GetFileName() const;
-
+#endif
+
%pythoncode { def __nonzero__(self): return self.Ok() }
};