]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
Take hard coded path out of makefile
[wxWidgets.git] / src / html / htmlwin.cpp
index 380ed40818b11f57637b675b0480d4aebc22a258..cdd00d18c2678980dcaaa557bdefd48fc9a5483e 100644 (file)
@@ -41,7 +41,7 @@ WX_DEFINE_OBJARRAY(HtmlHistoryArray)
 
 
 wxHtmlWindow::wxHtmlWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
-                long style, const wxString& name) : wxScrolledWindow(parent, id, pos, size, wxVSCROLL, name)
+                long style, const wxString& name) : wxScrolledWindow(parent, id, pos, size, wxVSCROLL | wxHSCROLL, name)
 {
     m_tmpMouseMoved = FALSE;
     m_tmpLastLink = NULL;
@@ -69,9 +69,6 @@ wxHtmlWindow::~wxHtmlWindow()
 
     if (m_Cell) delete m_Cell;
 
-    wxList *parser_data = m_Parser -> GetTempData();
-    if (parser_data) delete parser_data;
-
     delete m_Parser;
     delete m_FS;
 }
@@ -158,7 +155,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
         if (f == NULL) {
             wxString err;
 
-            err.Printf(_("The browser is unable to open requested location :\n\n%s"), WXSTRINGCAST location);
+            err.Printf(_("Unable to open requested location :\n\n%s"), WXSTRINGCAST location);
             m_tmpCanDrawLocks--;
             Refresh();
             wxMessageBox(err, "Error");
@@ -274,11 +271,12 @@ void wxHtmlWindow::CreateLayout()
 #endif
         GetClientSize(&ClientWidth, &ClientHeight);
         m_Cell -> Layout(ClientWidth);
-        if (ClientHeight < m_Cell -> GetHeight()) {
-            SetScrollbars(wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
-                          m_Cell -> GetWidth() / wxHTML_SCROLL_STEP,
-                          m_Cell -> GetHeight() / wxHTML_SCROLL_STEP
-                          /*cheat: top-level frag is always container*/);
+        if (ClientHeight < m_Cell -> GetHeight() + GetCharHeight()) {
+            SetScrollbars(
+                  wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
+                  m_Cell -> GetWidth() / wxHTML_SCROLL_STEP,
+                  (m_Cell -> GetHeight() + GetCharHeight()) / wxHTML_SCROLL_STEP
+                  /*cheat: top-level frag is always container*/);
         }
         else { /* we fit into window, no need for scrollbars */
             SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell -> GetWidth() / wxHTML_SCROLL_STEP, 0); // disable...
@@ -421,9 +419,9 @@ void wxHtmlWindow::AddFilter(wxHtmlFilter *filter)
 
 
 
-void wxHtmlWindow::OnLinkClicked(wxHtmlLinkInfo *link)
+void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
 {
-    LoadPage(link -> GetHref());
+    LoadPage(link.GetHref());
 }
 
 
@@ -509,7 +507,7 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event)
         pos = event.GetPosition();
 
         if (m_Cell)
-            m_Cell -> OnMouseClick(this, sx + pos.x, sy + pos.y, event.ButtonDown(1), event.ButtonDown(2), event.ButtonDown(3));
+            m_Cell -> OnMouseClick(this, sx + pos.x, sy + pos.y, event);
     }
 }
 
@@ -591,6 +589,7 @@ FORCE_LINK(m_pre)
 FORCE_LINK(m_hline)
 FORCE_LINK(m_links)
 FORCE_LINK(m_tables)
+FORCE_LINK(m_meta)
 
 
 #endif