本文整理汇总了C++中wxWebEvent::GetHref方法的典型用法代码示例。如果您正苦于以下问题:C++ wxWebEvent::GetHref方法的具体用法?C++ wxWebEvent::GetHref怎么用?C++ wxWebEvent::GetHref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxWebEvent
的用法示例。
在下文中一共展示了wxWebEvent::GetHref方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnShowContextMenu
void MyFrame::OnShowContextMenu(wxWebEvent& evt)
{
wxMenu menuPopup;
wxString href = evt.GetHref();
if (!href.IsEmpty())
{
menuPopup.Append(ID_OpenHref, _("&Open"));
menuPopup.AppendSeparator();
m_uri_href = href;
}
else
{
menuPopup.Append(ID_GoBack, _("&Back"));
menuPopup.Append(ID_GoForward, _("&Forward"));
menuPopup.Append(ID_Reload, _("&Reload"));
menuPopup.Append(ID_Stop, _("&Stop"));
menuPopup.AppendSeparator();
}
menuPopup.Append(ID_Cut, _("Cu&t"));
menuPopup.Append(ID_Copy, _("&Copy"));
menuPopup.Append(ID_CopyLink, _("Copy &Link"));
menuPopup.Append(ID_Paste, _("&Paste"));
menuPopup.Append(ID_SelectAll, _("Select &All"));
wxPoint pt_mouse = ::wxGetMousePosition();
pt_mouse = m_browser->ScreenToClient(pt_mouse);
PopupMenu(&menuPopup, pt_mouse);
}
示例2: PopulatePopupMenu
void wxWebPanelBase::PopulatePopupMenu(wxMenu& menuPopup, const wxWebEvent& evt)
{
using namespace wxwc_util;
wxString href = evt.GetHref();
if (!href.IsEmpty())
{
static const menu_item_info link_items[] = {
{ ID_OpenHref, wxTRANSLATE("&Open"), wxART_FOLDER_OPEN },
{ ID_CopyLink, wxTRANSLATE("Copy &Link"), wxART_COPY },
{ ID_OpenHrefInDefault, wxTRANSLATE("Open Link in &Default browser") }
};
populate_menu(menuPopup, link_items, sizeof(link_items) / sizeof(link_items[0]));
m_uri_href = href;
}
else
{
static const menu_item_info navigation_items[] = {
{ wxID_BACKWARD, NULL, wxART_GO_BACK },
{ wxID_FORWARD, NULL, wxART_GO_FORWARD },
{ wxID_REFRESH, wxTRANSLATE("&Reload"), wxART_REDO },
{ wxID_STOP, wxTRANSLATE("&Stop loading"), wxART_CROSS_MARK },
};
populate_menu(menuPopup, navigation_items, sizeof(navigation_items) / sizeof(navigation_items[0]));
}
static const menu_item_info generic_items[] = {
{ wxID_SEPARATOR, NULL, NULL },
{ wxID_CUT, NULL, wxART_CUT },
{ wxID_COPY, NULL, wxART_COPY },
{ wxID_PASTE, NULL, wxART_PASTE },
{ wxID_SELECTALL, wxTRANSLATE("Select &All"), NULL },
{ wxID_SEPARATOR, NULL, NULL },
{ wxID_ZOOM_IN, wxTRANSLATE("Larger &Text"), wxART_LIST_VIEW },
{ wxID_ZOOM_OUT, wxTRANSLATE("&Smaller Text"), wxART_REPORT_VIEW },
{ wxID_ZOOM_100, wxTRANSLATE("&Normal Text"), NULL },
};
populate_menu(menuPopup, generic_items, sizeof(generic_items) / sizeof(generic_items[0]));
}