// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "helpfrm.h"
#endif
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:
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
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;
+ }
}
if (! m_ContentsBox)
return ;
- 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;
else if (m_hfStyle & wxHF_ICONS_BOOK_CHAPTER)
image = (it->m_Level == 1) ? IMG_Book : IMG_Folder;
m_ContentsBox->SetItemImage(roots[it->m_Level], image);
- m_ContentsBox->SetItemSelectedImage(roots[it->m_Level], image);
+ m_ContentsBox->SetItemImage(roots[it->m_Level], image,
+ wxTreeItemIcon_Selected);
imaged[it->m_Level] = TRUE;
}
}
EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
END_EVENT_TABLE()
-
void wxHtmlHelpFrame::OptionsDialog()
{
wxHtmlHelpFrameOptionsDialog dlg(this);
enu.EnumerateFacenames();
m_NormalFonts = new wxArrayString;
*m_NormalFonts = *enu.GetFacenames();
- m_NormalFonts->Sort();
+ m_NormalFonts->Sort(wxStringSortAscending);
}
if (m_FixedFonts == NULL)
{
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE);
m_FixedFonts = new wxArrayString;
*m_FixedFonts = *enu.GetFacenames();
- m_FixedFonts->Sort();
+ m_FixedFonts->Sort(wxStringSortAscending);
}
// VS: We want to show the font that is actually used by wxHtmlWindow.
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());
}
}
}
#ifdef __WXMAC__
-void wxHtmlHelpFrame::OnQuit(wxCommandEvent& event)
+void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
{
Close(TRUE);
}
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