bool underline = FALSE, const char* facename = NULL,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
void RemoveFont(wxFont *font);
+
+ int GetCount();
};
+
+// The list of ints for the dashes needs to exist for the life of the pen
+// so we make it part of the class to save it. wxPyPen is aliased to wxPen
+// in _extras.py
+
%{
class wxPyPen : public wxPen {
public:
{ m_dash = NULL; }
~wxPyPen() {
if (m_dash)
- delete m_dash;
+ delete [] m_dash;
}
void SetDashes(int nb_dashes, const wxDash *dash) {
+ if (m_dash)
+ delete [] m_dash;
m_dash = new wxDash[nb_dashes];
- for (int i=0; i<nb_dashes; i++)
+ for (int i=0; i<nb_dashes; i++) {
m_dash[i] = dash[i];
+ }
wxPen::SetDashes(nb_dashes, m_dash);
}
%}
-
class wxPyPen : public wxPen {
public:
wxPyPen(wxColour& colour, int width=1, int style=wxSOLID);
+
class wxPenList : public wxObject {
public:
void AddPen(wxPen* pen);
wxPen* FindOrCreatePen(const wxColour& colour, int width, int style);
void RemovePen(wxPen* pen);
+
+ int GetCount();
};
void AddBrush(wxBrush *brush);
wxBrush * FindOrCreateBrush(const wxColour& colour, int style);
void RemoveBrush(wxBrush *brush);
+
+ int GetCount();
};
//----------------------------------------------------------------------
void EndDrawing();
void EndPage();
void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
- wxBrush& GetBackground();
- wxBrush& GetBrush();
+ wxBrush GetBackground();
+ wxBrush GetBrush();
long GetCharHeight();
long GetCharWidth();
void GetClippingBox(long *OUTPUT, long *OUTPUT,
long *OUTPUT, long *OUTPUT);
- wxFont& GetFont();
+ wxFont GetFont();
int GetLogicalFunction();
void GetLogicalScale(double *OUTPUT, double *OUTPUT);
int GetMapMode();
bool GetOptimization();
- wxPen& GetPen();
+ wxPen GetPen();
%addmethods {
%new wxColour* GetPixel(long x, long y) {
wxColour* wc = new wxColour();
#endif
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-
-%readonly
-%{
-#if 0
-%}
-extern wxFont *wxNORMAL_FONT;
-extern wxFont *wxSMALL_FONT;
-extern wxFont *wxITALIC_FONT;
-extern wxFont *wxSWISS_FONT;
-
-extern wxPen *wxRED_PEN;
-extern wxPen *wxCYAN_PEN;
-extern wxPen *wxGREEN_PEN;
-extern wxPen *wxBLACK_PEN;
-extern wxPen *wxWHITE_PEN;
-extern wxPen *wxTRANSPARENT_PEN;
-extern wxPen *wxBLACK_DASHED_PEN;
-extern wxPen *wxGREY_PEN;
-extern wxPen *wxMEDIUM_GREY_PEN;
-extern wxPen *wxLIGHT_GREY_PEN;
-
-extern wxBrush *wxBLUE_BRUSH;
-extern wxBrush *wxGREEN_BRUSH;
-extern wxBrush *wxWHITE_BRUSH;
-extern wxBrush *wxBLACK_BRUSH;
-extern wxBrush *wxTRANSPARENT_BRUSH;
-extern wxBrush *wxCYAN_BRUSH;
-extern wxBrush *wxRED_BRUSH;
-extern wxBrush *wxGREY_BRUSH;
-extern wxBrush *wxMEDIUM_GREY_BRUSH;
-extern wxBrush *wxLIGHT_GREY_BRUSH;
-
-extern wxColour *wxBLACK;
-extern wxColour *wxWHITE;
-extern wxColour *wxRED;
-extern wxColour *wxBLUE;
-extern wxColour *wxGREEN;
-extern wxColour *wxCYAN;
-extern wxColour *wxLIGHT_GREY;
-
-extern wxCursor *wxSTANDARD_CURSOR;
-extern wxCursor *wxHOURGLASS_CURSOR;
-extern wxCursor *wxCROSS_CURSOR;
-
-extern wxBitmap wxNullBitmap;
-extern wxIcon wxNullIcon;
-extern wxCursor wxNullCursor;
-extern wxPen wxNullPen;
-extern wxBrush wxNullBrush;
-extern wxPalette wxNullPalette;
-extern wxFont wxNullFont;
-extern wxColour wxNullColour;
-
-
-extern wxFontList* wxTheFontList;
-extern wxPenList* wxThePenList;
-extern wxBrushList* wxTheBrushList;
-extern wxColourDatabase* wxTheColourDatabase;
-
-
-%readwrite
-%{
-#endif
-%}
-
//---------------------------------------------------------------------------
class wxPalette : public wxGDIObject {
//---------------------------------------------------------------------------
+%readonly
+%{
+#if 0
+%}
+
+extern wxFont *wxNORMAL_FONT;
+extern wxFont *wxSMALL_FONT;
+extern wxFont *wxITALIC_FONT;
+extern wxFont *wxSWISS_FONT;
+
+extern wxPen *wxRED_PEN;
+extern wxPen *wxCYAN_PEN;
+extern wxPen *wxGREEN_PEN;
+extern wxPen *wxBLACK_PEN;
+extern wxPen *wxWHITE_PEN;
+extern wxPen *wxTRANSPARENT_PEN;
+extern wxPen *wxBLACK_DASHED_PEN;
+extern wxPen *wxGREY_PEN;
+extern wxPen *wxMEDIUM_GREY_PEN;
+extern wxPen *wxLIGHT_GREY_PEN;
+
+extern wxBrush *wxBLUE_BRUSH;
+extern wxBrush *wxGREEN_BRUSH;
+extern wxBrush *wxWHITE_BRUSH;
+extern wxBrush *wxBLACK_BRUSH;
+extern wxBrush *wxTRANSPARENT_BRUSH;
+extern wxBrush *wxCYAN_BRUSH;
+extern wxBrush *wxRED_BRUSH;
+extern wxBrush *wxGREY_BRUSH;
+extern wxBrush *wxMEDIUM_GREY_BRUSH;
+extern wxBrush *wxLIGHT_GREY_BRUSH;
+
+extern wxColour *wxBLACK;
+extern wxColour *wxWHITE;
+extern wxColour *wxRED;
+extern wxColour *wxBLUE;
+extern wxColour *wxGREEN;
+extern wxColour *wxCYAN;
+extern wxColour *wxLIGHT_GREY;
+
+extern wxCursor *wxSTANDARD_CURSOR;
+extern wxCursor *wxHOURGLASS_CURSOR;
+extern wxCursor *wxCROSS_CURSOR;
+
+
+extern wxBitmap wxNullBitmap;
+extern wxIcon wxNullIcon;
+extern wxCursor wxNullCursor;
+extern wxPen wxNullPen;
+extern wxBrush wxNullBrush;
+extern wxPalette wxNullPalette;
+extern wxFont wxNullFont;
+extern wxColour wxNullColour;
+
+
+extern wxFontList* wxTheFontList;
+extern wxPenList* wxThePenList;
+extern wxBrushList* wxTheBrushList;
+extern wxColourDatabase* wxTheColourDatabase;
+
+
+%readwrite
+%{
+#endif
+%}
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+