wxWebView+wxSmith+wxEVT_WEBVIEW_LOADED

Hi all
I created a dialog based, wxWidgets project and am using wxSmith to handle graphical issues and properties.
I am a beginner in wxwidgets but with the help of wxSmith I can build graphical interfaces and handle control events also by using the wxSmith IDE to create the code skeleton for the events.

Now, I need to put a wxWebView in the dialog but wxWebView does not appear in the wxSmith toolbox. I solved this problem by adding it by hand to the dialog class and to the vertical box sizer. It works. But now I need to handle the wxEVT_WEBVIEW_LOADED. I always used wxSmith to handle control events but as wxWebView does not appear in wxSmith I dont know how to handle this event by hand.

Is it possible to add wxWebView to the wxSmith toolbox? How? After that, can I use wxSmith to handle wxEVT_WEBVIEW_LOADED?

If not, how to write wxEVT_WEBVIEW_LOADED event for the wxWebView control I have in the dialog?

Thanks a lot

Alex

According to the docs:
EVT_WEBVIEW_LOADED(id, func):
Process a wxEVT_WEBVIEW_LOADED event generated when the document is fully loaded and displayed. Note that if the displayed HTML document has several frames, one such event will be generated per frame.



The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
void handlerFuncName(wxWebViewEvent& event)


So you use Connect() or Bind() or event tables (not recommended anymore in wxwidgets):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CMainFrame::CMainFrame() {
this->Connect ( wxID_ANY, wxEVT_WEBVIEW_LOADED,
                    wxWebViewEventHandler (
                        CMainFrame::OnWebViewLoaded ) );

// other code here
}

// method implementation
void  CMainFrame::OnWebViewLoaded (wxWebViewEvent& event) {
// process event here
}

// destructor
CMainFrame::CMainFrame() {
this->Disconnect ( wxID_ANY, wxEVT_WEBVIEW_LOADED,
                    wxWebViewEventHandler (
                        CMainFrame::OnWebViewLoaded ) );

// other code here
}
Great, it works!
What about adding wxWebView to wxSmith toolbox?

Alex
Don't know about that. wxCrafter supports wxWebView if you insist on using a GUI editor for that, it costs only $39 USD.
http://wxcrafter.codelite.org


However no GUI tool will help you if you don't understand how wxWidgets works.
Topic archived. No new replies allowed.