bool CanGetPageSource();
wxString GetPageSource();
void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString);
-
+
//we need to resize the webview when the control size changes
void OnSize(wxSizeEvent &event);
protected:
wxWindowID m_windowID;
wxString m_currentURL;
wxString m_pageTitle;
- void* m_webView;
+ objc_object* m_webView;
//It should be WebView, but WebView is Cocoa only, so any class which included
//this header would have to link to Cocoa, so for now use void* instead.
};
bool wxWebKitCtrl::GoBack(){
if ( !m_webView )
return false;
-
- [m_webView goBack];
- return true;
+
+ bool result = [(WebView*)m_webView goBack];
+ return result;
}
bool wxWebKitCtrl::GoForward(){
if ( !m_webView )
return false;
- [m_webView goForward];
- return true;
+ bool result = [(WebView*)m_webView goForward];
+ return result;
}
void wxWebKitCtrl::Reload(){
}
wxString wxWebKitCtrl::GetPageSource(){
- if ( !m_webView )
- return wxT("");
if (CanGetPageSource()){
WebDataSource* dataSource = [[m_webView mainFrame] dataSource];
return wxStringWithNSString( [[dataSource representation] documentSource] );
}
+ return wxT("");
}
void wxWebKitCtrl::SetPageSource(wxString& source, const wxString& baseUrl){
wxWindow* parent = GetParent();
bool inNotebook = false;
int x = 0;
- int y = 18;
+ int y = 18;
while(parent != NULL)
{
// keep adding the position until we hit the notebook