add events API to wxHtmlWindow (patch #1504493 by Francesco Montorsi)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-10-29 20:26:03 +00:00
parent 55f42db2fb
commit a1c3cdc4a2
10 changed files with 408 additions and 72 deletions

View File

@@ -104,8 +104,6 @@ class wxHtmlHelpHashData : public wxObject
// wxHtmlHelpHtmlWindow (private)
//--------------------------------------------------------------------------
DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTMLWINDOW_URL_CLICKED)
IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindowEvent, wxNotifyEvent)
class wxHtmlHelpHtmlWindow : public wxHtmlWindow
{
@@ -116,15 +114,9 @@ class wxHtmlHelpHtmlWindow : public wxHtmlWindow
SetStandardFonts();
}
virtual void OnLinkClicked(const wxHtmlLinkInfo& link)
void OnLinkClicked(wxHtmlLinkEvent& ev)
{
wxHtmlWindowEvent event(wxEVT_COMMAND_HTMLWINDOW_URL_CLICKED, GetId());
event.SetURL(link.GetHref());
if (!ProcessEvent(event))
{
wxHtmlWindow::OnLinkClicked(link);
}
const wxMouseEvent *e = link.GetEvent();
const wxMouseEvent *e = ev.GetLinkInfo().GetEvent();
if (e == NULL || e->LeftUp())
m_Window->NotifyPageChanged();
}
@@ -149,8 +141,13 @@ class wxHtmlHelpHtmlWindow : public wxHtmlWindow
wxHtmlHelpWindow *m_Window;
DECLARE_NO_COPY_CLASS(wxHtmlHelpHtmlWindow)
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(wxHtmlHelpHtmlWindow, wxHtmlWindow)
EVT_HTML_LINK_CLICKED(wxID_ANY, wxHtmlHelpHtmlWindow::OnLinkClicked)
END_EVENT_TABLE()
//---------------------------------------------------------------------------
// wxHtmlHelpWindow::m_mergedIndex