X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a76015e6ebf22e267c80f3740f3f7adc523b47e3..0ce742cf092c9244f27957e308c16f3c2631042d:/include/wx/html/htmlwin.h?ds=sidebyside diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 553f49112e..cb339ec0b3 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -18,6 +18,7 @@ #if wxUSE_HTML #include +#include #include #include #include @@ -28,13 +29,13 @@ //-------------------------------------------------------------------------------- // wxHtmlWindow -// (This is probably the only class you will directly use.) +// (This is probably the only class you will directly use.) // Purpose of this class is to display HTML page (either local // file or downloaded via HTTP protocol) in a window. Width // of window is constant - given in constructor - virtual height // is changed dynamicly depending on page size. // Once the window is created you can set it's content by calling -// SetPage(text) or LoadPage(filename). +// SetPage(text) or LoadPage(filename). //-------------------------------------------------------------------------------- @@ -93,10 +94,7 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow // borders (free space between text and window borders) // defaults to 10 pixels. - bool m_Scrollable; - // TRUE if you can scroll the window. - // If it is FALSE you can't scroll the window even if it's contents is larger - // than window. + int m_Style; private: @@ -120,17 +118,18 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow public: wxHtmlWindow() : wxScrolledWindow() {}; - wxHtmlWindow(wxWindow *parent, wxWindowID id = -1, + wxHtmlWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const wxString& name = "htmlWindow", bool scrollable = TRUE); + long style = wxHW_SCROLLBAR_AUTO, + const wxString& name = "htmlWindow"); ~wxHtmlWindow(); bool SetPage(const wxString& source); // Set HTML page and display it. !! source is HTML document itself, - // it is NOT address/filename of HTML document. If you want to + // it is NOT address/filename of HTML document. If you want to // specify document location, use LoadPage() istead // Return value : FALSE if an error occured, TRUE otherwise - + bool LoadPage(const wxString& location); // Load HTML page from given location. Location can be either // a) /usr/wxGTK2/docs/html/wx.htm @@ -144,10 +143,10 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow wxString GetOpenedPage() const {return m_OpenedPage;} // Returns full location of opened page - + void SetRelatedFrame(wxFrame* frame, const wxString& format); // sets frame in which page title will be displayed. Format is format of - // frame title, e.g. "HtmlHelp : %s". It must contain exactly one %s + // frame title, e.g. "HtmlHelp : %s". It must contain exactly one %s wxFrame* GetRelatedFrame() const {return m_RelatedFrame;} void SetRelatedStatusBar(int bar); @@ -189,10 +188,13 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow virtual void OnLinkClicked(const wxString& link); // called when users clicked on hypertext link. Default behavior is to // call LoadPage(loc) - + static void CleanUpStatics(); // cleans static variables + wxHtmlWinParser *GetParser() const { return m_Parser; } + // return a pointer to the parser. + protected: bool ScrollToAnchor(const wxString& anchor); // Scrolls to anchor of this name. (Anchor is #news @@ -209,7 +211,7 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow void OnMouseEvent(wxMouseEvent& event); void OnIdle(wxIdleEvent& event); void OnKeyDown(wxKeyEvent& event); - + virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} // returns new filter (will be stored into m_DefaultFilter variable)