goto-global-line doesn't work properly in @clean files

2015-05-30 Thread vitalije
A few months ago I have filled similar bug report against @nosent files. 
Well that bug is fixed and Leo properly finds global line in @nosent files. 
:-)

OTOH, since then @clean files are introduced and suggested as better 
replacement for @nosent files. Well, command goto-global-line can't find 
proper line in @clean files. If turned into @nosent file, command 
goto-global-line works as advertised. 
I pulled newest version of Leo from git this morning and problem is still 
there.

Leo Log Window

Leo 5.1-final, build 20150529185559, Fri May 29 18:55:59 CDT 2015

Git repo info: branch = master, commit = 9122fe9233cb

Python 2.7.6, PyQt version 4.8.6
linux2

You can see the problem in example.leo file 
https://11707503125000652521.googlegroups.com/attach/63f325cf79f6b2e9/nosent-goto-line-bug.leo?part=0.1vt=ANaJVrEFOqs7FjwohsShTGNcPvTY-neL0Bo1HM69Du4ut9S9FNhvRdiBCr5P9xR8iVVp53Mv15nj28FJb7AWRn6WCrWuTp12GR91I-HvbIlypzqXs6SVYh8
 
that I send for the former bug report, just turn @nosent test.js into 
@clean test.js. Link is here 
https://11707503125000652521.googlegroups.com/attach/63f325cf79f6b2e9/nosent-goto-line-bug.leo?part=0.1vt=ANaJVrEFOqs7FjwohsShTGNcPvTY-neL0Bo1HM69Du4ut9S9FNhvRdiBCr5P9xR8iVVp53Mv15nj28FJb7AWRn6WCrWuTp12GR91I-HvbIlypzqXs6SVYh8


HTH Vitalije.

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: x,y coordinates of text cursor in body

2015-05-30 Thread jkn
Hi John

On Friday, 29 May 2015 13:38:34 UTC+1, john lunzer wrote:

 I've been playing around with trying to extract the x,y screen coordinates 
 of the text cursor in the body but I've come up short. I found QTextCursor 
 but it's position method does not give screen coordinates like QCursor does 
 with its pos method.

 Any help would be greatly appreciated.


I too would be interested in 'recipes' in this area...

Regards
Jon N
 

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: x,y coordinates of text cursor in body

2015-05-30 Thread john lunzer
c.frame.body.widget.cursorRect()

will give you the location of the cursor relative to the text body, I think 
relative to the top left corner. I think that:

c.frame.body.widget.getContentsMargins() also needs to be factored into 
this, ie added to whatever you get from cursorRect()

What I can't figure out is how to determine where the top left corner of 
the text body starts on the screen. I've poured over the members and 
methods for c.frame, c.frame.body, and c.frame.body.widget and I couldn't 
find it.

Hopefully somebody more knowledgeable can weigh in.

On Saturday, May 30, 2015 at 6:13:26 AM UTC-4, jkn wrote:

 Hi John

 On Friday, 29 May 2015 13:38:34 UTC+1, john lunzer wrote:

 I've been playing around with trying to extract the x,y screen 
 coordinates of the text cursor in the body but I've come up short. I found 
 QTextCursor but it's position method does not give screen coordinates like 
 QCursor does with its pos method.

 Any help would be greatly appreciated.


 I too would be interested in 'recipes' in this area...

 Regards
 Jon N
  


-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: x,y coordinates of text cursor in body

2015-05-30 Thread reinhard . engel . de
Since Leo works with PyQT/Qt, a look there might help, i.e.

http://www.qtcentre.org/threads/3073-How-to-get-mouse-s-position

Reinhard



On Saturday, May 30, 2015 at 3:20:03 PM UTC+2, john lunzer wrote:

 c.frame.body.widget.cursorRect()

 will give you the location of the cursor relative to the text body, I 
 think relative to the top left corner. I think that:

 c.frame.body.widget.getContentsMargins() also needs to be factored into 
 this, ie added to whatever you get from cursorRect()

 What I can't figure out is how to determine where the top left corner of 
 the text body starts on the screen. I've poured over the members and 
 methods for c.frame, c.frame.body, and c.frame.body.widget and I couldn't 
 find it.

 Hopefully somebody more knowledgeable can weigh in.

 On Saturday, May 30, 2015 at 6:13:26 AM UTC-4, jkn wrote:

 Hi John

 On Friday, 29 May 2015 13:38:34 UTC+1, john lunzer wrote:

 I've been playing around with trying to extract the x,y screen 
 coordinates of the text cursor in the body but I've come up short. I found 
 QTextCursor but it's position method does not give screen coordinates like 
 QCursor does with its pos method.

 Any help would be greatly appreciated.


 I too would be interested in 'recipes' in this area...

 Regards
 Jon N
  



-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: x,y coordinates of text cursor in body

2015-05-30 Thread john lunzer
While this is definitely interesting and useful it's not the mouse position 
that we're looking for but the text cursor position.

However I think this put me on the right track.

So c.frame.body.widget.cursorRect() will provide something 
like: PyQt4.QtCore.QRect(52, 4, 3, 26)

if that were assigned to variable qr1 you could get the x and y coords via 
qr1.x() and qr1.y()

I believe the method *c.frame.body.widget.mapToGlobal()* provides what i'm 
looking for, the example usage would be:

*c.frame.body.widget.mapToGlobal(QPoint(qr1.x(), qr1.y())*

I haven't fully tested this out but the numbers I'm getting out look right.

If anyone else has any comments let me know. I'll try to integrate this 
into a new Leo command I've been working on and keep you updated.

On Saturday, May 30, 2015 at 9:48:04 AM UTC-4, reinhard...@googlemail.com 
wrote:

 Since Leo works with PyQT/Qt, a look there might help, i.e.

 http://www.qtcentre.org/threads/3073-How-to-get-mouse-s-position

 or


 http://stackoverflow.com/questions/19825650/python-pyqt4-how-to-detect-the-mouse-click-position-anywhere-in-the-window

 Reinhard



 On Saturday, May 30, 2015 at 3:20:03 PM UTC+2, john lunzer wrote:

 c.frame.body.widget.cursorRect()

 will give you the location of the cursor relative to the text body, I 
 think relative to the top left corner. I think that:

 c.frame.body.widget.getContentsMargins() also needs to be factored into 
 this, ie added to whatever you get from cursorRect()

 What I can't figure out is how to determine where the top left corner of 
 the text body starts on the screen. I've poured over the members and 
 methods for c.frame, c.frame.body, and c.frame.body.widget and I couldn't 
 find it.

 Hopefully somebody more knowledgeable can weigh in.

 On Saturday, May 30, 2015 at 6:13:26 AM UTC-4, jkn wrote:

 Hi John

 On Friday, 29 May 2015 13:38:34 UTC+1, john lunzer wrote:

 I've been playing around with trying to extract the x,y screen 
 coordinates of the text cursor in the body but I've come up short. I found 
 QTextCursor but it's position method does not give screen coordinates like 
 QCursor does with its pos method.

 Any help would be greatly appreciated.


 I too would be interested in 'recipes' in this area...

 Regards
 Jon N
  



-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.