#pragma implementation "webkit.h"
#endif
-#if wxUSE_WEBKIT
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/wx.h"
#endif
+#if wxUSE_WEBKIT
+
#ifdef __WXCOCOA__
#include "wx/cocoa/autorelease.h"
#else
SetInitialFrameRect(pos,sizeInstance);
#else
m_macIsUserPane = false;
+ m_peer = new wxMacControl();
wxControl::Create(parent, m_windowID, pos, size, style , validator , name);
WebInitForCarbon();
- HIWebViewCreate( (HIViewRef*) *m_peer );
+ HIWebViewCreate( m_peer->GetControlRefAddr() );
- m_webView = (WebView*) HIWebViewGetWebView( (HIViewRef) *m_peer );
+ m_webView = (WebView*) HIWebViewGetWebView( m_peer->GetControlRef() );
MacPostControlCreate(pos, size);
- HIViewSetVisible( (HIViewRef) *m_peer, true );
+ HIViewSetVisible( m_peer->GetControlRef(), true );
[m_webView setHidden:false];
#endif
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
}
void wxWebKitCtrl::MacVisibilityChanged(){
- bool isHidden = !IsControlVisible( (HIViewRef)*m_peer);
+ bool isHidden = !IsControlVisible( m_peer->GetControlRef());
[m_webView setHidden:isHidden];
}
}
@end
-#endif //wxUSE_WEBKIT
\ No newline at end of file
+#endif //wxUSE_WEBKIT