[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kafka
Subject:    Re: Writing the selection code
From:       Stephan Heigl <stephan () eisscholle ! de>
Date:       2000-11-23 18:25:44
[Download RAW message or body]

On Thursday 23 November 2000 21:52, Jonathan Bacon wrote:
> Hello all,
>
> Over the pas few days I have been getting to grips with DOM, and I have
> it straight, I can begin writing some of the selection methods.
>
> What we need are the following methods:
>
>  - To be able to click in the view and select an object
>  - To be able to click inthe view and select where to write some text
>  - To be able to highlight some text
>  - To be able to highlight objects
>
> I think the primary ones that need to be done are the text based
> methods.
>
> In both types of method (object and text), we need to do two things:
>
>  - Find the position of the selection (or the start and end positions
> for highlighing). this could be done using something like QCursor,
> QMouseEvent or something. Suggestions?

I looked at KHTML and its DOM implementation and i had an idea how to select 
the text but perhaps it's stupid. What about getting the index of the 
selected element from the DOM Tree and then jump to the *index*ed occurance 
of this element in the source.

>
>  - Update the DOM tree with what the user does. If for example we want
> to type text in it would find the node where the mouse is, take in
> keyboard input for one letter, update the DOM, move the cursor
> (keyboard) right one letter and repeat. For updating the DOM we can use
> the KHTML DOM calls, and there is also a method which returns the DOM
> node the user clicks on. This could be reimplemented.

Just reimplementing khtmlMouse*****Event(khtml::Mouse****Event); should be 
the simpliest way

>
> If anyone has suggestions on a better way, or would like to get their
> hands dirty, please speak up.
>
> I am gonna be working on this selection code at the moment, and I will
> be commiting some of the stuff as soon as it is done.
>
> Would anyone else like to write some code?
>
> 	Jono
>
> --------------------------------------
> Jono Bacon - [vmlinuz] -- jono@kde.org
> KDE/Qt Developer - Founder of Linux UK
> --------------------------------------
>
> _______________________________________________
> Kde-kafka mailing list
> Kde-kafka@master.kde.org
> http://master.kde.org/mailman/listinfo/kde-kafka

-- 
-- 

regards,

stephan

___________________________________________________
Website: www.eisscholle.de 
ICQ: 12707332 
Jabber: stephan@jabber.com
_______________________________________________
Kde-kafka mailing list
Kde-kafka@master.kde.org
http://master.kde.org/mailman/listinfo/kde-kafka

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic