Click to See Complete Forum and Search --> : Newbie fron russia.


Paima
December 8th, 2009, 05:12 AM
Hello, I'm from Russia.
I am writing my diploma and I've got some questions.
It'll be very cool if you'll help me.
So let me to explain the problem:

I've written the web browser, now i need to make some things that i don't know how to do(

1)I need to select the text on the web page by mouse and determinate it's place in the web document.

2)I need to select some links on the web page and then go through them

3) I need to save the text in .txt document in my hard disk.

So for example I go to the web page with any book. This book have its chapters in the different pages. On the first page I see only links. So I need to go to the any of this links, then I select the text on this pages(my program determinate the position of the text ), then i go to the first page and select all the links, and my program goes through all links and collects the texts in one txt document.

can you help me?

Sorry for my bad English (((

Zaccheus
December 8th, 2009, 11:25 AM
One suggestion for the links ...

Your own code draws those links on the screen. So your code could remember where the links are drawn. When the mouse is clicked, your code can check whether the mouse is at one of those locations.

Paima
December 8th, 2009, 12:14 PM
Can you show me some code example?
here is my whole project:http://www.filedropper.com/linkmover

Zaccheus
December 9th, 2009, 02:26 AM
To be honest I don't want to go through your whole project.

As for the code example ... some pseudo-code:


// Make a dictionary with all the links in your webpage.
SortedDictionary<String,Rectangle> links;

// When you draw the link, remember where you drew it.
DrawLink(linkUrl, linkText, linkRectangle);
links.Add(linkUrl, linkRectangle);
...

Now when the user clicks a link with the mouse, you can check if the click was in any of the rectangles in the dictionary and find out which URL that link goes to.

Paima
December 9th, 2009, 05:37 AM
How can I detect the chosen text position in the whole web-page?

Zaccheus
December 9th, 2009, 06:53 AM
That is is more difficult and I do not know how to do that, sorry.