]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
removed the fudge from GetViewRect(), it isn't needed
[wxWidgets.git] / src / html / htmlwin.cpp
index b2ddf594928e2fc647e89de4120d3b8bbf8c6b4b..21db98eba5cce683bfc85730d3e9110d08f72cd7 100644 (file)
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "htmlwin.h"
 #pragma implementation "htmlproc.h"
 #endif
@@ -203,6 +203,11 @@ wxHtmlWindow::~wxHtmlWindow()
 
     if (m_Cell) delete m_Cell;
 
+    if ( m_Processors )
+    {
+        WX_CLEAR_LIST(wxHtmlProcessorList, *m_Processors);
+    }
+
     delete m_Parser;
     delete m_FS;
     delete m_History;
@@ -248,11 +253,11 @@ bool wxHtmlWindow::SetPage(const wxString& source)
     // pass HTML through registered processors:
     if (m_Processors || m_GlobalProcessors)
     {
-        wxHtmlProcessorList::Node *nodeL, *nodeG;
+        wxHtmlProcessorList::compatibility_iterator nodeL, nodeG;
         int prL, prG;
 
-        nodeL = (m_Processors) ? m_Processors->GetFirst() : NULL;
-        nodeG = (m_GlobalProcessors) ? m_GlobalProcessors->GetFirst() : NULL;
+        nodeL = (m_Processors) ? m_Processors->GetFirst() : wxHtmlProcessorList::compatibility_iterator();
+        nodeG = (m_GlobalProcessors) ? m_GlobalProcessors->GetFirst() : wxHtmlProcessorList::compatibility_iterator();
 
         // VS: there are two lists, global and local, both of them sorted by
         //     priority. Since we have to go through _both_ lists with
@@ -374,7 +379,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
 
         else
         {
-            wxNode *node;
+            wxList::compatibility_iterator node;
             wxString src = wxEmptyString;
 
             if (m_RelatedStatusBar != -1)
@@ -653,9 +658,8 @@ void wxHtmlWindow::AddProcessor(wxHtmlProcessor *processor)
     if (!m_Processors)
     {
         m_Processors = new wxHtmlProcessorList;
-        m_Processors->DeleteContents(TRUE);
     }
-    wxHtmlProcessorList::Node *node;
+    wxHtmlProcessorList::compatibility_iterator node;
 
     for (node = m_Processors->GetFirst(); node; node = node->GetNext())
     {
@@ -673,9 +677,8 @@ void wxHtmlWindow::AddProcessor(wxHtmlProcessor *processor)
     if (!m_GlobalProcessors)
     {
         m_GlobalProcessors = new wxHtmlProcessorList;
-        m_GlobalProcessors->DeleteContents(TRUE);
     }
-    wxHtmlProcessorList::Node *node;
+    wxHtmlProcessorList::compatibility_iterator node;
 
     for (node = m_GlobalProcessors->GetFirst(); node; node = node->GetNext())
     {
@@ -697,8 +700,9 @@ wxHtmlProcessorList *wxHtmlWindow::m_GlobalProcessors = NULL;
 void wxHtmlWindow::CleanUpStatics()
 {
     wxDELETE(m_DefaultFilter);
-    m_Filters.DeleteContents(TRUE);
-    m_Filters.Clear();
+    WX_CLEAR_LIST(wxList, m_Filters);
+    if (m_GlobalProcessors)
+        WX_CLEAR_LIST(wxHtmlProcessorList, *m_GlobalProcessors);
     wxDELETE(m_GlobalProcessors);
 }
 
@@ -801,7 +805,7 @@ void wxHtmlWindow::OnCellMouseHover(wxHtmlCell * WXUNUSED(cell),
     // do nothing here
 }
 
-void wxHtmlWindow::OnEraseBackground(wxEraseEvent& event)
+void wxHtmlWindow::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
 {
 }
 
@@ -893,7 +897,7 @@ void wxHtmlWindow::OnSize(wxSizeEvent& event)
 }
 
 
-void wxHtmlWindow::OnMouseMove(wxMouseEvent& event)
+void wxHtmlWindow::OnMouseMove(wxMouseEvent& WXUNUSED(event))
 {
     m_tmpMouseMoved = true;
 }
@@ -964,8 +968,10 @@ void wxHtmlWindow::OnMouseUp(wxMouseEvent& event)
 
 
 
-void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
-{    
+void wxHtmlWindow::OnInternalIdle()
+{
+    wxWindow::OnInternalIdle();
+    
     if (m_tmpMouseMoved && (m_Cell != NULL))
     {
 #ifdef DEBUG_HTML_SELECTION
@@ -1212,7 +1218,7 @@ void wxHtmlWindow::OnKeyUp(wxKeyEvent& event)
     }
 }
 
-void wxHtmlWindow::OnCopy(wxCommandEvent& event)
+void wxHtmlWindow::OnCopy(wxCommandEvent& WXUNUSED(event))
 {
     if ( m_selection )
         CopySelection();
@@ -1304,7 +1310,26 @@ void wxHtmlWindow::SelectLine(const wxPoint& pos)
 
 IMPLEMENT_ABSTRACT_CLASS(wxHtmlProcessor,wxObject)
 
+#if wxUSE_EXTENDED_RTTI
+IMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow, wxScrolledWindow,"wx/html/htmlwin.h")
+
+wxBEGIN_PROPERTIES_TABLE(wxHtmlWindow)
+/*
+       TODO PROPERTIES
+               style , wxHW_SCROLLBAR_AUTO
+               borders , (dimension)
+               url , string
+               htmlcode , string
+*/
+wxEND_PROPERTIES_TABLE()
+
+wxBEGIN_HANDLERS_TABLE(wxHtmlWindow)
+wxEND_HANDLERS_TABLE()
+
+wxCONSTRUCTOR_5( wxHtmlWindow , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) 
+#else
 IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow,wxScrolledWindow)
+#endif
 
 BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
     EVT_SIZE(wxHtmlWindow::OnSize)
@@ -1312,7 +1337,6 @@ BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
     EVT_LEFT_UP(wxHtmlWindow::OnMouseUp)
     EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp)
     EVT_MOTION(wxHtmlWindow::OnMouseMove)
-    EVT_IDLE(wxHtmlWindow::OnIdle)
     EVT_ERASE_BACKGROUND(wxHtmlWindow::OnEraseBackground)
     EVT_PAINT(wxHtmlWindow::OnPaint)
 #if wxUSE_CLIPBOARD