]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpwnd.cpp
use wxCopyRectToRECT() instead of duplicating its code (patch 1707294)
[wxWidgets.git] / src / html / helpwnd.cpp
index 0d71ff3a0ab14addf73e404d957048c5ca26ae4f..17a376198b6e5fadb54e9456195ce91adb99be14 100644 (file)
@@ -107,45 +107,48 @@ class wxHtmlHelpHashData : public wxObject
 
 class wxHtmlHelpHtmlWindow : public wxHtmlWindow
 {
-    public:
-        wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent)
-            : wxHtmlWindow(parent), m_Window(win)
-        {
-            SetStandardFonts();
-        }
+public:
+    wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent)
+        : wxHtmlWindow(parent), m_Window(win)
+    {
+        SetStandardFonts();
+    }
 
-        void OnLinkClicked(wxHtmlLinkEvent& ev)
-        {
-            const wxMouseEvent *e = ev.GetLinkInfo().GetEvent();
-            if (e == NULL || e->LeftUp())
-                m_Window->NotifyPageChanged();
-        }
+    void OnLink(wxHtmlLinkEvent& ev)
+    {
+        const wxMouseEvent *e = ev.GetLinkInfo().GetEvent();
+        if (e == NULL || e->LeftUp())
+            m_Window->NotifyPageChanged();
 
-        // Returns full location with anchor (helper)
-        static wxString GetOpenedPageWithAnchor(wxHtmlWindow *win)
-        {
-            if(!win)
-                return wxEmptyString;
+        // skip the event so that normal processing (i.e. following the link)
+        // is done:
+        ev.Skip();
+    }
 
-            wxString an = win->GetOpenedAnchor();
-            wxString pg = win->GetOpenedPage();
-            if(!an.empty())
-            {
-                pg << wxT("#");
-                pg << an;
-            }
-            return pg;
+    // Returns full location with anchor (helper)
+    static wxString GetOpenedPageWithAnchor(wxHtmlWindow *win)
+    {
+        if(!win)
+            return wxEmptyString;
+
+        wxString an = win->GetOpenedAnchor();
+        wxString pg = win->GetOpenedPage();
+        if(!an.empty())
+        {
+            pg << wxT("#") << an;
         }
+        return pg;
+    }
 
-    private:
-        wxHtmlHelpWindow *m_Window;
+private:
+    wxHtmlHelpWindow *m_Window;
 
     DECLARE_NO_COPY_CLASS(wxHtmlHelpHtmlWindow)
     DECLARE_EVENT_TABLE()
 };
 
 BEGIN_EVENT_TABLE(wxHtmlHelpHtmlWindow, wxHtmlWindow)
-    EVT_HTML_LINK_CLICKED(wxID_ANY, wxHtmlHelpHtmlWindow::OnLinkClicked)
+    EVT_HTML_LINK_CLICKED(wxID_ANY, wxHtmlHelpHtmlWindow::OnLink)
 END_EVENT_TABLE()
 
 
@@ -1196,8 +1199,8 @@ public:
                       wxSize(200, wxDefaultCoord),
                       0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
 
-        sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY));
-        FontSize->SetRange(2, 100);
+        sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
+                      wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, _T("wxSpinCtrl")));
 
         topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);