]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpfrm.cpp
keep selected image in sync with the normal one if it hasn't been changed (patch...
[wxWidgets.git] / src / html / helpfrm.cpp
index 4aaee79da1a63dc5f41546ee3c43e8093cee40a4..d51186b7653ad3ee1b23e74e257b4cb85fc88727 100644 (file)
@@ -113,7 +113,9 @@ class wxHtmlHelpHtmlWindow : public wxHtmlWindow
         virtual void OnLinkClicked(const wxHtmlLinkInfo& link)
         {
             wxHtmlWindow::OnLinkClicked(link);
-            m_Frame->NotifyPageChanged();
+            const wxMouseEvent *e = link.GetEvent();
+            if (e == NULL || e->LeftUp())
+                m_Frame->NotifyPageChanged();
         }
 
     private:
@@ -265,14 +267,14 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
 
     wxMenu* fileMenu = new wxMenu;
     fileMenu->Append(wxID_HTML_OPENFILE, _("&Open..."));
-    fileMenu->Append(wxID_ABOUT, _("&About..."));
     fileMenu->AppendSeparator();
     fileMenu->Append(wxID_CLOSE, _("&Close"));
 
-//    wxMenu* helpMenu = new wxMenu;
-//    helpMenu->Append(wxID_ABOUT, _("&About..."));
+    wxMenu* helpMenu = new wxMenu;
+    helpMenu->Append(wxID_ABOUT, _("&About..."));
 
     menuBar->Append(fileMenu,_("File"));
+    menuBar->Append(helpMenu,_("Help"));
     SetMenuBar(menuBar);
 #endif
 
@@ -494,7 +496,11 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame()
         delete m_Data;
     if (m_NormalFonts) delete m_NormalFonts;
     if (m_FixedFonts) delete m_FixedFonts;
-    if (m_PagesHash) delete m_PagesHash;
+    if (m_PagesHash) 
+    {
+        WX_CLEAR_HASH_TABLE(*m_PagesHash);
+        delete m_PagesHash;
+    }
 }
 
 
@@ -717,9 +723,12 @@ void wxHtmlHelpFrame::CreateContents()
 
     m_ContentsBox->Clear();
 
-    if (m_PagesHash) delete m_PagesHash;
+    if (m_PagesHash)
+    {
+        WX_CLEAR_HASH_TABLE(*m_PagesHash);
+        delete m_PagesHash;
+    }
     m_PagesHash = new wxHashTable(wxKEY_STRING, 2 * m_Data->GetContentsCnt());
-    m_PagesHash->DeleteContents(TRUE);
 
     int cnt = m_Data->GetContentsCnt();
     int i;
@@ -1308,8 +1317,8 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
                 pos = m_BookmarksNames.Index(item);
                 if (pos != wxNOT_FOUND)
                 {
-                    m_BookmarksNames.Remove(pos);
-                    m_BookmarksPages.Remove(pos);
+                    m_BookmarksNames.RemoveAt(pos);
+                    m_BookmarksPages.RemoveAt(pos);
                     m_Bookmarks->Delete(m_Bookmarks->GetSelection());
                 }
             }
@@ -1522,7 +1531,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
 }
 
 #ifdef __WXMAC__
-void wxHtmlHelpFrame::OnQuit(wxCommandEvent& event)
+void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
 {
     Close(TRUE);
 }
@@ -1550,7 +1559,7 @@ BEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame)
     EVT_COMBOBOX(wxID_HTML_BOOKMARKSLIST, wxHtmlHelpFrame::OnBookmarksSel)
     EVT_CLOSE(wxHtmlHelpFrame::OnCloseWindow)
 #ifdef __WXMAC__
-    EVT_MENU(wxID_CLOSE, wxHtmlHelpFrame::OnQuit)
+    EVT_MENU(wxID_CLOSE, wxHtmlHelpFrame::OnClose)
     EVT_MENU(wxID_ABOUT, wxHtmlHelpFrame::OnAbout)
 #endif