void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event) { wxLogMessage(wxT("Click over cell %p at %d;%d"), event.GetCell(), event.GetPoint().x, event.GetPoint().y); // if we don't skip the event, OnHtmlLinkClicked won't be called! event.Skip(); }
void MetadataItemPropertiesPanel::OnHtmlCellHover(wxHtmlCellEvent& event) { wxHtmlCell* c = event.GetCell(); if (!c) return; wxHtmlLinkInfo* lnk = c->GetLink(); if (!lnk) return; wxString addr = lnk->GetHref(); URI uri(addr); if (uri.protocol == "info") // special { // GetStatusBar()->SetStatusText(uri.action); // I'm having a hard time trying to convert this to screen coordinates // since parent's coords cannot be retrieved(?) //wxRect r(c->GetPosX(), c->GetPosY(), c->GetWidth(), c->GetHeight()); // M.B. So I decided to use a 21x9 box around the mouse wxRect r(::wxGetMousePosition().x - 10, ::wxGetMousePosition().y - 4, 21, 9); wxTipWindow* tw = new wxTipWindow(this, uri.action); tw->SetBoundingRect(r); } }
void CProjectListCtrl::OnHover( wxHtmlCellEvent& event ) { long i = 0; wxHtmlCell* pCell = event.GetCell(); wxHtmlCell* pRootCell = pCell->GetRootCell(); wxString strNvidiaIcon = wxT("nvidiaicon"); wxString strATIIcon = wxT("atiicon"); wxString strWebsiteIcon = wxT("website"); wxString strTooltip = wxEmptyString; wxHtmlCell* pAnchor = pCell->GetParent()->GetFirstChild(); if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strNvidiaIcon)) { strTooltip = _("Nvidia GPU Supported"); } else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strATIIcon)) { strTooltip = _("ATI GPU Supported"); } else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strWebsiteIcon)) { strTooltip = _("Project Website"); } else { // Convert current HTML cell into an array index pRootCell->GetId().ToLong(&i); strTooltip = m_Items[i]->GetDescription(); } // Set Tooltip to the item currently being hovered over SetToolTip(strTooltip); }
void AboutDlg::OnHtmlCellClicked(wxHtmlCellEvent& event) { wxHtmlCell* pCell = event.GetCell(); if ( pCell == NULL || pCell->GetId().IsEmpty() ) return; if ( pCell->GetId() == _T("btnClose") ) EndModal(wxID_CANCEL); }
void MyFrame::OnHtmlCellHover(wxHtmlCellEvent &event) { wxLogMessage(wxT("Mouse moved over cell %p at %d;%d"), event.GetCell(), event.GetPoint().x, event.GetPoint().y); }
void CProjectListCtrl::OnClicked( wxHtmlCellEvent& event ) { event.Skip(); }