#include "wx/html/htmlcell.h"
#include "wx/filesys.h"
#include "wx/html/htmlfilt.h"
+#include "wx/filename.h"
class wxHtmlProcessor;
class wxHtmlWinModule;
// 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
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
{
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();
// 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
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;}
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)
// 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)
static wxHtmlProcessorList *m_GlobalProcessors;
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxHtmlWindow)
};