当前位置: 首页>>代码示例>>C++>>正文


C++ wxWebEvent::GetHref方法代码示例

本文整理汇总了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);
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:30,代码来源:testapp.cpp

示例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]));
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:42,代码来源:webpanel.cpp


注:本文中的wxWebEvent::GetHref方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。