From: Kevin Ollivier Date: Wed, 26 May 2004 04:11:43 +0000 (+0000) Subject: wxWebKikStateChangedEvent should now return proper values for GetURL(). Also updated... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fba8e95e92adcdfdd3507c26a6e8cefabbbfef57?ds=inline wxWebKikStateChangedEvent should now return proper values for GetURL(). Also updated the sample to update the text URL when a link is clicked. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/html/htmlctrl/htmlctrl.cpp b/samples/html/htmlctrl/htmlctrl.cpp index 83687c029f..055a977795 100755 --- a/samples/html/htmlctrl/htmlctrl.cpp +++ b/samples/html/htmlctrl/htmlctrl.cpp @@ -219,6 +219,7 @@ void MyFrame::OnStateChanged(wxWebKitStateChangedEvent& myEvent){ if (GetStatusBar() != NULL){ if (myEvent.GetState() == wxWEBKIT_STATE_NEGOTIATING){ GetStatusBar()->SetStatusText(_("Contacting ") + myEvent.GetURL()); + urlText->SetValue(myEvent.GetURL()); } else if (myEvent.GetState() == wxWEBKIT_STATE_TRANSFERRING){ GetStatusBar()->SetStatusText(_("Loading ") + myEvent.GetURL()); diff --git a/src/html/htmlctrl/webkit/webkit.mm b/src/html/htmlctrl/webkit/webkit.mm index 2284be56a8..53e4c8438d 100755 --- a/src/html/htmlctrl/webkit/webkit.mm +++ b/src/html/htmlctrl/webkit/webkit.mm @@ -284,7 +284,7 @@ void wxWebKitCtrl::OnSize(wxSizeEvent &event){ - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame { if (frame == [sender mainFrame]){ - NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString]; + NSString *url = [[[[frame dataSource] request] URL] absoluteString]; wxWebKitStateChangedEvent thisEvent(webKitWindow); thisEvent.SetState(wxWEBKIT_STATE_TRANSFERRING); thisEvent.SetURL( wxStringWithNSString( url ) ); @@ -295,7 +295,7 @@ void wxWebKitCtrl::OnSize(wxSizeEvent &event){ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame { if (frame == [sender mainFrame]){ - NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString]; + NSString *url = [[[[frame dataSource] request] URL] absoluteString]; wxWebKitStateChangedEvent thisEvent(webKitWindow); thisEvent.SetState(wxWEBKIT_STATE_STOP); thisEvent.SetURL( wxStringWithNSString( url ) ); @@ -306,7 +306,7 @@ void wxWebKitCtrl::OnSize(wxSizeEvent &event){ - (void)webView:(WebView *)sender didFailLoadWithError:(NSError*) error forFrame:(WebFrame *)frame { if (frame == [sender mainFrame]){ - NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString]; + NSString *url = [[[[frame dataSource] request] URL] absoluteString]; wxWebKitStateChangedEvent thisEvent(webKitWindow); thisEvent.SetState(wxWEBKIT_STATE_FAILED); thisEvent.SetURL( wxStringWithNSString( url ) );