• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxWebEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wxWebEvent的典型用法代码示例。如果您正苦于以下问题:C++ wxWebEvent类的具体用法?C++ wxWebEvent怎么用?C++ wxWebEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wxWebEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: OnLocationChange

void MyFrame::OnLocationChange(wxWebEvent& evt)
{
    // set the url bar
    SetUrlBarValue(evt.GetString());

    // set the DOM content loaded flag to false
    // until the DOM is safely loaded
    m_dom_contentloaded = false;
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:9,代码来源:testapp.cpp


示例3: OnLocationChange

void wxWebPanelBase::OnLocationChange(wxWebEvent& evt)
{
    // set the url bar
#ifdef HAVE_URL_BAR
    SetUrlBarValue(evt.GetString());
#endif

    // set the DOM content loaded flag to false
    // until the DOM is safely loaded
    m_dom_contentloaded = false;
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:11,代码来源:webpanel.cpp


示例4: OnStatusChange

void MyFrame::OnStatusChange(wxWebEvent& evt)
{
    // wxEVT_WEB_STATUSCHANGE is received when the status text
    // changes when a web page is loading
    
    wxStatusBar* status_bar = GetStatusBar();
    status_bar->SetStatusText(evt.GetString());

    // note: the status bar text is reset when
    // all the content is finished loading, in
    // OnDOMContentLoaded()
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:12,代码来源:testapp.cpp


示例5: OnStatusText

void MyFrame::OnStatusText(wxWebEvent& evt)
{
    // wxEVT_WEB_STATUSTEXT is received when somebody hovers
    // the mouse over a link and the status text should
    // be updated
    
    wxString status_text = evt.GetString();
    if (status_text.Length() == 0)
        status_text = _("Ready");

    wxStatusBar* status_bar = GetStatusBar();
    status_bar->SetStatusText(status_text);
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:13,代码来源:testapp.cpp


示例6: OnStatusChange

void wxWebPanelBase::OnStatusChange(wxWebEvent& evt)
{
    // wxEVT_WEB_STATUSCHANGE is received when the status text
    // changes when a web page is loading
    if (SetStatusBarIsEnabled())
	{
		wxStatusBar* status_bar = m_containing_frame -> GetStatusBar();
		if (NULL != status_bar)
			status_bar->SetStatusText(evt.GetString());
	}
    // note: the status bar text is reset when
    // all the content is finished loading, in
    // OnDOMContentLoaded()
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:14,代码来源:webpanel.cpp


示例7: OnInitDownload

void MyFrame::OnInitDownload(wxWebEvent& evt)
{
    // TODO: add download status indicator and option
    // to open content in the browser

    // note: this handler gets called when content is
    // available to download; the content can be handled
    // as follows:
    //   evt.SetDownloadAction(wxWEB_DOWNLOAD_OPEN);   // open content
    //   evt.SetDownloadAction(wxWEB_DOWNLOAD_SAVEAS); // save content
    //   evt.SetDownloadAction(wxWEB_DOWNLOAD_CANCEL); // cancel the operation

    // here, we'll allow the user to download it or cancel
    // the operation

    // get the filename
    wxString filename = evt.GetFilename();
    wxMessageDialog dlg(this,
                        wxString::Format(wxT("Would you like to download %s?"), (const wxChar*)filename.c_str()),
                        wxT("Download File"),
                        wxYES_NO);

    int result = dlg.ShowModal();

    switch (result)
    {
        case wxID_YES:
            {
                wxString filter;
                filter += _("All Files");
                filter += wxT(" (*.*)|*.*");

                wxFileDialog dlg(this,
                         _("Save As"),
                         wxT(""),
                         filename,
                         filter,
                         wxFD_SAVE | wxFD_OVERWRITE_PROMPT);

                if (dlg.ShowModal() != wxID_OK)
                {
                    evt.SetDownloadAction(wxWEB_DOWNLOAD_CANCEL);
                    return;
                }

                wxWebProgressBase* listener = new wxWebProgressBase;
                evt.SetDownloadAction(wxWEB_DOWNLOAD_SAVEAS);
                evt.SetDownloadTarget(dlg.GetPath());
                evt.SetDownloadListener(listener);
            }
            break;

        case wxID_NO:
            evt.SetDownloadAction(wxWEB_DOWNLOAD_CANCEL);
            break;
    }
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:57,代码来源:testapp.cpp


示例8: OnStateChange

void MyFrame::OnStateChange(wxWebEvent& evt)
{
    // clear the status bar hear since OnStatusChange() doesn't 
    // contain an empty string and we don't want "stuck" text in 
    // the statusbar
    int state = evt.GetState();    
    wxString status_text = _("Ready");
    wxStatusBar* status_bar = GetStatusBar();

    if ((state & wxWEB_STATE_STOP) && (state & wxWEB_STATE_IS_REQUEST))
        status_bar->SetStatusText(status_text);

    if ((state & wxWEB_STATE_STOP) && (state & wxWEB_STATE_IS_REQUEST))
        status_bar->SetStatusText(status_text);
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:15,代码来源:testapp.cpp


示例9: OnShouldHandleContent

void MyFrame::OnShouldHandleContent(wxWebEvent& evt)
{
    // note: this handler gets called when a content
    // type needs to be handled and allows us to determine
    // whether or not we want to handle the content type
    // or let the browser handle it

    // for example, by default, we'll let the browser handle
    // all content types, except XML

    // get the content type
    wxString input_content_type = evt.GetContentType();
    if (input_content_type == wxT("application/xml"))
    {
        // we have an XML content; don't let the browser
        // handle this, since we'll do it ourselves
        evt.SetShouldHandle(false);
        
        // TODO: custom XML handling
        return;
    }

    evt.Skip();
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:24,代码来源:testapp.cpp


示例10: OnStatusText

void wxWebPanelBase::OnStatusText(wxWebEvent& evt)
{
    // wxEVT_WEB_STATUSTEXT is received when somebody hovers
    // the mouse over a link and the status text should
    // be updated
    if (SetStatusBarIsEnabled())
	{
		wxString status_text = evt.GetString();
		if (status_text.Length() == 0)
			status_text = _("Ready");

		wxStatusBar* status_bar = m_containing_frame -> GetStatusBar();
		if (NULL != status_bar)
			status_bar->SetStatusText(status_text);
	}
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:16,代码来源:webpanel.cpp


示例11: 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


示例12: OnStateChange

void wxWebPanelBase::OnStateChange(wxWebEvent& evt)
{
    // clear the status bar hear since OnStatusChange() doesn't 
    // contain an empty string and we don't want "stuck" text in 
    // the statusbar
    int state = evt.GetState();  
	if (SetStatusBarIsEnabled())
	{
		wxStatusBar* status_bar = m_containing_frame -> GetStatusBar();
		if (NULL != status_bar)
		{
			wxString status_text = _("Ready");
   

			if ((state & wxWEB_STATE_STOP) && (state & wxWEB_STATE_IS_REQUEST))
				status_bar->SetStatusText(status_text);

			if ((state & wxWEB_STATE_STOP) && (state & wxWEB_STATE_IS_REQUEST))
				status_bar->SetStatusText(status_text);
		}
	}
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:22,代码来源:webpanel.cpp


示例13: OnTitleChange

void MyFrame::OnTitleChange(wxWebEvent& evt)
{
    SetTitle(evt.GetString());
}
开发者ID:kolosov,项目名称:webconnect2,代码行数:4,代码来源:testapp.cpp


示例14: OnWebTitleChange

void PreviewDlg::OnWebTitleChange(wxWebEvent& evt) {
	const wxString title = evt.GetString();
	OnTitleChange(title);
}
开发者ID:GunioRobot,项目名称:e,代码行数:4,代码来源:PreviewDlg.cpp


示例15: OnTitleChange

void wxWebPanelBase::OnTitleChange(wxWebEvent& evt)
{
	if (SetTitleBarIsEnabled())
		m_containing_frame -> SetTitle(evt.GetString());
}
开发者ID:yitzikc,项目名称:wxwebconnect,代码行数:5,代码来源:webpanel.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxWebViewEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxVideoMode类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap