Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Web browser for desktop and device


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-02-2008, 01:02 PM
Knows the basics
 
Join Date: Dec 2007
Posts: 54
Default How to get the url from the href-"tag"

Hello agraham,
is it possible to get the url from the href -"tag" before it is excecuted by the browser?
At the dzHTMLViewLib is the onhotspot event to do this. It's a nice event, even if you use basic commands instead of url, for href setting.
Should it be that ControlRef returns this data ?

Best regards

berndgoedecke
Reply With Quote
  #12 (permalink)  
Old 03-02-2008, 01:51 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,208
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by berndgoedecke View Post
is it possible to get the url from the href -"tag" before it is excecuted by the browser?
I know very little about html. Show me the code of how to do this with dzHtmlView and I will see.

The ControlRef property returns a reference to the underlying WebBrowser control and would only be of use to pass to another library that understood a .NET WebBrowser. You can't do anything with it in B4PPC.
Reply With Quote
  #13 (permalink)  
Old 03-02-2008, 07:58 PM
Knows the basics
 
Join Date: Dec 2007
Posts: 54
Default Read out table values or properties by using href.

Hello agraham,
I create a table in this way:
For i = 0 To SelSpAnz-2
HtmStr = HtmStr & "<tr>" & crlf
HtmStr = HtmStr & "<td " & Chr(34) & "width=33%" & Chr(34) & " style= " & Chr(34) & "white-space:normal" & "; " & "background-color:#E0E0E0" & Chr(34) & ">" & "<a href='" & SelSpNam(i) & crlf & reader.GetValue(i)& "'>" & SelSpNam(i) & "</a></td>" & crlf
HtmStr = HtmStr & "<td " & Chr(34) & "width=67%" & Chr(34) & " style= " & Chr(34) & "white-space:normal" & "; " & "background-color:#FFFFFF" & Chr(34) & ">" & reader.GetValue(i) & "</td>" & crlf
HtmStr = HtmStr & "</tr>" & crlf
Next

The href-statement "<a href='" & SelSpNam(i) & crlf & reader.GetValue(i)& "'>"
is used by the onhotspot event in this way:

Sub hc_OnHotSPot
DTemp = hc.EncodeUTF8(hc.Url)
TempArr() = StrSplit(DTemp,crlf)
Msgbox("Ausgewählt: " & crlf & "ColumnName: " & TempArr(0) & crlf & "Data: " & TempArr(1))
End Sub

So I can locate the datas in the table or the position or whatever. Dzhtmlview is doing it verry nice but your HTMLBrowser supports some more tags to formate the table, so it would be great to use it in the same way.
I hope this codelines will help you to undestand what my problem is. It would be very helpfull to combinate the very good HTML-compatibility with the onhotspot event or somthing like that.

Best regards
berndgoedecke
Reply With Quote
  #14 (permalink)  
Old 03-03-2008, 09:30 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,208
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by berndgoedecke View Post
your HTMLBrowser supports some more tags to formate the table, so it would be great to use it in the same way.
I am surprised because I thought that both my WebBrowser and dzHtmlView were using the same underlying browser.

I have replaced the original download with a new version 1.1 with amended help file and amended demo apps that hopefully do what you want. The following new things have been added. I didn't add them originally as I didn't realise they might be useful.

DocumentText - a write-only property to set the html text of the browser. There is no way to access the text of the browser when either set by this property or downloaded.

CancelNavigate - a write-only property that cancels navigation if set true during a Navigating event. This property does not work on a device running WM2003.

NavigatingURL - a read-only property that when accessed within or after a Navigating event returns the URL to which the page is navigating. This property returns "Unavailable on WM2003" on a device running WM2003.

Navigating : an event that occurs when the control is starting to navigate to a new web page.

Navigated : an event that occurs when navigation to the new page is complete and and the browser is about to load and display the page.
Reply With Quote
  #15 (permalink)  
Old 03-19-2008, 10:18 PM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default

Agraham,

Thanks for your effort with this library, it works almost perfectly with a little app that I have; I had originally used dzt's similar library but a like some of the other functionality of yours. The one question I do have relates to the way it acts when viewing web pages that are written for pc's(vs. mobile sites). It looks to me like it automatically formats the page for "one column", like PIE does when you set it. Is there any possible way to view it similar to the "desktop" view on PIE? I tried using a panel with a scrollbar but it still formats to basically fit the screen. Thanks for any help you can offer.
Reply With Quote
  #16 (permalink)  
Old 03-20-2008, 09:32 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,208
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by jonjunhobbes View Post
Is there any possible way to view it similar to the "desktop" view on PIE?.
I am afraid not. There probably is lower down somewhere as the .NET browser merely wraps the one used by PIE. However the functionality exposed in .NET does not include this.
Reply With Quote
  #17 (permalink)  
Old 03-20-2008, 02:22 PM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default

Good enough. Thanks for the reply.
Reply With Quote
  #18 (permalink)  
Old 03-30-2008, 09:26 PM
Senior Member
 
Join Date: Mar 2008
Posts: 108
Default

I have this control working perfectly now for my app.

It runs great on my Windows Mobile v5.0 (iPAQ rw6815)

When I try to run my app on my daughters older PDA (Windows Pocket PC v4.20 (I think this is Windows Mobile WM2003?) - iPAQ 3970) the app still works great but when clicking on hyperlinks, nothing happens. Its not such a real prob as the hyperlinks are optional for playing the game but just wondered if there is another option in the DLL or a different (/older) webbrowser.DLL for older Pocket PCs that I should be using?

Any answers greatly received.

PS, I am going to distribute this app freely. Do I need to credit anyone for use of this DLL in my docs? I've no probs with this, just need to know what to put ... In the CHM it says (c) "Andrew Graham - 2008" - is this you agraham ?

Last edited by badkarma : 03-30-2008 at 10:10 PM.
Reply With Quote
  #19 (permalink)  
Old 03-31-2008, 08:20 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,208
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by badkarma View Post
Ianother option in the DLL or a different (/older) webbrowser.DLL for older Pocket PCs that I should be using?
From the help "NavigatingURL : String [i] : When accessed within or after a Navigating event returns the URL to which the page is navigating. This property returns "Unavailable on WM2003" on a device running WM2003." Sorry but this is an OS limitation. There is no work around except to use WM5.0 or later.


Quote:
In the CHM it says (c) "Andrew Graham - 2008" - is this you agraham ?
Reply With Quote
  #20 (permalink)  
Old 03-31-2008, 03:14 PM
Senior Member
 
Join Date: Mar 2008
Posts: 108
Default

Thanks for the reply agraham, I will put you in the credits.

Best regards

Steve
Reply With Quote
Old 05-07-2008, 05:57 AM
Georg
This message has been deleted by Georg. Reason: move to Help Questions
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
When compiling for Device, Desktop code is used Woinowski Bug Reports 6 07-03-2008 09:30 PM
Editable Table - Device & Desktop Erel Code Samples & Tips 8 06-27-2008 01:05 PM
Different behaviour DeskTop and Device HARRY Questions & Help Needed 2 02-22-2008 12:36 PM
Using rapi from desktop to copy file from device to desktop sunnyboyj Questions & Help Needed 9 02-08-2008 11:40 AM
Different behavior in desktop vs. device on AddEvent willisgt Bug Reports 4 01-13-2008 12:29 PM


All times are GMT. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0