本文整理汇总了C++中wxWebViewEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxWebViewEvent类的具体用法?C++ wxWebViewEvent怎么用?C++ wxWebViewEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxWebViewEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnError
/**
* Callback invoked when a loading error occurs
*/
void WebFrame::OnError(wxWebViewEvent& evt)
{
#define WX_ERROR_CASE(type) \
case type: \
category = #type; \
break;
wxString category;
switch (evt.GetInt())
{
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CONNECTION);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CERTIFICATE);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_AUTH);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_SECURITY);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_NOT_FOUND);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_REQUEST);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_USER_CANCELLED);
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_OTHER);
}
wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" + category + " (" + evt.GetString() + ")'");
//Show the info bar with an error
m_info->ShowMessage(_("An error occurred loading ") + evt.GetURL() + "\n" +
"'" + category + "'", wxICON_ERROR);
UpdateState();
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:31,代码来源:webview.cpp
示例2: OnClickLink
void ZLauncherFrame::OnClickLink(wxWebViewEvent& evt)
{
// Open the link on the default browser
wxLaunchDefaultBrowser(evt.GetURL());
// Stop navigation
evt.Veto();
}
开发者ID:TheZoc,项目名称:ZPatcher,代码行数:8,代码来源:ZLauncherFrame.cpp
示例3: OnDocumentLoaded
/**
* Callback invoked when a page is finished loading
*/
void WebFrame::OnDocumentLoaded(wxWebViewEvent& evt)
{
//Only notify if the document is the main frame, not a subframe
if(evt.GetURL() == m_browser->GetCurrentURL())
{
wxLogMessage("%s", "Document loaded; url='" + evt.GetURL() + "'");
}
UpdateState();
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:12,代码来源:webview.cpp
示例4: OnNewWindow
/**
* On new window, we veto to stop extra windows appearing
*/
void WebFrame::OnNewWindow(wxWebViewEvent& evt)
{
wxLogMessage("%s", "New window; url='" + evt.GetURL() + "'");
//If we handle new window events then just load them in this window as we
//are a single window browser
if(m_tools_handle_new_window->IsChecked())
m_browser->LoadURL(evt.GetURL());
UpdateState();
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:14,代码来源:webview.cpp
示例5: OnNavigating
void ViewFrame::OnNavigating(wxWebViewEvent& evt)
{
if(!frozen) {
return;
}
// veto event, to prohibit in-page links
evt.Veto();
// instead, load the default web-browser
openBrowser(evt.GetURL());
}
开发者ID:kimhyunkang,项目名称:markview,代码行数:12,代码来源:viewframe.cpp
示例6: OnError
/**
* Callback invoked when a loading error occurs
*/
void WebFrame::OnError(wxWebViewEvent& evt)
{
wxString errorCategory;
switch (evt.GetInt())
{
case wxWEB_NAV_ERR_CONNECTION:
errorCategory = "wxWEB_NAV_ERR_CONNECTION";
break;
case wxWEB_NAV_ERR_CERTIFICATE:
errorCategory = "wxWEB_NAV_ERR_CERTIFICATE";
break;
case wxWEB_NAV_ERR_AUTH:
errorCategory = "wxWEB_NAV_ERR_AUTH";
break;
case wxWEB_NAV_ERR_SECURITY:
errorCategory = "wxWEB_NAV_ERR_SECURITY";
break;
case wxWEB_NAV_ERR_NOT_FOUND:
errorCategory = "wxWEB_NAV_ERR_NOT_FOUND";
break;
case wxWEB_NAV_ERR_REQUEST:
errorCategory = "wxWEB_NAV_ERR_REQUEST";
break;
case wxWEB_NAV_ERR_USER_CANCELLED:
errorCategory = "wxWEB_NAV_ERR_USER_CANCELLED";
break;
case wxWEB_NAV_ERR_OTHER:
errorCategory = "wxWEB_NAV_ERR_OTHER";
break;
}
wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" + errorCategory + "' (" + evt.GetString() + ")");
//Show the info bar with an error
m_info->ShowMessage(_("An error occurred loading ") + evt.GetURL() + "\n" +
"'" + errorCategory + "' (" + evt.GetString() + ")", wxICON_ERROR);
UpdateState();
}
开发者ID:lukesingh24,项目名称:wxWidgets,代码行数:49,代码来源:webview.cpp
示例7: OnNavigationRequest
/**
* Callback invoked when there is a request to load a new page (for instance
* when the user clicks a link)
*/
void WebFrame::OnNavigationRequest(wxWebViewEvent& evt)
{
if(m_info->IsShown())
{
m_info->Dismiss();
}
wxLogMessage("%s", "Navigation request to '" + evt.GetURL() + "' (target='" +
evt.GetTarget() + "')");
wxASSERT(m_browser->IsBusy());
//If we don't want to handle navigation then veto the event and navigation
//will not take place, we also need to stop the loading animation
if(!m_tools_handle_navigation->IsChecked())
{
evt.Veto();
m_toolbar->EnableTool( m_toolbar_stop->GetId(), false );
}
else
{
UpdateState();
}
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:28,代码来源:webview.cpp
示例8: OnLinkClicked
void mmHomePagePanel::OnLinkClicked(wxWebViewEvent& event)
{
const wxString& url = event.GetURL();
if (url.StartsWith("http://www.moneymanagerex.org"))
{
wxLaunchDefaultBrowser(url);
event.Veto();
}
else if (url.Contains("#"))
{
wxString name = url.AfterLast('#');
wxLogDebug("%s", name);
//Read data from ini DB as JSON then convert it to json::Object
wxString str = Model_Infotable::instance().GetStringInfo("NAV_TREE_STATUS", "");
if (!(str.StartsWith("{") && str.EndsWith("}"))) str = "{}";
std::wstringstream ss;
ss << str.ToStdWstring();
json::Object o;
json::Reader::Read(o, ss);
wxLogDebug("%s", str);
if (name == "TOP_CATEGORIES") {
bool entry = !json::Boolean(o[L"TOP_CATEGORIES"]);
o[L"TOP_CATEGORIES"] = json::Boolean(entry);
}
std::wstringstream wss;
json::Writer::Write(o, wss);
wxLogDebug("%s", wss.str());
wxLogDebug("==========================================");
Model_Infotable::instance().Set("NAV_TREE_STATUS", wss.str());
}
}
开发者ID:leandrosob,项目名称:moneymanagerex,代码行数:36,代码来源:mmhomepagepanel.cpp
示例9: OnNavigationStart
void Viewer::OnNavigationStart(wxWebViewEvent& event) {
wxLaunchDefaultBrowser(event.GetURL());
event.Veto();
}
开发者ID:Eclipse06,项目名称:loot,代码行数:4,代码来源:viewer.cpp
示例10: OnTitleChanged
void WebFrame::OnTitleChanged(wxWebViewEvent& evt)
{
SetTitle(evt.GetString());
wxLogMessage("%s", "Title changed; title='" + evt.GetString() + "'");
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:5,代码来源:webview.cpp
示例11: OnNavigationComplete
/**
* Callback invoked when a navigation request was accepted
*/
void WebFrame::OnNavigationComplete(wxWebViewEvent& evt)
{
wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'");
UpdateState();
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:8,代码来源:webview.cpp
注:本文中的wxWebViewEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论