From ab829dd986e1b9eaa67c3c87632c5a1c5a940aee Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 9 Apr 2003 16:23:30 +0000 Subject: [PATCH] Some updates for wxHtml classes, and other tweaks git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_extras.py | 2 ++ wxPython/src/html.i | 45 +++++++++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 4c05555b55..ae21407d38 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -647,6 +647,8 @@ if wxPlatform == "__WXGTK__": except: pass +# On MSW add the directory where the wxWindows catalogs were installed +# to the default catalog path. if wxPlatform == "__WXMSW__": import os localedir = os.path.join(os.path.split(__file__)[0], "locale") diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 7673a3637e..47188ebb23 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -187,14 +187,14 @@ public: int GetCharHeight(); int GetCharWidth(); wxHtmlWindow* GetWindow(); - //void SetFonts(wxString normal_face, wxString fixed_face, int *LIST); + // 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; - } } } @@ -651,6 +651,9 @@ public: // Return value : same as SetPage bool LoadPage(const wxString& location); + // Loads HTML page from file +//TODO 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);