WX_DECLARE_EXPORTED_OBJARRAY(HtmlHistoryItem, HtmlHistoryArray);
-
+class wxHtmlWinModule;
class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow
{
DECLARE_DYNAMIC_CLASS(wxHtmlWindow)
+
+ friend class wxHtmlWinModule;
public:
wxHtmlWindow() : wxScrolledWindow() {};
// 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.
virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;}
// returns new filter (will be stored into m_DefaultFilter variable)
+ static void CleanUpStatics();
+ // cleans static variables
+
protected:
wxHtmlContainerCell *m_Cell;
// contains last link name
int m_tmpCanDrawLocks;
// if >0 contents of the window is not redrawn
- // (in order to avoid ugly bliking)
+ // (in order to avoid ugly blinking)
static wxList m_Filters;
// list of HTML filters
static wxHtmlFilter *m_DefaultFilter;
// this filter is used when no filter is able to read some file
+ static wxCursor *s_cur_hand;
+ static wxCursor *s_cur_arrow;
+
HtmlHistoryArray m_History;
int m_HistoryPos;
// browser history
#include "wx/string.h"
#include "wx/dynarray.h"
+class wxMimeTypeCmnModule;
+
// This class holds information about a given "file type". File type is the
// same as MIME type under Unix, but under Windows it corresponds more to an
// extension than to MIME type (in fact, several extensions may correspond to a
// if m_impl is NULL, create one
void EnsureImpl();
+
+ friend class wxMimeTypeCmnModule;
};
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/module.h"
#ifdef __BORLANDC__
#pragma hdrstop
wxMimeTypesManager * wxTheMimeTypesManager = &gs_mimeTypesManager;
+
+
+
+class wxMimeTypeCmnModule: public wxModule
+{
+DECLARE_DYNAMIC_CLASS(wxMimeTypeCmnModule)
+public:
+ wxMimeTypeCmnModule() : wxModule() {}
+ bool OnInit() { return TRUE; }
+ void OnExit()
+ { // this avoids false memory leak allerts:
+ if (gs_mimeTypesManager.m_impl != NULL)
+ {
+ delete gs_mimeTypesManager.m_impl;
+ gs_mimeTypesManager.m_impl = NULL;
+ }
+ }
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule)
+
+
+
#endif
// wxUSE_FILE && wxUSE_TEXTFILE
wxList wxHtmlWindow::m_Filters;
wxHtmlFilter *wxHtmlWindow::m_DefaultFilter = NULL;
+wxCursor *wxHtmlWindow::s_cur_hand = NULL;
+wxCursor *wxHtmlWindow::s_cur_arrow = NULL;
void wxHtmlWindow::CleanUpStatics()
{
m_DefaultFilter = NULL;
m_Filters.DeleteContents(TRUE);
m_Filters.Clear();
-
+ if (s_cur_hand) delete s_cur_hand;
+ if (s_cur_arrow) delete s_cur_arrow;
}
void wxHtmlWindow::OnIdle(wxIdleEvent& event)
{
- static wxCursor cur_hand(wxCURSOR_HAND), cur_arrow(wxCURSOR_ARROW);
+ if (s_cur_hand == NULL)
+ {
+ s_cur_hand = new wxCursor(wxCURSOR_HAND);
+ s_cur_arrow = new wxCursor(wxCURSOR_ARROW);
+ }
if (m_tmpMouseMoved && (m_Cell != NULL)) {
int sx, sy;
if (lnk != m_tmpLastLink) {
if (lnk == NULL) {
- SetCursor(cur_arrow);
+ SetCursor(*s_cur_arrow);
if (m_RelatedStatusBar != -1) m_RelatedFrame -> SetStatusText(wxEmptyString, m_RelatedStatusBar);
}
else {
- SetCursor(cur_hand);
+ SetCursor(*s_cur_hand);
if (m_RelatedStatusBar != -1)
m_RelatedFrame -> SetStatusText(lnk -> GetHref(), m_RelatedStatusBar);
}