X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e4a197e4c60e461b8068b0619692ea083e30b8b..53663be8a5ea8e1c6f178839209b67e8228e4642:/wxPython/src/html.i?ds=sidebyside diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 7673a3637e..7c83c30edf 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -180,21 +180,21 @@ public: class wxHtmlWinParser : public wxHtmlParser { public: - wxHtmlWinParser(wxHtmlWindow *wnd = NULL); + wxHtmlWinParser(wxPyHtmlWindow *wnd = NULL); void SetDC(wxDC *dc); wxDC* GetDC(); int GetCharHeight(); int GetCharWidth(); - wxHtmlWindow* GetWindow(); - //void SetFonts(wxString normal_face, wxString fixed_face, int *LIST); + wxPyHtmlWindow* GetWindow(); + // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). %addmethods { - void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes) { - int* temp = int_LIST_helper(sizes); - if (temp) { - self->SetFonts(normal_face, fixed_face, temp); + void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { + int* temp = NULL; + if (sizes) temp = int_LIST_helper(sizes); + self->SetFonts(normal_face, fixed_face, temp); + if (temp) delete [] temp; - } } } @@ -390,7 +390,7 @@ public: void DrawInvisible(wxDC& dc, int x, int y); const wxHtmlCell* Find(int condition, const void* param); - bool AdjustPagebreak(int * pagebreak); + bool AdjustPagebreak(int* INOUT); void SetCanLiveOnPagebreak(bool can); }; @@ -651,6 +651,9 @@ public: // Return value : same as SetPage bool LoadPage(const wxString& location); + // Loads HTML page from file + bool LoadFile(const wxString& filename); + // Append to current page bool AppendToPage(const wxString& source); @@ -674,12 +677,12 @@ public: // Sets fonts to be used when displaying HTML page. %addmethods { - void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes) { - int* temp = int_LIST_helper(sizes); - if (temp) { - self->SetFonts(normal_face, fixed_face, temp); + void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { + int* temp = NULL; + if (sizes) temp = int_LIST_helper(sizes); + self->SetFonts(normal_face, fixed_face, temp); + if (temp) delete [] temp; - } } } @@ -741,6 +744,16 @@ public: void SetHtmlText(const wxString& html, const wxString& basepath = wxPyEmptyString, bool isdir = TRUE); + // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). + %addmethods { + void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { + int* temp = NULL; + if (sizes) temp = int_LIST_helper(sizes); + self->SetFonts(normal_face, fixed_face, temp); + if (temp) + delete [] temp; + } + } int Render(int x, int y, int from = 0, int dont_render = FALSE); int GetTotalHeight(); // returns total height of the html document @@ -765,6 +778,16 @@ public: void SetHtmlFile(const wxString &htmlfile); void SetHeader(const wxString& header, int pg = wxPAGE_ALL); void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); + // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). + %addmethods { + void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { + int* temp = NULL; + if (sizes) temp = int_LIST_helper(sizes); + self->SetFonts(normal_face, fixed_face, temp); + if (temp) + delete [] temp; + } + } void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, float spaces = 5); @@ -787,6 +810,16 @@ public: void SetHeader(const wxString& header, int pg = wxPAGE_ALL); void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); + %addmethods { + void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { + int* temp = NULL; + if (sizes) temp = int_LIST_helper(sizes); + self->SetFonts(normal_face, fixed_face, temp); + if (temp) + delete [] temp; + } + } + wxPrintData *GetPrintData() {return m_PrintData;} wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;}