added wxHtmlLinkInfo::GetHtmlCell so that you know where it came from
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,17 +22,34 @@ Default ctor.
|
|||||||
Construct hypertext link from HREF (aka URL) and TARGET (name of target
|
Construct hypertext link from HREF (aka URL) and TARGET (name of target
|
||||||
frame).
|
frame).
|
||||||
|
|
||||||
|
\membersection{wxHtmlLinkInfo::GetEvent}\label{wxhtmllinkinfogetevent}
|
||||||
|
|
||||||
|
\func{const wxMouseEvent *}{GetEvent}{\void}
|
||||||
|
|
||||||
|
Return pointer to event that generated OnLinkClicked event. Valid
|
||||||
|
only within \helpref{wxHtmlWindow::OnLinkClicked}{wxhtmlwindowonlinkclicked},
|
||||||
|
NULL otherwise.
|
||||||
|
|
||||||
|
\membersection{wxHtmlLinkInfo::GetHtmlCell}\label{wxhtmllinkinfogethtmlcell}
|
||||||
|
|
||||||
|
\func{const wxHtmlCell *}{GetHtmlCell}{\void}
|
||||||
|
|
||||||
|
Return pointer to the cell that was clicked. Valid
|
||||||
|
only within \helpref{wxHtmlWindow::OnLinkClicked}{wxhtmlwindowonlinkclicked},
|
||||||
|
NULL otherwise.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxHtmlLinkInfo::GetHref}\label{wxhtmllinkinfogethref}
|
\membersection{wxHtmlLinkInfo::GetHref}\label{wxhtmllinkinfogethref}
|
||||||
|
|
||||||
\func{wxString}{GetHref}{\void}
|
\func{wxString}{GetHref}{\void}
|
||||||
|
|
||||||
Returns {\it HREF} value of the {\tt <A>} tag.
|
Return {\it HREF} value of the {\tt <A>} tag.
|
||||||
|
|
||||||
\membersection{wxHtmlLinkInfo::GetTarget}\label{wxhtmllinkinfogettarget}
|
\membersection{wxHtmlLinkInfo::GetTarget}\label{wxhtmllinkinfogettarget}
|
||||||
|
|
||||||
\func{wxString}{GetTarget}{\void}
|
\func{wxString}{GetTarget}{\void}
|
||||||
|
|
||||||
Returns {\it TARGET} value of the {\tt <A>} tag (this value
|
Return {\it TARGET} value of the {\tt <A>} tag (this value
|
||||||
is used to specify in which frame should be the page pointed
|
is used to specify in which frame should be the page pointed
|
||||||
by {\helpref{Href}{wxhtmllinkinfogethref} opened).
|
by {\helpref{Href}{wxhtmllinkinfogethref} opened).
|
||||||
|
|
||||||
|
@@ -312,23 +312,26 @@ class WXDLLEXPORT wxHtmlLinkInfo : public wxObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxHtmlLinkInfo() : wxObject()
|
wxHtmlLinkInfo() : wxObject()
|
||||||
{ m_Href = m_Target = wxEmptyString; m_Event = NULL; }
|
{ m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; }
|
||||||
wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
|
wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
|
||||||
{ m_Href = href; m_Target = target; m_Event = NULL; }
|
{ m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; }
|
||||||
wxHtmlLinkInfo(const wxHtmlLinkInfo& l)
|
wxHtmlLinkInfo(const wxHtmlLinkInfo& l)
|
||||||
{ m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; }
|
{ m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; }
|
||||||
wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
|
wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
|
||||||
{ m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; return *this; }
|
{ m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; return *this; }
|
||||||
|
|
||||||
void SetEvent(const wxMouseEvent *e) { m_Event = e; }
|
void SetEvent(const wxMouseEvent *e) { m_Event = e; }
|
||||||
|
void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; }
|
||||||
|
|
||||||
wxString GetHref() const { return m_Href; }
|
wxString GetHref() const { return m_Href; }
|
||||||
wxString GetTarget() const { return m_Target; }
|
wxString GetTarget() const { return m_Target; }
|
||||||
const wxMouseEvent* GetEvent() const { return m_Event; }
|
const wxMouseEvent* GetEvent() const { return m_Event; }
|
||||||
|
const wxHtmlCell* GetHtmlCell() const { return m_Cell; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_Href, m_Target;
|
wxString m_Href, m_Target;
|
||||||
const wxMouseEvent *m_Event;
|
const wxMouseEvent *m_Event;
|
||||||
|
const wxHtmlCell *m_Cell;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -57,6 +57,7 @@ void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
|
|||||||
{
|
{
|
||||||
wxHtmlLinkInfo lnk2(*lnk);
|
wxHtmlLinkInfo lnk2(*lnk);
|
||||||
lnk2.SetEvent(&event);
|
lnk2.SetEvent(&event);
|
||||||
|
lnk2.SetHtmlCell(this);
|
||||||
((wxHtmlWindow*)parent) -> OnLinkClicked(lnk2);
|
((wxHtmlWindow*)parent) -> OnLinkClicked(lnk2);
|
||||||
// note : this overcasting is legal because parent is *always* wxHtmlWindow
|
// note : this overcasting is legal because parent is *always* wxHtmlWindow
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user