Since PC is Window 10, IE 11 is probably used.
wxwidgets version is 3.1.0.
The layout may collapse with my program.
However, when I try to display the same site with IE, it is displayed normally.
Is this a specification?
Or am I misunderstanding how to use it?
Please show the way to solve it.
Thank you.
Code: Select all
//Main.h
#ifndef MAIN_H
#define MAIN_H
#include <wx/wx.h>
#include <wx/image.h>
#include <wx/intl.h>
#include "wx/webview.h"
#include "wx/webviewarchivehandler.h"
#include "wx/webviewfshandler.h"
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
class MyFrame1: public wxFrame {
public:
MyFrame1(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
private:
void set_properties();
void do_layout();
protected:
wxWebView* window_2;
};
#endif
Code: Select all
//Main.cpp
#include "Main.h"
MyFrame1::MyFrame1(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, style)
{
window_2 = wxWebView::New(this, wxID_ANY, "https://stripe.com/", wxDefaultPosition, wxDefaultSize, wxWebViewBackendDefault, 0, "");
set_properties();
do_layout();
}
void MyFrame1::set_properties()
{
SetTitle(_("frame_2"));
window_2->SetMinSize(wxSize(500,500));
}
void MyFrame1::do_layout()
{
wxFlexGridSizer* sizer_1 = new wxFlexGridSizer(1, 1, 0, 0);
sizer_1->Add(window_2, 1, wxEXPAND, 0);
SetSizer(sizer_1);
sizer_1->Fit(this);
sizer_1->AddGrowableRow(0);
sizer_1->AddGrowableCol(0);
Layout();
}
class MyApp: public wxApp {
public:
bool OnInit();
protected:
wxLocale m_locale; // locale we'll be using
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
m_locale.Init();
#ifdef APP_LOCALE_DIR
m_locale.AddCatalogLookupPathPrefix(wxT(APP_LOCALE_DIR));
#endif
m_locale.AddCatalog(wxT(APP_CATALOG));
wxInitAllImageHandlers();
MyFrame1* frame_2 = new MyFrame1(NULL, wxID_ANY, wxEmptyString);
SetTopWindow(frame_2);
frame_2->Show();
return true;
}