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

List:       kde-kafka
Subject:    Re: Writing the selection code
From:       Jono Bacon <f9808590 () wlv ! ac ! uk>
Date:       2000-11-27 18:49:31
[Download RAW message or body]


Sorry for the delay in replies guys, my mailserver has been down for a few 
days. :-(

On Friday 24 November 2000 16:07, you wrote:
> > OK...so to get a cursor in the HTML widget and add a letter to the DOM,
> > the processing would go like this:
> >
> >  - detect a QMouseEvent on the widget and connect it to a slot
>
> Does the DOM stuff not also supply a widget? It this widget is a
> QScrollView you can use that, otherwise you have to create a new
> QScrollView.
> In the QScrollView there are a host of predefined methods which you can
> use, look under the Protected methods list in the docs.
>
> >  - in the slot, position the cursor where the click took place
>
> Yes.
>
> >  - also in the slot detect which object if any the mouse was over when
> > the click occured
>
> Yes
>
> >  - if there was an object go to that node in the dom tree, if not ?
>
> The object == node-in-dom-tree, right?

Yeah... :-)

> >  - wait for keyboard input and if it occurs add it tot he DOM tree
>
> Inside a new slot.

Yeah.

> > Is that right? The questions I have are:
> >
> >  - how can a cursor object point to a DOM object? I assume you mean once
> > the cursor has been set and the position in the DOM is set, update the
> > posiition in the DOM tree each time the cursor moves.
>
> You only store the position in the cursor, never in the DOM, so that
> won't work.
> But as I said I don't know what a QCursor can do for you. You might just
> want to create a new cursor object. The cursor object would contain things
> like: current paragraph, current node, methods to move the cursor etc.

Well, I would assume the position of the cursor will be kept in the cursor 
object, but the cursor object will also have a connection to the position in 
the DOM tree. I have been looking at the old Kafka code to see how it was 
implemented there and I will report back with any interesting methods.

> >  - if the position in the HTML widget is going to be set with setPos and
> > using a QPoint, how can be line up the text with the cursor?
>
> I don't understand.

I meant if I was to set the cursor position with a coordinate, the cursor may 
not be on the same line as the text and slightly above or below it. Eg.:

        The cat sat on the

If in the above text I placed the cursor at the end of the word 'the'. to 
make the remaining word I need to enter (mat) look correct, the cursor would 
need to be at the same height as the text so all the words like like they are 
on the same line. When I say this, I mean a visual cursor and not a pointer 
in the DOM.

> > I am having a little trouble visualising your idea...although I am sure
> > it will work well. It might be a good idea to write some code for the
> > this to get it implemented if you have time.
>
> Alas...

Alas? Alas ye old programmer did not understand ye old programmers friends 
words of wisdom... ;-)

	Jono

BTW, Thomas I keep getting duplicate messages whenever you post to the list. 
It only seems to happen sporadically and mainly from yourself. I am not sure 
if it is a problem with you or me, although my setup seems to be fine.

-- 
Jono Bacon - [vmlinuz] - jono@kde.org
KDE/Qt Developer - Kafka Maintainer
_______________________________________________
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