%new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
%new wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings);
%new wxBitmap* wxBitmapFromIcon(const wxIcon& icon);
-%new wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 );
+%new wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 );
// #ifdef __WXMSW__
// %new wxBitmap* wxBitmapFromData(PyObject* data, long type,
}
- wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ) {
- return new wxBitmap(bits, width, height, depth);
+ wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 ) {
+ char* buf;
+ int length;
+ PyString_AsStringAndSize(bits, &buf, &length);
+ return new wxBitmap(buf, width, height, depth);
}
void SetStyle(int style);
void SetWidth(int width);
- // **** This one needs to return a list of ints (wxDash)
- //int GetDashes(wxDash **dashes);
+
void SetDashes(int LCOUNT, wxDash* choices);
+ //int GetDashes(wxDash **dashes);
+ %addmethods {
+ PyObject* GetDashes() {
+ wxDash* dashes;
+ int count = self->GetDashes(&dashes);
+ wxPyBeginBlockThreads();
+ PyObject* retval = PyList_New(0);
+ for (int x=0; x<count; x++)
+ PyList_Append(retval, PyInt_FromLong(dashes[x]));
+ wxPyEndBlockThreads();
+ return retval;
+ }
+ }
#ifdef __WXMSW__
wxBitmap* GetStipple();
int fill_style=wxODDEVEN_RULE);
void DrawPoint(long x, long y);
void DrawRectangle(long x, long y, long width, long height);
+ %name(DrawRectangleRect)void DrawRectangle(const wxRect& rect);
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20);
void DrawSpline(int PCOUNT, wxPoint* points);
void EndDoc();
void EndDrawing();
void EndPage();
- void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
+ bool FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
wxBrush GetBackground();
wxBrush GetBrush();
long GetCharHeight();
void SetBackgroundMode(int mode);
void SetClippingRegion(long x, long y, long width, long height);
%name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);
+ %name(SetClippingRect) void SetClippingRegion(const wxRect& rect);
void SetPalette(const wxPalette& colourMap);
void SetBrush(const wxBrush& brush);
void SetFont(const wxFont& font);