X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af49c4b8a2d3553e733e71c7dd3911881f4c1a2a..eee3624b111881520d7d58fe174ef563c62d8375:/include/wx/html/htmlwin.h?ds=sidebyside diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 14ed7b410b..719fbc4fc5 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -26,6 +26,7 @@ #include "wx/html/htmlcell.h" #include "wx/filesys.h" #include "wx/html/htmlfilt.h" +#include "wx/filename.h" class wxHtmlProcessor; class wxHtmlWinModule; @@ -36,6 +37,10 @@ class wxHtmlProcessorList; // wxHtmlWindow flags: #define wxHW_SCROLLBAR_NEVER 0x0002 #define wxHW_SCROLLBAR_AUTO 0x0004 +#define wxHW_NO_SELECTION 0x0008 + +#define wxHW_DEFAULT_STYLE wxHW_SCROLLBAR_AUTO + // enums for wxHtmlWindow::OnOpeningURL enum wxHtmlOpeningStatus @@ -45,16 +50,16 @@ enum wxHtmlOpeningStatus wxHTML_REDIRECT }; -//-------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // wxHtmlWindow // (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 +// 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). -//-------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow { @@ -66,7 +71,7 @@ public: wxHtmlWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxHW_SCROLLBAR_AUTO, + long style = wxHW_DEFAULT_STYLE, const wxString& name = wxT("htmlWindow")) { Init(); @@ -100,6 +105,9 @@ public: // Return value : same as SetPage virtual bool LoadPage(const wxString& location); + // Loads HTML page from file + bool LoadFile(const wxFileName& filename); + // Returns full location of opened page wxString GetOpenedPage() const {return m_OpenedPage;} // Returns anchor within opened page @@ -117,7 +125,8 @@ public: void SetRelatedStatusBar(int bar); // Sets fonts to be used when displaying HTML page. - void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes); + void SetFonts(wxString normal_face, wxString fixed_face, + const int *sizes = NULL); // Sets space between text and window borders. void SetBorders(int b) {m_Borders = b;} @@ -200,7 +209,8 @@ protected: void OnDraw(wxDC& dc); void OnSize(wxSizeEvent& event); - void OnMouseEvent(wxMouseEvent& event); + void OnMouseMove(wxMouseEvent& event); + void OnMouseButton(wxMouseEvent& event); void OnIdle(wxIdleEvent& event); // Returns new filter (will be stored into m_DefaultFilter variable) @@ -209,6 +219,10 @@ protected: // cleans static variables static void CleanUpStatics(); + // Returns true if text selection is enabled (wxClipboard must be available + // and wxHW_NO_SELECTION not used) + bool IsSelectionEnabled() const; + protected: // This is pointer to the first cell in parsed data. // (Note: the first cell is usually top one = all other cells are sub-cells of this one) @@ -269,6 +283,7 @@ private: static wxHtmlProcessorList *m_GlobalProcessors; DECLARE_EVENT_TABLE() + DECLARE_NO_COPY_CLASS(wxHtmlWindow) };